diff --git a/src/chat/misc.c b/src/chat/misc.c index 67add7b..eeb9649 100644 --- a/src/chat/misc.c +++ b/src/chat/misc.c @@ -537,12 +537,21 @@ void *why2_listen_server(void *socket) exiting = 1; //EXIT THIS THREAD } else if (strcmp(read + 8, WHY2_CHAT_CODE_PICK_USERNAME) == 0) //PICK USERNAME { - //TODO: Check username + printf("%sEnter username (a-Z, 0-9; max %d characters):\n", WHY2_CLEAR_AND_GO_UP, WHY2_MAX_USERNAME_LENGTH); + fflush(stdout); + + goto continue_input; } else if (strcmp(read + 8, WHY2_CHAT_CODE_INVALID_COMMAND) == 0) //PICK USERNAME { printf("\nInvalid command!\n\n"); fflush(stdout); + goto continue_input; + } else if (strcmp(read + 8, WHY2_CHAT_CODE_INVALID_USERNAME) == 0) //PICK USERNAME + { + printf("\nInvalid username!\n\n\n"); + fflush(stdout); + goto continue_input; } } else