From 64773d1f3039488a30389a85bab7e366d26ad646 Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Wed, 28 Aug 2024 12:45:18 +0200 Subject: [PATCH] implemented version cmd receive half on client-side --- src/chat/misc.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/chat/misc.c b/src/chat/misc.c index 67e8735..0e27e25 100644 --- a/src/chat/misc.c +++ b/src/chat/misc.c @@ -844,6 +844,18 @@ void *why2_listen_server(void *socket) printf("\n"); fflush(stdout); + } else if (strncmp(message, WHY2_CHAT_CODE_VERSION_SERVER, strlen(WHY2_CHAT_CODE_VERSION_SERVER)) == 0) + { + char *server_version = message + strlen(WHY2_CHAT_CODE_VERSION_SERVER) + 1; + + //INFO + printf("\nServer Version: %s\nClient Version: %s\n\n", server_version, WHY2_VERSION); + + //SERVER IS OUTDATED + if (atoi(server_version + 1) < atoi(WHY2_VERSION + 1)) + { + printf("Server is outdated. Some new features may not work correctly.\n\n"); + } } } else if (!continuing) {