GCSDK::CGCBase::StopGameserver
0x0007b070 · 398 bytes · __thiscall
_ZN5GCSDK7CGCBase14StopGameserverERK8CSteamID
Decompiled
undefined (2 params)
/* GCSDK::CGCBase::StopGameserver(CSteamID const&) */
void __thiscall GCSDK::CGCBase::StopGameserver(CGCBase *this,CSteamID *param_1)
{
int iVar1;
void *pvVar2;
ushort uVar3;
int iVar4;
ushort *puVar5;
uint uVar6;
int iVar7;
undefined4 local_28;
undefined4 local_24;
local_24 = *(undefined4 *)(param_1 + 4);
local_28 = *(undefined4 *)param_1;
uVar3 = CUtlRBTree<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Find((CUtlRBTree<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
*)(this + 0x158),(Node_t *)&local_28);
uVar6 = (uint)uVar3;
if (((int)uVar6 < *(int *)(this + 0x160)) && (uVar3 <= *(ushort *)(this + 0x16e))) {
if (CUtlRBTree<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel == '\0') {
iVar4 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel);
if (iVar4 != 0) {
DAT_000d2872 = 0xffff;
CUtlRBTree<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel = 0xffff;
DAT_000d2874 = 0xffff;
__cxa_guard_release(&CUtlRBTree<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel);
}
}
if (uVar3 == 0xffff) {
puVar5 = &CUtlRBTree<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel;
}
else {
puVar5 = (ushort *)(*(int *)(this + 0x15c) + uVar6 * 0x14);
}
if (uVar3 != *puVar5) {
iVar4 = uVar6 * 0x14;
pvVar2 = *(void **)(*(int *)(this + 0x15c) + 0x10 + iVar4);
(**(code **)(*(int *)this + 0x54))(this,pvVar2);
iVar7 = 0;
if (0 < *(int *)((int)pvVar2 + 0x18)) {
do {
iVar1 = iVar7 * 4;
iVar7 = iVar7 + 1;
*(undefined4 *)(*(int *)(*(int *)((int)pvVar2 + 0xc) + iVar1) + 0xc) = 0;
} while (iVar7 < *(int *)((int)pvVar2 + 0x18));
}
if (uVar3 != 0xffff) {
CUtlRBTree<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Unlink((CUtlRBTree<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
*)(this + 0x158),uVar3);
*(ushort *)(*(int *)(this + 0x15c) + iVar4) = uVar3;
*(undefined2 *)(*(int *)(this + 0x15c) + 2 + iVar4) = *(undefined2 *)(this + 0x16c);
*(short *)(this + 0x16a) = *(short *)(this + 0x16a) + -1;
*(ushort *)(this + 0x16c) = uVar3;
}
*(undefined4 *)((int)pvVar2 + 0x18) = 0;
CUtlMemory<GCSDK::CGCUserSession*,int>::Purge
((CUtlMemory<GCSDK::CGCUserSession*,int> *)((int)pvVar2 + 0xc));
*(undefined4 *)((int)pvVar2 + 0x1c) = *(undefined4 *)((int)pvVar2 + 0xc);
CUtlMemory<GCSDK::CGCUserSession*,int>::Purge
((CUtlMemory<GCSDK::CGCUserSession*,int> *)((int)pvVar2 + 0xc));
operator_delete(pvVar2);
return;
}
}
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.