CResponseSystem::LoadFromBuffer
0x005b5720 · 555 bytes · __thiscall
_ZN15CResponseSystem14LoadFromBufferEPKcS1_
Decompiled
undefined (3 params)
/* CResponseSystem::LoadFromBuffer(char const*, char const*) */
void __thiscall CResponseSystem::LoadFromBuffer(CResponseSystem *this,char *param_1,char *param_2)
{
CResponseSystem CVar1;
int iVar2;
char cVar3;
undefined4 uVar4;
int iVar5;
CResponseSystem *pCVar6;
int iVar7;
int in_GS_OFFSET;
char *this_00;
CResponseSystem *pCVar8;
undefined1 local_120 [256];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
COM_TimestampedLog("CResponseSystem::LoadFromBuffer [%s] - Start",param_1);
CStringPool::Allocate((CStringPool *)(this + 0x3d94),param_1);
this_00 = (char *)this;
pCVar6 = (CResponseSystem *)param_1;
PushScript(this,param_1,(uchar *)param_2);
if (*(int *)(rr_dumpresponses._28_4_ + 0x30) != 0) {
this_00 = "Reading: %s\n";
pCVar6 = (CResponseSystem *)param_1;
DevMsg("Reading: %s\n");
}
pCVar8 = this + 0x38c8;
do {
if (this[0x3d7c] == (CResponseSystem)0x0) {
if (0 < *(int *)(this + 0x3d8c)) {
iVar5 = *(int *)(this + 0x3d80);
this_00 = *(char **)(iVar5 + 8);
pCVar6 = pCVar8;
uVar4 = RR_Parse(this_00,(char *)pCVar8);
*(undefined4 *)(iVar5 + 8) = uVar4;
*(int *)(*(int *)(this + 0x3d80) + 0xc) = *(int *)(*(int *)(this + 0x3d80) + 0xc) + 1;
}
}
else {
this[0x3d7c] = (CResponseSystem)0x0;
}
CVar1 = this[0x38c8];
if (CVar1 == (CResponseSystem)0x0) goto LAB_005b584e;
param_2 = (char *)0xaaaaaaaa;
pCVar6 = pCVar8;
do {
pCVar6 = pCVar6 + 1;
param_2 = (char *)((uint)(byte)CVar1 + (int)param_2 * 0x21);
CVar1 = *pCVar6;
} while (CVar1 != (CResponseSystem)0x0);
this_00 = (char *)this;
pCVar6 = pCVar8;
cVar3 = Dispatch(this,(char *)pCVar8,(uint)param_2,(CUtlMap *)(this + 0x3db0));
} while (cVar3 != '\0');
this_00 =
"CResponseSystem::LoadFromBuffer: Unknown entry type \'%s\', expecting \'response\', \'criterion\', \'enumeration\' or \'rules\' in file %s(offset:%i)\n"
;
param_2 = param_1;
Error();
pCVar6 = pCVar8;
LAB_005b584e:
if (*(int *)(this + 0x3d8c) == 1) {
local_120[0] = 0;
GetCurrentScript((CResponseSystem *)this_00,(char *)pCVar6,(uint)param_2);
iVar7 = 0;
iVar5 = 0;
do {
iVar2 = iVar5 + 0x8e;
iVar5 = iVar5 + 0x38;
iVar7 = iVar7 + (uint)*(ushort *)(this + iVar2);
} while (iVar5 != 0x3800);
DevMsg(1,"CResponseSystem: %s (%i rules, %i criteria, and %i responses)\n",local_120,iVar7,
*(undefined2 *)(this + 0x56),*(undefined2 *)(this + 0x1e));
if (*(int *)(rr_dumpresponses._28_4_ + 0x30) != 0) {
(**(code **)(*(int *)this + 0x18))(this);
}
}
PopScript(this);
COM_TimestampedLog("CResponseSystem::LoadFromBuffer [%s] - Finish",param_1);
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.