From 97ba47314305c6e6fbee2a445a5d6b7684e80c67 Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Sat, 27 Apr 2024 12:01:49 +0200 Subject: [PATCH] removed INVALID_COMMAND code it was unused atp --- include/chat/flags.h | 3 +-- src/chat/main/client.c | 4 ++++ src/chat/misc.c | 4 ---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/chat/flags.h b/include/chat/flags.h index e1fe724..401d36b 100644 --- a/include/chat/flags.h +++ b/include/chat/flags.h @@ -36,8 +36,7 @@ extern "C" { #define WHY2_CHAT_CODE_ACCEPT_MESSAGES "code_000" #define WHY2_CHAT_CODE_PICK_USERNAME "code_001" #define WHY2_CHAT_CODE_SERVER_SIDE_QUIT_COMMUNICATION "code_002" -#define WHY2_CHAT_CODE_INVALID_COMMAND "code_003" -#define WHY2_CHAT_CODE_INVALID_USERNAME "code_004" +#define WHY2_CHAT_CODE_INVALID_USERNAME "code_003" //(SERVER -> CLIENT) CODES #define WHY2_CHAT_CODE_EXIT "code_999" diff --git a/src/chat/main/client.c b/src/chat/main/client.c index e9bc7e0..6b57797 100644 --- a/src/chat/main/client.c +++ b/src/chat/main/client.c @@ -183,6 +183,10 @@ int main(void) } else if (command(line, WHY2_CHAT_COMMAND_LIST, &cmd_arg)) //HELP CMD { why2_send_socket(WHY2_CHAT_CODE_LIST, NULL, listen_socket); + } else + { + printf("\nInvalid command! Use \"" WHY2_CHAT_COMMAND_PREFIX WHY2_CHAT_COMMAND_HELP "\" for list of commands.\n\n>>> "); + fflush(stdout); } } else { diff --git a/src/chat/misc.c b/src/chat/misc.c index eb71219..20eff3f 100644 --- a/src/chat/misc.c +++ b/src/chat/misc.c @@ -772,10 +772,6 @@ void *why2_listen_server(void *socket) 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, min_uname, max_uname); fflush(stdout); - } else if (strcmp(message, WHY2_CHAT_CODE_INVALID_COMMAND) == 0) //INVALID CMD - { - printf("\nInvalid command! Use \"" WHY2_CHAT_COMMAND_PREFIX WHY2_CHAT_COMMAND_HELP "\" for list of commands.\n\n"); - fflush(stdout); } } else if (!continuing) {