From 5873d55d980dd260626283963089f055122275f3 Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Sun, 18 Feb 2024 14:27:10 +0100 Subject: [PATCH] moved WHY2_CHAT_CODE_PICK_USERNAME code sending from loop --- src/chat/misc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chat/misc.c b/src/chat/misc.c index 97c60e5..dba0bb7 100644 --- a/src/chat/misc.c +++ b/src/chat/misc.c @@ -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