sending server_name in welcome packet

This commit is contained in:
Václav Šmejkal 2024-08-30 14:51:27 +02:00
parent 875a1b8ac2
commit c28765a4c8
Signed by: ENGO150
GPG Key ID: 4A57E86482968843

View File

@ -416,16 +416,19 @@ void send_socket(char *text, char *username, int socket, why2_bool welcome)
char *max_uname = why2_chat_server_config("max_username_length"); char *max_uname = why2_chat_server_config("max_username_length");
char *min_uname = why2_chat_server_config("min_username_length"); char *min_uname = why2_chat_server_config("min_username_length");
char *max_tries = why2_chat_server_config("max_username_tries"); char *max_tries = why2_chat_server_config("max_username_tries");
char *server_name = why2_chat_server_config("server_name");
//ADD THE INFO OBJS //ADD THE INFO OBJS
json_object_object_add(json, "max_uname", json_object_new_string(max_uname)); json_object_object_add(json, "max_uname", json_object_new_string(max_uname));
json_object_object_add(json, "min_uname", json_object_new_string(min_uname)); json_object_object_add(json, "min_uname", json_object_new_string(min_uname));
json_object_object_add(json, "max_tries", json_object_new_string(max_tries)); json_object_object_add(json, "max_tries", json_object_new_string(max_tries));
json_object_object_add(json, "server_name", json_object_new_string(server_name));
//DEALLOCATION //DEALLOCATION
why2_toml_read_free(max_uname); why2_toml_read_free(max_uname);
why2_toml_read_free(min_uname); why2_toml_read_free(min_uname);
why2_toml_read_free(max_tries); why2_toml_read_free(max_tries);
why2_toml_read_free(server_name);
} }
//GENERATE JSON STRING //GENERATE JSON STRING