CEngineConsoleLoggingListener::Log
0x002152f0 · 319 bytes · __thiscall
_ZN29CEngineConsoleLoggingListener3LogEPK16LoggingContext_tPKc
Decompiled
undefined (3 params)
/* CEngineConsoleLoggingListener::Log(LoggingContext_t const*, char const*) */
void __thiscall
CEngineConsoleLoggingListener::Log
(CEngineConsoleLoggingListener *this,LoggingContext_t *param_1,char *param_2)
{
int iVar1;
char cVar2;
int *piVar3;
undefined4 *puVar4;
char *pcVar5;
int in_GS_OFFSET;
Color local_24;
undefined1 local_23;
undefined1 local_22;
undefined1 local_21;
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if (((byte)param_1[4] & 2) == 0) {
piVar3 = (int *)___tls_get_addr();
iVar1 = *piVar3;
*piVar3 = 1;
if (iVar1 == 0) {
cVar2 = SV_RedirectActive();
if (cVar2 == '\0') {
if (g_nForkID < 1) {
if (dedicated != (int *)0x0) {
(**(code **)(*dedicated + 0x14))(dedicated,param_2);
}
}
else {
pcVar5 = (char *)va("#%02d:%s",g_nForkID,param_2);
SendStringToParentProcess(pcVar5);
}
if (g_pNetConsoleMgr != (CNetConsoleMgr *)0x0) {
CNetConsoleMgr::SendStringToNetConsoles(g_pNetConsoleMgr,param_2);
}
}
else {
local_24 = (Color)0xff;
local_23 = 0xff;
local_22 = 0xff;
local_21 = 0xff;
Con_ColorPrintf(&local_24,"%s",param_2);
}
}
puVar4 = (undefined4 *)___tls_get_addr();
iVar1 = *(int *)(param_1 + 8);
*puVar4 = 0;
if (iVar1 == 3) {
Sys_Error("%s",param_2);
}
}
else if (*(int *)param_1 == LOG_ServerLog) {
CLog::Print((CLog *)g_Log,param_2);
}
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.