From c24a1fafc52c33411fb97e85e1f0d8b6fd086393 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 3 Apr 2023 06:04:48 +0300 Subject: [PATCH] engine: add missing HPAK_CheckSize/Integrity calls --- engine/client/cl_parse.c | 2 ++ engine/common/host.c | 2 ++ engine/server/sv_init.c | 3 +++ 3 files changed, 7 insertions(+) diff --git a/engine/client/cl_parse.c b/engine/client/cl_parse.c index ec7f5a55..c7d6eaf6 100644 --- a/engine/client/cl_parse.c +++ b/engine/client/cl_parse.c @@ -851,6 +851,8 @@ void CL_ParseServerData( sizebuf_t *msg, qboolean legacy ) qboolean background; int i; + HPAK_CheckSize( CUSTOM_RES_PATH ); + Con_Reportf( "%s packet received.\n", legacy ? "Legacy serverdata" : "Serverdata" ); cls.timestart = Sys_DoubleTime(); diff --git a/engine/common/host.c b/engine/common/host.c index d472d9f5..459fa11e 100644 --- a/engine/common/host.c +++ b/engine/common/host.c @@ -1213,6 +1213,8 @@ int EXPORT Host_Main( int argc, char **argv, const char *progname, int bChangeGa } else Cmd_AddRestrictedCommand( "minimize", Host_Minimize_f, "minimize main window to tray" ); + HPAK_CheckIntegrity( CUSTOM_RES_PATH ); + host.errorframe = 0; // post initializations diff --git a/engine/server/sv_init.c b/engine/server/sv_init.c index a6e3baf9..06263c5a 100644 --- a/engine/server/sv_init.c +++ b/engine/server/sv_init.c @@ -945,6 +945,9 @@ qboolean SV_SpawnServer( const char *mapname, const char *startspot, qboolean ba current_skill = bound( 0, current_skill, 3 ); Cvar_SetValue( "skill", (float)current_skill ); + // enforce hpk_maxsize + HPAK_CheckSize( CUSTOM_RES_PATH ); + // force normal player collisions for single player if( svs.maxclients == 1 ) Cvar_SetValue( "sv_clienttrace", 1 );