made formatting so fucking pretty
This commit is contained in:
parent
82df5f5b1c
commit
68140fe7c8
@ -640,7 +640,7 @@ void *why2_listen_server(void *socket)
|
|||||||
{
|
{
|
||||||
char *read = NULL;
|
char *read = NULL;
|
||||||
why2_bool exiting = 0;
|
why2_bool exiting = 0;
|
||||||
why2_bool asking_username = 0;
|
unsigned char asking_username = 0;
|
||||||
|
|
||||||
printf(">>> ");
|
printf(">>> ");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
@ -655,7 +655,7 @@ void *why2_listen_server(void *socket)
|
|||||||
{
|
{
|
||||||
if (strcmp(read + 8, WHY2_CHAT_CODE_SSQC) == 0)
|
if (strcmp(read + 8, WHY2_CHAT_CODE_SSQC) == 0)
|
||||||
{
|
{
|
||||||
printf("%s%s\nServer closed the connection.\n", WHY2_CLEAR_AND_GO_UP WHY2_CLEAR_AND_GO_UP, (!asking_username ? "\n": ""));
|
printf("%s%s%s\nServer closed the connection.\n", asking_username == WHY2_MAX_USERNAME_TRIES ? WHY2_CLEAR_AND_GO_UP : "", WHY2_CLEAR_AND_GO_UP WHY2_CLEAR_AND_GO_UP, (asking_username == 0 ? "\n": ""));
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
pthread_cancel(getline_thread); //CANCEL CLIENT getline
|
pthread_cancel(getline_thread); //CANCEL CLIENT getline
|
||||||
@ -668,10 +668,10 @@ void *why2_listen_server(void *socket)
|
|||||||
{
|
{
|
||||||
username_pick:
|
username_pick:
|
||||||
|
|
||||||
printf("%sEnter username (a-Z, 0-9; %d-%d characters):\n", WHY2_CLEAR_AND_GO_UP, WHY2_MIN_USERNAME_LENGTH, WHY2_MAX_USERNAME_LENGTH);
|
printf("%s%sEnter username (a-Z, 0-9; %d-%d characters):\n", asking_username > 0 ? WHY2_CLEAR_AND_GO_UP : "", WHY2_CLEAR_AND_GO_UP, WHY2_MIN_USERNAME_LENGTH, WHY2_MAX_USERNAME_LENGTH);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
asking_username = 1;
|
asking_username++;
|
||||||
|
|
||||||
goto continue_input;
|
goto continue_input;
|
||||||
} else if (strcmp(read + 8, WHY2_CHAT_CODE_INVALID_COMMAND) == 0) //PICK USERNAME
|
} else if (strcmp(read + 8, WHY2_CHAT_CODE_INVALID_COMMAND) == 0) //PICK USERNAME
|
||||||
@ -682,7 +682,7 @@ void *why2_listen_server(void *socket)
|
|||||||
goto continue_input;
|
goto continue_input;
|
||||||
} else if (strcmp(read + 8, WHY2_CHAT_CODE_INVALID_USERNAME) == 0) //PICK USERNAME
|
} else if (strcmp(read + 8, WHY2_CHAT_CODE_INVALID_USERNAME) == 0) //PICK USERNAME
|
||||||
{
|
{
|
||||||
printf("\nInvalid username!\n\n\n");
|
printf(WHY2_CLEAR_AND_GO_UP WHY2_CLEAR_AND_GO_UP "%s\nInvalid username!\n\n\n", asking_username > 1 ? WHY2_CLEAR_AND_GO_UP : "");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
goto username_pick;
|
goto username_pick;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user