Browse Source

engine: client: sanitize legacy protocol supported engine features flags

Do not enable what can't be enabled in current protocol.
pull/2/head
Alibek Omarov 12 months ago
parent
commit
607e62a1ae
  1. 2
      engine/client/cl_parse.c
  2. 8
      engine/common/protocol.h

2
engine/client/cl_parse.c

@ -904,7 +904,7 @@ void CL_ParseServerData( sizebuf_t *msg, qboolean legacy ) @@ -904,7 +904,7 @@ void CL_ParseServerData( sizebuf_t *msg, qboolean legacy )
background = MSG_ReadOneBit( msg );
Q_strncpy( gamefolder, MSG_ReadString( msg ), sizeof( gamefolder ));
host.features = (uint)MSG_ReadLong( msg );
host.features &= ENGINE_FEATURES_MASK;
host.features &= legacy ? ENGINE_LEGACY_FEATURES_MASK : ENGINE_FEATURES_MASK;
if( !legacy )
{

8
engine/common/protocol.h

@ -305,6 +305,14 @@ extern const char *clc_strings[clc_lastmsg+1]; @@ -305,6 +305,14 @@ extern const char *clc_strings[clc_lastmsg+1];
#define MAX_LEGACY_EDICTS (1 << MAX_LEGACY_ENTITY_BITS) // 4096 edicts
#define MIN_LEGACY_EDICTS 30
// legacy engine features that can be implemented through currently supported features
#define ENGINE_LEGACY_FEATURES_MASK \
( ENGINE_WRITE_LARGE_COORD \
| ENGINE_LOAD_DELUXEDATA \
| ENGINE_LARGE_LIGHTMAPS \
| ENGINE_COMPENSATE_QUAKE_BUG \
| ENGINE_COMPUTE_STUDIO_LERP )
// Master Server protocol
#define MS_SCAN_REQUEST "1\xFF" "0.0.0.0:0\0" // TODO: implement IP filter

Loading…
Cancel
Save