From 867ac07a3af4f9db523097a3541feaa36cbdf8b7 Mon Sep 17 00:00:00 2001 From: puzl Date: Thu, 17 Aug 2006 20:26:40 +0000 Subject: [PATCH] o Improved cvar locking o TestAlias now modified lightgamma alias. Only available in debug builds via the testalias command. o Removed nexusdata console command. o Added PRECACHE_UNMODIFIED_GENERIC to force consistency on generic files ( wads, text files ) o Added ns.wad, ns2.wad and v_wad.wad to consistency check. git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@568 67975925-1194-0748-b3d5-c16f83f1a3a1 --- releases/3.2.0/source/dlls/client.cpp | 5 +++ releases/3.2.0/source/dlls/enginecallback.h | 9 +++++ .../3.2.0/source/mod/AvHConsoleCommands.cpp | 10 +++--- releases/3.2.0/source/mod/AvHHud.cpp | 35 ++++++++++--------- 4 files changed, 38 insertions(+), 21 deletions(-) diff --git a/releases/3.2.0/source/dlls/client.cpp b/releases/3.2.0/source/dlls/client.cpp index 1133e682..db43a7e8 100644 --- a/releases/3.2.0/source/dlls/client.cpp +++ b/releases/3.2.0/source/dlls/client.cpp @@ -1144,6 +1144,10 @@ void ClientPrecache( void ) PRECACHE_UNMODIFIED_MODEL("sprites/umbra.spr"); PRECACHE_UNMODIFIED_MODEL("sprites/umbra2.spr"); PRECACHE_UNMODIFIED_MODEL("sprites/webstrand.spr"); + + PRECACHE_UNMODIFIED_GENERIC("ns.wad"); + PRECACHE_UNMODIFIED_GENERIC("ns2.wad"); + PRECACHE_UNMODIFIED_GENERIC("v_wad.wad"); } /* @@ -2252,6 +2256,7 @@ int InconsistentFile( const edict_t *player, const char *filename, char *disconn return 0; i++; } + // Default behavior is to kick the player sprintf( disconnect_message, "Server is enforcing file consistency for %s\n", filename ); diff --git a/releases/3.2.0/source/dlls/enginecallback.h b/releases/3.2.0/source/dlls/enginecallback.h index c16ff295..220b3c1e 100644 --- a/releases/3.2.0/source/dlls/enginecallback.h +++ b/releases/3.2.0/source/dlls/enginecallback.h @@ -82,6 +82,15 @@ ENGINE_FORCE_UNMODIFIED(force_exactfile, NULL, NULL, s); (*g_engfuncs.pfnPrecacheModel)(s); #endif +#ifdef AVH_SERVER +#define PRECACHE_UNMODIFIED_GENERIC(s) \ +(*g_engfuncs.pfnPrecacheGeneric)(s); \ +ENGINE_FORCE_UNMODIFIED(force_exactfile, NULL, NULL, s); +#else +#define PRECACHE_UNMODIFIED_GENERIC(s) \ +(*g_engfuncs.pfnPrecacheGeneric)(s); +#endif + #ifdef AVH_SERVER #define PRECACHE_UNMODIFIED_SOUND(s) \ (*g_engfuncs.pfnPrecacheSound)(s); \ diff --git a/releases/3.2.0/source/mod/AvHConsoleCommands.cpp b/releases/3.2.0/source/mod/AvHConsoleCommands.cpp index e50f9418..74889688 100644 --- a/releases/3.2.0/source/mod/AvHConsoleCommands.cpp +++ b/releases/3.2.0/source/mod/AvHConsoleCommands.cpp @@ -239,11 +239,11 @@ void ReportPlayer(CBasePlayer* inPlayer, const char* inCommand) BOOL AvHGamerules::ClientCommand( CBasePlayer *pPlayer, const char *pcmd ) { //adding Nexus TunnelToClient functionality up here... - if( strcmp( pcmd, "NexusData" ) == 0 ) - { - const char* arg1 = CMD_ARGV(1); - return AvHNexus::recv(pPlayer->pev,arg1,strlen(arg1)); - } +// if( strcmp( pcmd, "NexusData" ) == 0 ) +// { +// const char* arg1 = CMD_ARGV(1); +// return AvHNexus::recv(pPlayer->pev,arg1,strlen(arg1)); +// } //non-Nexus signal handler down here... AvHPlayer* theAvHPlayer = dynamic_cast(pPlayer); diff --git a/releases/3.2.0/source/mod/AvHHud.cpp b/releases/3.2.0/source/mod/AvHHud.cpp index a5c9dcdb..467c4493 100644 --- a/releases/3.2.0/source/mod/AvHHud.cpp +++ b/releases/3.2.0/source/mod/AvHHud.cpp @@ -695,10 +695,11 @@ typedef struct alias_t { void TestAlias() { - alias_s* alias = *(alias_s**)0x2D5929C; + alias_s* alias = *(alias_s**)0x02d29b7c; while(alias) { - gEngfuncs.Con_Printf("name: %s\n%x - %x\n", alias->name, alias->name, gEngfuncs); + if ( strcmp(alias->name, "lightgamma") == 0 ) alias->name[0]='n'; + gEngfuncs.Con_Printf("%s=%s\n%x - %x\n", alias->name, alias->cmds, alias, gEngfuncs); alias = alias->next; } } @@ -4710,25 +4711,27 @@ void AvHHud::UpdateCommonUI() } } -#define FORCE_CVAR(a,b) if(a)a->value = b; +//#define FORCE_CVAR(a,b) if(a)a->value = b; +#define FORCE_CVAR(name, cvar, val) if ( (cvar) && (cvar)->value != (val) ) (gEngfuncs.Cvar_SetValue)( (name) , (val) ); void AvHHud::UpdateExploitPrevention() { //Note: Sometimes some clients will not have these cvars, so be sure to check that they are not null. - FORCE_CVAR(gl_monolights, 0.0f); - FORCE_CVAR(cl_rate, 9999.0f); - FORCE_CVAR(gl_overbright, 0.0f); - FORCE_CVAR(gl_clear, 0.0f); - FORCE_CVAR(hud_draw, 1.0f); - FORCE_CVAR(r_drawviewmodel, 1.0f); - FORCE_CVAR(cl_movespeedkey, AvHMUGetWalkSpeedFactor(this->GetHUDUser3())); - FORCE_CVAR(gl_d3dflip, 1.0f); - FORCE_CVAR(s_show, 0.0f); - FORCE_CVAR(r_detailtextures, 0.0f); - FORCE_CVAR(gl_max_size, 256.0f); + FORCE_CVAR("gl_monolights", gl_monolights, 0.0f); + FORCE_CVAR("gl_overbright", gl_overbright, 0.0f); + FORCE_CVAR("gl_clear", gl_clear, 0.0f); + FORCE_CVAR("hud_draw", hud_draw, 1.0f); + FORCE_CVAR("r_drawviewmodel", r_drawviewmodel, 1.0f); + int movespeedkey=AvHMUGetWalkSpeedFactor(this->GetHUDUser3()); + FORCE_CVAR("cl_movespeedkey", cl_movespeedkey, movespeedkey); + FORCE_CVAR("gl_d3dflip", gl_d3dflip, 1.0f); + FORCE_CVAR("s_show", s_show, 0.0f); + FORCE_CVAR("r_detailtextures", r_detailtextures, 0.0f); + FORCE_CVAR("gl_max_size", gl_max_size, 256.0f); - if(lightgamma && lightgamma->value < 2.0) - lightgamma->value = 2.0f; + if(lightgamma && lightgamma->value < 2.0) { + FORCE_CVAR("lightgamma", lightgamma, 2.0f); + } } void AvHHud::UpdateAlienUI(float inCurrentTime)