CMapReslistGenerator::OnLevelLoadStart
0x0018d440 · 460 bytes · __thiscall
_ZN20CMapReslistGenerator16OnLevelLoadStartEPKc
Decompiled
undefined (2 params)
/* CMapReslistGenerator::OnLevelLoadStart(char const*) */
void __thiscall CMapReslistGenerator::OnLevelLoadStart(CMapReslistGenerator *this,char *param_1)
{
char cVar1;
KeyValues *this_00;
IBaseFileSystem *pIVar2;
int iVar3;
int in_GS_OFFSET;
char *pcVar4;
char local_124 [260];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
this[5] = (CMapReslistGenerator)0x0;
V_strncpy((char *)(this + 0xa8),param_1,0x40);
if (this[1] == (CMapReslistGenerator)0x0) {
this_00 = (KeyValues *)(this + 0x68);
V_FileBase(param_1,local_124,0x104);
_V_strlower(local_124);
V_snprintf((char *)this_00,0x40,"%s: ",local_124);
}
else {
CUtlSymbolTable::RemoveAll((CUtlSymbolTable *)(this + 0x28));
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 + 0x174));
V_snprintf(local_124,0x104,"maps\\%s.bsp",param_1);
pcVar4 = local_124;
OnResourcePrecached(this,pcVar4);
this_00 = KeyValues::operator_new((KeyValues *)0x2c,(uint)pcVar4);
/* try { // try from 0018d4fb to 0018d4ff has its CatchHandler @ 0018d616 */
KeyValues::KeyValues(this_00,"ModInfo",(IKeyValuesSystem *)0x0,false);
pIVar2 = (IBaseFileSystem *)0x0;
if (g_pFileSystem != 0) {
pIVar2 = (IBaseFileSystem *)(g_pFileSystem + 4);
}
cVar1 = KeyValues::LoadFromFile(this_00,pIVar2,"gameinfo.txt",(char *)0x0);
if (cVar1 == '\0') {
KeyValues::deleteThis();
}
else {
iVar3 = KeyValues::GetInt(this_00,"nodegraph",1);
KeyValues::deleteThis();
if (iVar3 == 0) goto LAB_0018d570;
}
V_snprintf(local_124,0x104,"maps\\graphs\\%s.ain",param_1);
OnResourcePrecached(this,local_124);
this_00 = (KeyValues *)this;
}
LAB_0018d570:
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail(this_00);
}
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.