CSoundscapeSystem::Init
0x008307d0 · 507 bytes · __thiscall
_ZN17CSoundscapeSystem4InitEv
Decompiled
undefined (1 param)
/* CSoundscapeSystem::Init() */
undefined4 __thiscall CSoundscapeSystem::Init(CSoundscapeSystem *this)
{
code *pcVar1;
char cVar2;
KeyValues *pKVar3;
char *pcVar4;
int iVar5;
undefined4 uVar6;
char *pcVar7;
char *in_stack_ffffffc8;
iVar5 = gpGlobals;
*(undefined4 *)(this + 0x10) = 0;
pcVar4 = "";
if (*(char **)(iVar5 + 0x3c) != (char *)0x0) {
pcVar4 = *(char **)(iVar5 + 0x3c);
}
pcVar7 = (char *)0x0;
if (*pcVar4 != '\0') {
pcVar7 = (char *)UTIL_VarArgs("scripts/soundscapes_%s.txt");
in_stack_ffffffc8 = pcVar4;
}
pKVar3 = KeyValues::operator_new((KeyValues *)0x2c,(uint)in_stack_ffffffc8);
/* try { // try from 0083082c to 00830830 has its CatchHandler @ 008309e7 */
KeyValues::KeyValues(pKVar3,"scripts/soundscapes_manifest.txt",(IKeyValuesSystem *)0x0,false);
cVar2 = (**(code **)(*filesystem + 0x130))
(filesystem,pKVar3,2,"scripts/soundscapes_manifest.txt","GAME");
if (cVar2 == '\0') {
Error("Unable to load manifest file \'%s\'\n","scripts/soundscapes_manifest.txt");
}
else {
for (pKVar3 = (KeyValues *)KeyValues::GetFirstSubKey(pKVar3); pKVar3 != (KeyValues *)0x0;
pKVar3 = (KeyValues *)KeyValues::GetNextKey(pKVar3)) {
while( true ) {
pcVar4 = (char *)KeyValues::GetName(pKVar3);
iVar5 = _V_stricmp(pcVar4,"file");
if (iVar5 != 0) break;
pcVar1 = *(code **)(*(int *)this + 0x44);
uVar6 = KeyValues::GetString(pKVar3,(char *)0x0,"");
(*pcVar1)(this,uVar6);
if ((pcVar7 != (char *)0x0) &&
((pcVar4 = (char *)KeyValues::GetString(pKVar3,(char *)0x0,""), pcVar7 == pcVar4 ||
(iVar5 = _V_stricmp(pcVar4,pcVar7), iVar5 == 0)))) {
pcVar7 = (char *)0x0;
}
pKVar3 = (KeyValues *)KeyValues::GetNextKey(pKVar3);
if (pKVar3 == (KeyValues *)0x0) goto LAB_00830910;
}
uVar6 = KeyValues::GetName(pKVar3);
Warning("CSoundscapeSystem::Init: Manifest \'%s\' with bogus file type \'%s\', expecting \'file\'\n"
,"scripts/soundscapes_manifest.txt",uVar6);
}
LAB_00830910:
if ((pcVar7 != (char *)0x0) &&
(cVar2 = (**(code **)(filesystem[1] + 0x28))(filesystem + 1,pcVar7,0), cVar2 != '\0')) {
(**(code **)(*(int *)this + 0x44))(this,pcVar7);
}
}
KeyValues::deleteThis();
*(undefined4 *)(this + 0x50) = 0;
return 1;
}
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.