From 03bf6cb7193a2b1715a86009d878693cf6270b26 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 7 Oct 2024 20:36:19 +0300 Subject: [PATCH] engine: client: get rid of PROTOCOL_GOLDSRC_VERSION, as connprotocol_t enum does it's job --- engine/client/cl_demo.c | 6 ++++-- engine/common/protocol.h | 3 +-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/engine/client/cl_demo.c b/engine/client/cl_demo.c index 370fe8b7..b4e22f91 100644 --- a/engine/client/cl_demo.c +++ b/engine/client/cl_demo.c @@ -40,6 +40,8 @@ GNU General Public License for more details. #define IDEMOHEADER (('M'<<24)+('E'<<16)+('D'<<8)+'I') // little-endian "IDEM" #define DEMO_PROTOCOL 3 +#define PROTOCOL_GOLDSRC_VERSION_DEMO (PROTOCOL_GOLDSRC_VERSION | (BIT( 7 ))) // should be 48, only to differentiate it from PROTOCOL_LEGACY_VERSION + const char *demo_cmd[dem_lastcmd+1] = { "dem_unknown", @@ -120,7 +122,7 @@ static int CL_GetDemoNetProtocol( connprotocol_t proto ) case PROTO_QUAKE: return PROTOCOL_VERSION_QUAKE; case PROTO_GOLDSRC: - return PROTOCOL_GOLDSRC_VERSION; + return PROTOCOL_GOLDSRC_VERSION_DEMO; } return PROTOCOL_VERSION; @@ -136,7 +138,7 @@ static connprotocol_t CL_GetProtocolFromDemo( int net_protocol ) return PROTO_LEGACY; case PROTOCOL_VERSION_QUAKE: return PROTO_QUAKE; - case PROTOCOL_GOLDSRC_VERSION: + case PROTOCOL_GOLDSRC_VERSION_DEMO: return PROTO_GOLDSRC; } diff --git a/engine/common/protocol.h b/engine/common/protocol.h index e1451df4..a77dbff5 100644 --- a/engine/common/protocol.h +++ b/engine/common/protocol.h @@ -320,8 +320,7 @@ extern const char *clc_strings[clc_lastmsg+1]; #define MS_SCAN_REQUEST "1\xFF" "0.0.0.0:0\0" // TODO: implement IP filter // GoldSrc protocol definitions -#define PROTOCOL_GOLDSRC_VERSION_REAL 48 -#define PROTOCOL_GOLDSRC_VERSION (PROTOCOL_GOLDSRC_VERSION_REAL | (BIT( 7 ))) // should be 48, only to differentiate it from PROTOCOL_LEGACY_VERSION +#define PROTOCOL_GOLDSRC_VERSION 48 #define svc_goldsrc_version svc_changing #define svc_goldsrc_serverinfo svc_serverdata