CMaster::ShutdownConnection
0x002018c0 · 385 bytes · __thiscall
_ZN7CMaster18ShutdownConnectionEP11CBaseServer
Decompiled
undefined (2 params)
/* CMaster::ShutdownConnection(CBaseServer*) */
void __thiscall CMaster::ShutdownConnection(CMaster *this,CBaseServer *param_1)
{
int *piVar1;
void *pvVar2;
void *pvVar3;
char cVar4;
int iVar5;
int iVar6;
int iVar7;
void *pvVar8;
int iVar9;
int in_GS_OFFSET;
int local_38;
int local_34;
uchar local_24 [4];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if ((((host_initialized != '\0') && (this[0x18] == (CMaster)0x0)) &&
(cVar4 = (**(code **)(*(int *)param_1 + 0x68))(param_1), cVar4 != '\0')) &&
(cVar4 = CBaseServer::ShouldHideFromMasterServer(param_1), cVar4 == '\0')) {
(**(code **)(*(int *)this + 8))(this);
V_snprintf((char *)local_24,4,"%c\n",0x62);
if (0 < *(int *)(this + 0x10)) {
local_34 = 0;
local_38 = 0;
do {
iVar5 = _V_strlen((char *)local_24);
NET_SendPacket((INetChannel *)0x0,*(int *)(param_1 + 8),
(netadr_s *)(*(int *)(this + 4) + local_34),local_24,iVar5 + 1,
(bf_write *)0x0,false,0);
iVar9 = local_34 + *(int *)(this + 4);
iVar5 = *(int *)(iVar9 + 0x1c);
if (0 < iVar5) {
pvVar2 = *(void **)(iVar9 + 0x10);
if (param_1 == *(CBaseServer **)((int)pvVar2 + 0xc)) {
iVar7 = 0;
pvVar8 = pvVar2;
}
else {
iVar7 = 0;
pvVar3 = pvVar2;
do {
iVar7 = iVar7 + 1;
if (iVar7 == iVar5) goto LAB_002019e9;
piVar1 = (int *)((int)pvVar3 + 0x1c);
pvVar8 = (void *)((int)pvVar3 + 0x10);
pvVar3 = (void *)((int)pvVar3 + 0x10);
} while (param_1 != (CBaseServer *)*piVar1);
}
iVar6 = (iVar5 - iVar7) + -1;
if (0 < iVar6) {
_V_memmove(pvVar8,(void *)((iVar7 + 1) * 0x10 + (int)pvVar2),iVar6 * 0x10);
iVar5 = *(int *)(iVar9 + 0x1c);
}
*(int *)(iVar9 + 0x1c) = iVar5 + -1;
}
LAB_002019e9:
local_38 = local_38 + 1;
local_34 = local_34 + 0x24;
} while (local_38 < *(int *)(this + 0x10));
}
}
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.