CMapReslistGenerator::EnableReslistGeneration
0x0018cd30 · 479 bytes · __thiscall
_ZN20CMapReslistGenerator23EnableReslistGenerationEb
Decompiled
undefined (2 params)
/* CMapReslistGenerator::EnableReslistGeneration(bool) */
void __thiscall
CMapReslistGenerator::EnableReslistGeneration(CMapReslistGenerator *this,bool param_1)
{
code *pcVar1;
int iVar2;
int *piVar3;
undefined4 uVar4;
int in_GS_OFFSET;
char *local_130;
CFmtStrN<256> local_12c [5];
undefined1 local_127 [263];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
iVar2 = _V_stricmp("cstrike",DAT_003a1540);
if (iVar2 == 0) {
*(undefined4 *)(this + 0x60) = 6;
*(undefined4 *)(this + 100) = 900;
}
this[1] = (CMapReslistGenerator)0x1;
this[2] = (CMapReslistGenerator)param_1;
local_130 = (char *)0x0;
piVar3 = (int *)CommandLine_Tier0();
iVar2 = (**(code **)(*piVar3 + 0xc))(piVar3,"-reslistdir",&local_130);
if ((iVar2 != 0) && (local_130 != (char *)0x0)) {
V_strncpy((char *)local_12c,local_130,0x104);
V_StripTrailingSlash((char *)local_12c);
_V_strlower((char *)local_12c);
V_FixSlashes((char *)local_12c,'/');
iVar2 = _V_strlen((char *)local_12c);
if (0 < iVar2) {
CUtlString::operator=((CUtlString *)(this + 0x1bc),(char *)local_12c);
}
}
piVar3 = (int *)CommandLine_Tier0();
iVar2 = (**(code **)(*piVar3 + 0x28))(piVar3,"-xboxreslist");
piVar3 = g_pFileSystem;
this[4] = (CMapReslistGenerator)(iVar2 != 0);
pcVar1 = *(code **)(*piVar3 + 0x48);
uVar4 = CUtlString::Get((CUtlString *)(this + 0x1bc));
(*pcVar1)(g_pFileSystem,uVar4,"DEFAULT_WRITE_PATH");
piVar3 = (int *)CommandLine_Tier0();
iVar2 = (**(code **)(*piVar3 + 0x28))(piVar3,"-startmap");
if (iVar2 == 0) {
pcVar1 = *(code **)(*g_pFileSystem + 0x40);
uVar4 = CUtlString::Get((CUtlString *)(this + 0x1bc));
CFmtStrN<256>::CFmtStrN(local_12c,"%s\\%s",uVar4,"engine.lst");
(*pcVar1)(g_pFileSystem,local_127,"DEFAULT_WRITE_PATH");
CUtlRBTree<CUtlString,int,bool(*)(CUtlString_const&,CUtlString_const&),CUtlMemory<UtlRBTreeNode_t<CUtlString,int>,int>>
::RemoveAll((CUtlRBTree<CUtlString,int,bool(*)(CUtlString_const&,CUtlString_const&),CUtlMemory<UtlRBTreeNode_t<CUtlString,int>,int>>
*)(this + 0x198));
}
else {
BuildEngineLogFromReslist(this);
}
(**(code **)(*g_pFileSystem + 0x108))(g_pFileSystem,FileSystemLoggingFunc);
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.