From ee5d131b9c756050fd646a3f7d79afd26234a208 Mon Sep 17 00:00:00 2001 From: Denis Pauk Date: Thu, 21 Mar 2024 00:49:56 +0200 Subject: [PATCH] client: add xatrix demo protocol check --- src/client/cl_parse.c | 10 ++++++++++ src/common/header/common.h | 2 ++ src/common/movemsg.c | 1 + 3 files changed, 13 insertions(+) diff --git a/src/client/cl_parse.c b/src/client/cl_parse.c index cd01e393..60b19593 100644 --- a/src/client/cl_parse.c +++ b/src/client/cl_parse.c @@ -145,6 +145,7 @@ CL_ParseDelta(entity_state_t *from, entity_state_t *to, int number, int bits) if ((cls.serverProtocol == PROTOCOL_RELEASE_VERSION) || (cls.serverProtocol == PROTOCOL_DEMO_VERSION) || + (cls.serverProtocol == PROTOCOL_XATRIX_VERSION) || (cls.serverProtocol == PROTOCOL_RR97_VERSION)) { if (bits & U_MODEL) @@ -546,6 +547,7 @@ CL_ConvertConfigStringFrom(int i) { if (cls.serverProtocol == PROTOCOL_RELEASE_VERSION || cls.serverProtocol == PROTOCOL_DEMO_VERSION || + cls.serverProtocol == PROTOCOL_XATRIX_VERSION || cls.serverProtocol == PROTOCOL_RR97_VERSION) { if (i >= CS_MODELS_Q2DEMO && i < CS_SOUNDS_Q2DEMO) @@ -922,6 +924,7 @@ CL_ParseServerData(void) if (Com_ServerState() && ( (i == PROTOCOL_RELEASE_VERSION) || (i == PROTOCOL_DEMO_VERSION) || + (i == PROTOCOL_XATRIX_VERSION) || (i == PROTOCOL_RR97_VERSION) || (i == PROTOCOL_RR22_VERSION) || (i == PROTOCOL_RR23_VERSION) || @@ -933,18 +936,25 @@ CL_ParseServerData(void) case PROTOCOL_RELEASE_VERSION: Com_Printf("Quake 2 Demo\n"); break; + case PROTOCOL_XATRIX_VERSION: + Com_Printf("Quake 2 Xatrix Demo\n"); + break; case PROTOCOL_DEMO_VERSION: Com_Printf("Quake 2 Release Demo\n"); break; + /* Network protocol */ case PROTOCOL_RR97_VERSION: Com_Printf("Quake 2\n"); break; + /* ReRelease Demo */ case PROTOCOL_RR22_VERSION: Com_Printf("ReRelease Quake 2 Demo\n"); break; + /* ReRelease network protocol */ case PROTOCOL_RR23_VERSION: Com_Printf("ReRelease Quake 2\n"); break; + /* Our new protocol */ case PROTOCOL_VERSION: Com_Printf("ReRelease Quake 2 Custom version\n"); break; diff --git a/src/common/header/common.h b/src/common/header/common.h index a364dbf8..c5004b21 100644 --- a/src/common/header/common.h +++ b/src/common/header/common.h @@ -179,6 +179,8 @@ void Info_Print(char *s); #define PROTOCOL_RELEASE_VERSION 26 /* Quake 2 Demo */ #define PROTOCOL_DEMO_VERSION 31 +/* Quake 2 Xatrix Demo */ +#define PROTOCOL_XATRIX_VERSION 32 /* Quake 2 Network Release */ #define PROTOCOL_RR97_VERSION 34 /* ReRelease demo files */ diff --git a/src/common/movemsg.c b/src/common/movemsg.c index f339b4de..7a378c20 100644 --- a/src/common/movemsg.c +++ b/src/common/movemsg.c @@ -647,6 +647,7 @@ MSG_WriteDeltaEntity(entity_state_t *from, if ((protocol == PROTOCOL_RELEASE_VERSION) || (protocol == PROTOCOL_DEMO_VERSION) || + (protocol == PROTOCOL_XATRIX_VERSION) || (protocol == PROTOCOL_RR97_VERSION)) { if (bits & U_MODEL)