diff --git a/rehlds/engine/sys_dll.cpp b/rehlds/engine/sys_dll.cpp index fb2a5fb..293119d 100644 --- a/rehlds/engine/sys_dll.cpp +++ b/rehlds/engine/sys_dll.cpp @@ -1318,7 +1318,7 @@ void Con_DebugLog(const char *file, const char *fmt, ...) #endif // _WIN32 } -void EXT_FUNC Con_Printf(const char *fmt, ...) +void Con_Printf(const char *fmt, ...) { char Dest[4096]; va_list va; @@ -1326,7 +1326,12 @@ void EXT_FUNC Con_Printf(const char *fmt, ...) va_start(va, fmt); Q_vsnprintf(Dest, sizeof(Dest), fmt, va); va_end(va); + + g_RehldsHookchains.m_Con_Printf.callChain(Con_Printf_internal, Dest); +} +void EXT_FUNC Con_Printf_internal(const char *Dest) +{ #ifdef REHLDS_FLIGHT_REC FR_Log("REHLDS_CON", Dest); #endif diff --git a/rehlds/engine/sys_dll.h b/rehlds/engine/sys_dll.h index 228b09a..adab155 100644 --- a/rehlds/engine/sys_dll.h +++ b/rehlds/engine/sys_dll.h @@ -135,5 +135,6 @@ void Con_Debug_f(void); void Con_Init(void); void Con_DebugLog(const char *file, const char *fmt, ...); void Con_Printf(const char *fmt, ...); +void Con_Printf_internal(const char *Dest); void Con_SafePrintf(const char *fmt, ...); void Con_DPrintf(const char *fmt, ...); diff --git a/rehlds/public/rehlds/rehlds_api.h b/rehlds/public/rehlds/rehlds_api.h index 23413af..876752a 100644 --- a/rehlds/public/rehlds/rehlds_api.h +++ b/rehlds/public/rehlds/rehlds_api.h @@ -223,6 +223,10 @@ typedef IHookChainRegistry IRehldsHookRegistry_ED_Alloc; typedef IVoidHookChain IRehldsHook_ED_Free; typedef IVoidHookChainRegistry IRehldsHookRegistry_ED_Free; +//Con_Printf hook +typedef IHookChain IRehldsHook_Con_Printf; +typedef IHookChainRegistry IRehldsHookRegistry_Con_Printf; + class IRehldsHookchains { public: @@ -274,6 +278,7 @@ public: virtual IRehldsHookRegistry_SV_EmitPings* SV_EmitPings() = 0; virtual IRehldsHookRegistry_ED_Alloc* ED_Alloc() = 0; virtual IRehldsHookRegistry_ED_Free* ED_Free() = 0; + virtual IRehldsHookRegistry_Con_Printf* Con_Printf() = 0; }; struct RehldsFuncs_t { diff --git a/rehlds/rehlds/rehlds_api_impl.cpp b/rehlds/rehlds/rehlds_api_impl.cpp index 60aa4a7..1124e05 100644 --- a/rehlds/rehlds/rehlds_api_impl.cpp +++ b/rehlds/rehlds/rehlds_api_impl.cpp @@ -847,6 +847,10 @@ IRehldsHookRegistry_ED_Free* CRehldsHookchains::ED_Free() { return &m_ED_Free; } +IRehldsHookRegistry_Con_Printf* CRehldsHookchains::Con_Printf() { + return &m_Con_Printf; +} + int EXT_FUNC CRehldsApi::GetMajorVersion() { return REHLDS_API_VERSION_MAJOR; diff --git a/rehlds/rehlds/rehlds_api_impl.h b/rehlds/rehlds/rehlds_api_impl.h index 1fa3472..19929c9 100644 --- a/rehlds/rehlds/rehlds_api_impl.h +++ b/rehlds/rehlds/rehlds_api_impl.h @@ -218,6 +218,10 @@ typedef IHookChainRegistryImpl CRehldsHookRegistry_ED_Alloc; typedef IVoidHookChainImpl CRehldsHook_ED_Free; typedef IVoidHookChainRegistryImpl CRehldsHookRegistry_ED_Free; +//Con_Printf hook +typedef IHookChainImpl CRehldsHook_Con_Printf; +typedef IHookChainRegistryImpl CRehldsHookRegistry_Con_Printf; + class CRehldsHookchains : public IRehldsHookchains { public: CRehldsHookRegistry_Steam_NotifyClientConnect m_Steam_NotifyClientConnect; @@ -266,6 +270,7 @@ public: CRehldsHookRegistry_SV_EmitPings m_SV_EmitPings; CRehldsHookRegistry_ED_Alloc m_ED_Alloc; CRehldsHookRegistry_ED_Free m_ED_Free; + CRehldsHookRegistry_Con_Printf m_Con_Printf; public: EXT_FUNC virtual IRehldsHookRegistry_Steam_NotifyClientConnect* Steam_NotifyClientConnect(); @@ -314,6 +319,7 @@ public: EXT_FUNC virtual IRehldsHookRegistry_SV_EmitPings* SV_EmitPings(); EXT_FUNC virtual IRehldsHookRegistry_ED_Alloc* ED_Alloc(); EXT_FUNC virtual IRehldsHookRegistry_ED_Free* ED_Free(); + EXT_FUNC virtual IRehldsHookRegistry_Con_Printf* Con_Printf(); }; extern CRehldsHookchains g_RehldsHookchains; diff --git a/rehlds/version/version.h b/rehlds/version/version.h index 0a1f095..0b177c4 100644 --- a/rehlds/version/version.h +++ b/rehlds/version/version.h @@ -6,5 +6,5 @@ #pragma once #define VERSION_MAJOR 3 -#define VERSION_MINOR 10 +#define VERSION_MINOR 11 #define VERSION_MAINTENANCE 0