moved WHY2_CHAT_CODE_PICK_USERNAME code sending from loop
This commit is contained in:
parent
b1c104247c
commit
5873d55d98
@ -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");
|
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)
|
while (invalid_username)
|
||||||
{
|
{
|
||||||
if (usernames_n++ == WHY2_MAX_USERNAME_TRIES) //ASKED CLIENT WAY TOO FUCKING MANY TIMES FOR USERNAME, KICK HIM
|
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;
|
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
|
if ((raw = read_user(connection, &raw_ptr)) == NULL) //READ
|
||||||
{
|
{
|
||||||
force_exiting = 1; //FAILURE
|
force_exiting = 1; //FAILURE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user