Music::PrecacheMusic
0x008ec320 · 195 bytes · __cdecl
_ZN5Music13PrecacheMusicEv
Decompiled
undefined (0 params)
/* Music::PrecacheMusic() */
void Music::PrecacheMusic(void)
{
char cVar1;
KeyValues *this;
IBaseFileSystem *pIVar2;
int iVar3;
char *pcVar4;
uint in_stack_ffffffe8;
COM_TimestampedLog("Music::Precache - Start");
this = KeyValues::operator_new((KeyValues *)0x2c,in_stack_ffffffe8);
/* try { // try from 008ec35d to 008ec361 has its CatchHandler @ 008ec3eb */
KeyValues::KeyValues(this,"game_sounds_music.txt",(IKeyValuesSystem *)0x0,false);
pIVar2 = (IBaseFileSystem *)0x0;
if (filesystem != 0) {
pIVar2 = (IBaseFileSystem *)(filesystem + 4);
}
cVar1 = KeyValues::LoadFromFile(this,pIVar2,"scripts/game_sounds_music.txt",(char *)0x0);
if (cVar1 != '\0') {
for (; this != (KeyValues *)0x0; this = (KeyValues *)KeyValues::GetNextKey(this)) {
do {
iVar3 = KeyValues::GetFirstSubKey(this);
} while (iVar3 == 0);
pcVar4 = (char *)KeyValues::GetName(this);
PrecacheMusicEvent(pcVar4);
}
}
KeyValues::deleteThis();
COM_TimestampedLog("Music::Precache - Finish");
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.