From 48fea1668659401f2d050eb32e2912d05799c05d Mon Sep 17 00:00:00 2001 From: Velaron Date: Fri, 14 Feb 2025 20:07:11 +0200 Subject: [PATCH] client: use FilteredClientCmd for DRC_CMD_STUFFTEXT --- cl_dll/cl_util.h | 1 + cl_dll/hud_spectator.cpp | 2 +- engine/APIProxy.h | 4 ++++ engine/cdll_int.h | 2 ++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cl_dll/cl_util.h b/cl_dll/cl_util.h index 0d3e0db3..067a7b5d 100644 --- a/cl_dll/cl_util.h +++ b/cl_dll/cl_util.h @@ -83,6 +83,7 @@ inline struct cvar_s *CVAR_CREATE( const char *cv, const char *val, const int fl #define GetScreenInfo (*gEngfuncs.pfnGetScreenInfo) #define ServerCmd (*gEngfuncs.pfnServerCmd) #define ClientCmd (*gEngfuncs.pfnClientCmd) +#define FilteredClientCmd (*gEngfuncs.pfnFilteredClientCmd) #define AngleVectors (*gEngfuncs.pfnAngleVectors) #define Com_RandomLong (*gEngfuncs.pfnRandomLong) #define Com_RandomFloat (*gEngfuncs.pfnRandomFloat) diff --git a/cl_dll/hud_spectator.cpp b/cl_dll/hud_spectator.cpp index 4b25504e..e59aea1a 100644 --- a/cl_dll/hud_spectator.cpp +++ b/cl_dll/hud_spectator.cpp @@ -690,7 +690,7 @@ void CHudSpectator::DirectorMessage( int iSize, void *pbuf ) break;*/ case DRC_CMD_STUFFTEXT: - ClientCmd( reader.ReadString() ); + FilteredClientCmd( reader.ReadString() ); break; default : gEngfuncs.Con_DPrintf("CHudSpectator::DirectorMessage: unknown command %i.\n", cmd ); } diff --git a/engine/APIProxy.h b/engine/APIProxy.h index f3886fee..b7f9ecad 100644 --- a/engine/APIProxy.h +++ b/engine/APIProxy.h @@ -353,6 +353,7 @@ typedef void (*pfnEngSrc_pfnFillRGBABlend_t ) ( int x, int y, int width, typedef int (*pfnEngSrc_pfnGetAppID_t) ( void ); typedef cmdalias_t* (*pfnEngSrc_pfnGetAliases_t) ( void ); typedef void (*pfnEngSrc_pfnVguiWrap2_GetMouseDelta_t) ( int *x, int *y ); +typedef int (*pfnEngSrc_pfnFilteredClientCmd_t) ( char *szCmdString ); // Pointers to the exported engine functions themselves typedef struct cl_enginefuncs_s @@ -491,6 +492,7 @@ typedef struct cl_enginefuncs_s pfnEngSrc_pfnGetAppID_t pfnGetAppID; pfnEngSrc_pfnGetAliases_t pfnGetAliasList; pfnEngSrc_pfnVguiWrap2_GetMouseDelta_t pfnVguiWrap2_GetMouseDelta; + pfnEngSrc_pfnFilteredClientCmd_t pfnFilteredClientCmd; } cl_enginefunc_t; // Function type declarations for engine destination functions @@ -610,6 +612,7 @@ typedef void (*pfnEngDst_pfnFillRGBABlend_t ) ( int *, int *, int *, int *, i typedef void (*pfnEngDst_pfnGetAppID_t ) ( void ); typedef void (*pfnEngDst_pfnGetAliases_t ) ( void ); typedef void (*pfnEngDst_pfnVguiWrap2_GetMouseDelta_t) ( int *x, int *y ); +typedef void (*pfnEngDst_pfnFilteredClientCmd_t ) ( char ** ); // Pointers to the engine destination functions @@ -737,6 +740,7 @@ typedef struct pfnEngDst_pfnGetAppID_t pfnGetAppID; pfnEngDst_pfnGetAliases_t pfnGetAliasList; pfnEngDst_pfnVguiWrap2_GetMouseDelta_t pfnVguiWrap2_GetMouseDelta; + pfnEngDst_pfnFilteredClientCmd_t pfnFilteredClientCmd; } cl_enginefunc_dst_t; diff --git a/engine/cdll_int.h b/engine/cdll_int.h index 555800fe..e37b19cd 100644 --- a/engine/cdll_int.h +++ b/engine/cdll_int.h @@ -193,6 +193,7 @@ extern module_t g_module; #define RecEnghudHookUserMsg(a, b) (g_engdstAddrs.pfnHookUserMsg(&a, &b)) #define RecEnghudServerCmd(a) (g_engdstAddrs.pfnServerCmd(&a)) #define RecEnghudClientCmd(a) (g_engdstAddrs.pfnClientCmd(&a)) +#define RecEnghudFilteredClientCmd(a) (g_engdstAddrs.pfnFilteredClientCmd(&a)) #define RecEngPrimeMusicStream(a, b) (g_engdstAddrs.pfnPrimeMusicStream(&a, &b)) #define RecEnghudGetPlayerInfo(a, b) (g_engdstAddrs.pfnGetPlayerInfo(&a, &b)) #define RecEnghudPlaySoundByName(a, b) (g_engdstAddrs.pfnPlaySoundByName(&a, &b)) @@ -410,6 +411,7 @@ extern void NullDst(void); (pfnEngDst_pfnGetAppID_t) NullDst, \ (pfnEngDst_pfnGetAliases_t) NullDst, \ (pfnEngDst_pfnVguiWrap2_GetMouseDelta_t) NullDst, \ + (pfnEngDst_pfnFilteredClientCmd_t) NullDst, \ }; // Use this to init a cldll_func_dst structure to point to NullDst