moved tries check to top of username loop
This commit is contained in:
parent
73d0f64fc9
commit
d58efbd035
@ -389,6 +389,12 @@ void *why2_communicate_thread(void *arg)
|
|||||||
|
|
||||||
if (config_username == NULL || strcmp(config_username, "true") == 0)
|
if (config_username == NULL || strcmp(config_username, "true") == 0)
|
||||||
{
|
{
|
||||||
|
if (usernames_n++ == WHY2_MAX_USERNAME_TRIES) //ASKED CLIENT WAY TOO FUCKING MANY TIMES FOR USERNAME, KICK HIM
|
||||||
|
{
|
||||||
|
exiting = 1;
|
||||||
|
goto deallocation;
|
||||||
|
}
|
||||||
|
|
||||||
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");
|
||||||
|
|
||||||
while (invalid_username)
|
while (invalid_username)
|
||||||
@ -416,12 +422,6 @@ void *why2_communicate_thread(void *arg)
|
|||||||
{
|
{
|
||||||
why2_send_socket(WHY2_CHAT_CODE_INVALID_USERNAME, WHY2_CHAT_SERVER_USERNAME, connection); //TELL THE USER HE IS DUMB AS FUCK
|
why2_send_socket(WHY2_CHAT_CODE_INVALID_USERNAME, WHY2_CHAT_SERVER_USERNAME, connection); //TELL THE USER HE IS DUMB AS FUCK
|
||||||
}
|
}
|
||||||
|
|
||||||
if (++usernames_n == WHY2_MAX_USERNAME_TRIES) //ASKED CLIENT WAY TOO FUCKING MANY TIMES FOR USERNAME, KICK HIM
|
|
||||||
{
|
|
||||||
exiting = 1;
|
|
||||||
goto deallocation;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user