moved WHY2_CHAT_CODE_PICK_USERNAME code sending from loop

This commit is contained in:
Václav Šmejkal 2024-02-18 14:27:10 +01:00
parent b1c104247c
commit 5873d55d98
Signed by: ENGO150
GPG Key ID: 4A57E86482968843

View File

@ -390,6 +390,8 @@ void *why2_communicate_thread(void *arg)
{
if (config_username == NULL) fprintf(stderr, "Your config doesn't contain 'user_pick_username'. Please update your configuration.\n");
why2_send_socket(WHY2_CHAT_CODE_PICK_USERNAME, WHY2_CHAT_SERVER_USERNAME, connection); //ASK USER FOR USERNAME
while (invalid_username)
{
if (usernames_n++ == WHY2_MAX_USERNAME_TRIES) //ASKED CLIENT WAY TOO FUCKING MANY TIMES FOR USERNAME, KICK HIM
@ -398,8 +400,6 @@ void *why2_communicate_thread(void *arg)
goto deallocation;
}
why2_send_socket(WHY2_CHAT_CODE_PICK_USERNAME, WHY2_CHAT_SERVER_USERNAME, connection); //ASK USER FOR USERNAME
if ((raw = read_user(connection, &raw_ptr)) == NULL) //READ
{
force_exiting = 1; //FAILURE