script_reload_enity_code
0x00b47c80 · 601 bytes · __cdecl
_ZL24script_reload_enity_codeRK8CCommand
Decompiled
undefined (1 param)
/* script_reload_enity_code(CCommand const&) */
void script_reload_enity_code(CCommand *param_1)
{
int iVar1;
void *pvVar2;
char cVar3;
CBasePlayer *pCVar4;
HSCRIPT__ *pHVar5;
int iVar6;
CBaseEntity *pCVar7;
int in_GS_OFFSET;
char *local_140;
int local_134 [5];
char local_11f [255];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
cVar3 = UTIL_IsCommandIssuedByServerAdmin();
if (cVar3 != '\0') {
local_140 = "";
if (1 < *(int *)param_1) {
local_140 = "";
if (**(char **)(param_1 + 0x40c) != '\0') {
local_140 = *(char **)(param_1 + 0x40c);
}
}
if (g_pScriptVM == 0) {
Msg("Scripting disabled or no server running\n");
}
else {
pCVar4 = (CBasePlayer *)UTIL_GetCommandClient();
if (pCVar4 != (CBasePlayer *)0x0) {
pCVar7 = (CBaseEntity *)0x0;
while (pCVar7 = (CBaseEntity *)GetNextCommandEntity(pCVar4,local_140,pCVar7),
pCVar7 != (CBaseEntity *)0x0) {
if ((*(int *)(pCVar7 + 1000) != -1) && (*(char **)(pCVar7 + 0x3e0) != (char *)0x0)) {
_V_strcpy(local_11f,*(char **)(pCVar7 + 0x3e0));
local_134[0] = 0;
local_134[1] = 0;
local_134[2] = 0;
local_134[3] = 0;
local_134[4] = 0;
/* try { // try from 00b47d90 to 00b47dd0 has its CatchHandler @ 00b47eda */
V_SplitString(local_11f," ",(CUtlVector *)local_134);
if (0 < local_134[3]) {
iVar6 = 0;
do {
pHVar5 = *(HSCRIPT__ **)(pCVar7 + 1000);
if (pHVar5 == (HSCRIPT__ *)&DAT_ffffffff) {
pHVar5 = (HSCRIPT__ *)0x0;
}
VScriptServerReplaceClosures(*(char **)(local_134[0] + iVar6 * 4),pHVar5,true);
iVar6 = iVar6 + 1;
} while (iVar6 < local_134[3]);
iVar6 = 0;
if (0 < local_134[3]) {
do {
pvVar2 = *(void **)(local_134[0] + iVar6 * 4);
if (pvVar2 != (void *)0x0) {
operator_delete__(pvVar2);
}
iVar6 = iVar6 + 1;
} while (iVar6 < local_134[3]);
}
}
iVar6 = 0;
local_134[3] = 0;
CUtlMemory<char*,int>::Purge((CUtlMemory<char*,int> *)local_134);
local_134[4] = local_134[0];
if (0 < local_134[3]) {
do {
iVar1 = iVar6 * 4;
iVar6 = iVar6 + 1;
operator_delete(*(void **)(local_134[0] + iVar1));
} while (iVar6 < local_134[3]);
}
local_134[3] = 0;
CUtlMemory<char*,int>::Purge((CUtlMemory<char*,int> *)local_134);
local_134[3] = 0;
local_134[4] = local_134[0];
CUtlMemory<char*,int>::Purge((CUtlMemory<char*,int> *)local_134);
local_134[4] = local_134[0];
CUtlMemory<char*,int>::Purge((CUtlMemory<char*,int> *)local_134);
}
}
}
}
}
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.