CSoundscapeSystem::AddSoundscapeFile
0x00830d50 · 313 bytes · __thiscall
_ZN17CSoundscapeSystem17AddSoundscapeFileEPKc
Decompiled
undefined (2 params)
/* CSoundscapeSystem::AddSoundscapeFile(char const*) */
void __thiscall CSoundscapeSystem::AddSoundscapeFile(CSoundscapeSystem *this,char *param_1)
{
char cVar1;
KeyValues *this_00;
int iVar2;
char *pcVar3;
uint in_stack_ffffffc8;
this_00 = KeyValues::operator_new((KeyValues *)0x2c,in_stack_ffffffc8);
/* try { // try from 00830d8c to 00830d90 has its CatchHandler @ 00830e9c */
KeyValues::KeyValues(this_00,param_1,(IKeyValuesSystem *)0x0,false);
cVar1 = (**(code **)(*filesystem + 0x130))(filesystem,this_00,2,param_1,"GAME");
if ((cVar1 != '\0') && (this_00 != (KeyValues *)0x0)) {
do {
iVar2 = KeyValues::GetFirstSubKey(this_00);
if (iVar2 != 0) {
if (*(int *)(*(int *)(g_pDeveloper + 0x1c) + 0x30) != 0) {
pcVar3 = (char *)KeyValues::GetName(this_00);
pcVar3 = strchr(pcVar3,0x7b);
if (pcVar3 != (char *)0x0) {
if (*(int *)(this + 0x10) < 1) {
pcVar3 = "FIRST";
}
else {
pcVar3 = (char *)CStringRegistry::GetStringText
((CStringRegistry *)(this + 0xc),*(int *)(this + 0x10) + -1
);
}
Msg("Error parsing soundscape file %s after %s\n",param_1,pcVar3);
}
}
iVar2 = *(int *)(this + 0x10);
pcVar3 = (char *)KeyValues::GetName(this_00);
CStringRegistry::AddString((CStringRegistry *)(this + 0xc),pcVar3,iVar2);
*(int *)(this + 0x10) = *(int *)(this + 0x10) + 1;
}
this_00 = (KeyValues *)KeyValues::GetNextKey(this_00);
} while (this_00 != (KeyValues *)0x0);
}
KeyValues::deleteThis();
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.