CNetChan::Clear
0x001afc20 · 265 bytes · __thiscall
_ZN8CNetChan5ClearEv
Decompiled
undefined (1 param)
/* CNetChan::Clear() */
void __thiscall CNetChan::Clear(CNetChan *this)
{
uint uVar1;
uint uVar2;
int iVar3;
CNetChan *pCVar4;
CNetChan *local_20;
iVar3 = 0;
pCVar4 = this + 200;
local_20 = this;
do {
while (*(int *)pCVar4 != 0) {
RemoveHeadInWaitingList(this,iVar3);
}
if (*(void **)(local_20 + 0x1ec) != (void *)0x0) {
operator_delete__(*(void **)(local_20 + 0x1ec));
*(undefined4 *)(local_20 + 0x1ec) = 0;
}
local_20 = local_20 + 0x130;
iVar3 = iVar3 + 1;
pCVar4 = pCVar4 + 0x14;
} while (iVar3 != 2);
iVar3 = 0;
pCVar4 = this;
do {
while (*(int *)(pCVar4 + 0x358) == 1) {
uVar1 = *(uint *)(this + 0x14);
uVar2 = 1 << ((byte)iVar3 & 0x1f);
if ((uVar2 & uVar1) == 0) {
*(uint *)(this + 0x14) = uVar2 | uVar1;
}
else {
*(uint *)(this + 0x14) = ~uVar2 & uVar1;
}
*(undefined4 *)(pCVar4 + 0x358) = 0;
iVar3 = iVar3 + 1;
*(undefined4 *)(pCVar4 + 0x354) = 0xffffffff;
*(undefined4 *)(pCVar4 + 0x34c) = 0;
*(undefined4 *)(pCVar4 + 0x344) = 0xffffffff;
*(undefined4 *)(pCVar4 + 0x350) = 0;
*(undefined4 *)(pCVar4 + 0x348) = 0xffffffff;
pCVar4 = pCVar4 + 0x1c;
if (iVar3 == 8) goto LAB_001afd06;
}
if (*(int *)(pCVar4 + 0x358) == 2) {
*(undefined4 *)(pCVar4 + 0x358) = 3;
}
iVar3 = iVar3 + 1;
pCVar4 = pCVar4 + 0x1c;
} while (iVar3 != 8);
LAB_001afd06:
this[6] = (CNetChan)0x1;
/* WARNING: Could not recover jumptable at 0x001afd1c. Too many branches */
/* WARNING: Treating indirect jump as call */
(**(code **)(*(int *)this + 0x90))();
return;
}
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.