COM_ExplainDisconnection
0x00125f10 · 262 bytes · __cdecl
_Z24COM_ExplainDisconnectionbPcz
Decompiled
undefined (2 params)
/* COM_ExplainDisconnection(bool, char*, ...) */
void COM_ExplainDisconnection(bool param_1,char *param_2,...)
{
code *pcVar1;
char *pcVar2;
int *piVar3;
KeyValues *this;
int in_GS_OFFSET;
char *pcVar4;
char local_420 [1024];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
V_vsnprintf(local_420,0x400,param_2,&stack0x0000000c);
V_strncpy(gszDisconnectReason,local_420,0x100);
gfExtendedError = 1;
if (param_1) {
ConMsg("%s\n",gszDisconnectReason);
}
pcVar4 = "Disconnect: ";
pcVar2 = (char *)StringAfterPrefix(local_420,"Disconnect: ");
if (pcVar2 == (char *)0x0) {
pcVar2 = local_420;
}
piVar3 = (int *)(**(code **)(*g_pMatchFramework + 0x1c))(g_pMatchFramework);
pcVar1 = *(code **)(*piVar3 + 8);
this = KeyValues::operator_new((KeyValues *)0x2c,(uint)pcVar4);
/* try { // try from 00125fd3 to 00125fd7 has its CatchHandler @ 0012601e */
KeyValues::KeyValues(this,"OnEngineDisconnectReason","reason",pcVar2);
(*pcVar1)(piVar3,this);
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.