VScriptServerRunScriptForAllAddons
0x00b4c2b0 · 409 bytes · __cdecl
_Z34VScriptServerRunScriptForAllAddonsPKcP9HSCRIPT__b
Decompiled
undefined (3 params)
/* VScriptServerRunScriptForAllAddons(char const*, HSCRIPT__*, bool) */
void VScriptServerRunScriptForAllAddons(char *param_1,HSCRIPT__ *param_2,bool param_3)
{
undefined4 uVar1;
char *pcVar2;
CUtlMemory<unsigned_char,int> *this;
int iVar3;
int iVar4;
int in_GS_OFFSET;
int local_1034 [5];
char local_1020 [4096];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
V_snprintf(local_1020,0x1000,"scripts/vscripts/%s_addon.nut",param_1);
V_FixSlashes(local_1020,'/');
local_1034[0] = 0;
local_1034[1] = 0;
local_1034[2] = 0;
local_1034[3] = 0;
local_1034[4] = 0;
/* try { // try from 00b4c355 to 00b4c3c0 has its CatchHandler @ 00b4c444 */
(**(code **)(*g_pFullFileSystem + 0x84))(g_pFullFileSystem,local_1034,local_1020,"GAME");
if (0 < local_1034[3]) {
iVar3 = 0;
do {
uVar1 = CUtlString::Get((CUtlString *)(local_1034[0] + iVar3 * 0x10));
Msg(">>> Loading addon script %s\n",uVar1);
pcVar2 = CUtlString::operator_cast_to_char_((CUtlString *)(iVar3 * 0x10 + local_1034[0]));
VScriptServerRunScript(pcVar2,param_2,param_3);
iVar3 = iVar3 + 1;
} while (iVar3 < local_1034[3]);
}
iVar3 = local_1034[3] + -1;
iVar4 = iVar3 * 0x10;
if (-1 < iVar3) {
do {
iVar3 = iVar3 + -1;
this = (CUtlMemory<unsigned_char,int> *)(local_1034[0] + iVar4);
iVar4 = iVar4 + -0x10;
CUtlMemory<unsigned_char,int>::Purge(this);
} while (iVar3 != -1);
}
local_1034[3] = 0;
CUtlMemory<CUtlString,int>::Purge((CUtlMemory<CUtlString,int> *)local_1034);
local_1034[4] = local_1034[0];
CUtlMemory<CUtlString,int>::Purge((CUtlMemory<CUtlString,int> *)local_1034);
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.