CResponseSystem::ParseRule_Response
0x005b6720 · 701 bytes · __thiscall
_ZN15CResponseSystem18ParseRule_ResponseER4Rule
Decompiled
undefined (2 params)
/* CResponseSystem::ParseRule_Response(Rule&) */
void __thiscall CResponseSystem::ParseRule_Response(CResponseSystem *this,Rule *param_1)
{
CResponseSystem *pCVar1;
CResponseSystem CVar2;
int iVar3;
char cVar4;
undefined4 uVar5;
CResponseSystem *pCVar6;
int iVar7;
int iVar8;
ushort uVar9;
int local_34;
void *local_30;
undefined4 local_2c;
int local_28;
undefined4 local_24;
undefined1 local_20;
undefined1 local_1f;
undefined1 local_1e;
byte local_1d;
pCVar1 = this + 0x38c8;
do {
cVar4 = TokenWaiting(this);
joined_r0x005b673f:
if (cVar4 == '\0') {
return;
}
if (this[0x3d7c] == (CResponseSystem)0x0) {
if (0 < *(int *)(this + 0x3d8c)) {
iVar8 = *(int *)(this + 0x3d80);
uVar5 = RR_Parse(*(char **)(iVar8 + 8),(char *)pCVar1);
*(undefined4 *)(iVar8 + 8) = uVar5;
*(int *)(*(int *)(this + 0x3d80) + 0xc) = *(int *)(*(int *)(this + 0x3d80) + 0xc) + 1;
}
CVar2 = this[0x38c8];
if (CVar2 != (CResponseSystem)0x0) goto LAB_005b6790;
LAB_005b69b6:
local_34 = -0x55555556;
}
else {
CVar2 = this[0x38c8];
this[0x3d7c] = (CResponseSystem)0x0;
if (CVar2 == (CResponseSystem)0x0) goto LAB_005b69b6;
LAB_005b6790:
local_34 = -0x55555556;
pCVar6 = pCVar1;
do {
pCVar6 = pCVar6 + 1;
local_34 = (uint)(byte)CVar2 + local_34 * 0x21;
CVar2 = *pCVar6;
} while (CVar2 != (CResponseSystem)0x0);
}
local_30 = (void *)0x0;
uVar9 = *(ushort *)(this + 0x1c);
local_2c = 0;
local_28 = 0;
local_24 = 0;
local_20 = 1;
local_1d = local_1d & 0xe0 | 1;
local_1f = 0;
local_1e = 1;
if (uVar9 != 0xffff) {
iVar8 = *(int *)(this + 0x10);
do {
while( true ) {
iVar7 = (uint)uVar9 * 0x20;
/* try { // try from 005b682e to 005b6849 has its CatchHandler @ 005b69f7 */
cVar4 = (**(code **)(this + 0xc))(&local_34,iVar8 + 8 + iVar7);
if (cVar4 != '\0') break;
cVar4 = (**(code **)(this + 0xc))(*(int *)(this + 0x10) + iVar7 + 8,&local_34);
if (cVar4 == '\0') goto LAB_005b6869;
if ((CUtlRBTree<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel == '\0') &&
(iVar8 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel), iVar8 != 0)) {
CUtlRBTree<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel = 0xffff;
DAT_00f21cda = 0xffff;
DAT_00f21cdc = 0xffff;
__cxa_guard_release(&CUtlRBTree<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel);
}
iVar8 = *(int *)(this + 0x10);
uVar9 = *(ushort *)(iVar8 + 2 + iVar7);
if (uVar9 == 0xffff) goto LAB_005b6869;
}
if ((CUtlRBTree<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel == '\0') &&
(iVar8 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel), iVar8 != 0)) {
DAT_00f21cda = 0xffff;
CUtlRBTree<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel = 0xffff;
DAT_00f21cdc = 0xffff;
__cxa_guard_release(&CUtlRBTree<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,ResponseGroup,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel);
}
iVar8 = *(int *)(this + 0x10);
uVar9 = *(ushort *)(iVar8 + iVar7);
} while (uVar9 != 0xffff);
LAB_005b6869:
iVar8 = local_28 + -1;
if (-1 < iVar8) {
iVar7 = iVar8 * 0x50;
do {
iVar3 = iVar7 + 0x19;
iVar8 = iVar8 + -1;
iVar7 = iVar7 + -0x50;
AI_ResponseParams::ScriptFollowup_t::~ScriptFollowup_t
((ScriptFollowup_t *)((int)local_30 + iVar3));
} while (iVar8 != -1);
}
local_28 = 0;
free(local_30);
if (uVar9 == 0xffff) goto LAB_005b69d0;
local_34 = CONCAT22(local_34._2_2_,uVar9);
CUtlVector<unsigned_short,CUtlMemoryConservative<unsigned_short>>::InsertBefore
((CUtlVector<unsigned_short,CUtlMemoryConservative<unsigned_short>> *)
(param_1 + 0x10),*(int *)(param_1 + 0x18),(ushort *)&local_34);
cVar4 = TokenWaiting(this);
goto joined_r0x005b673f;
}
local_28 = 0;
LAB_005b69d0:
this[8] = (CResponseSystem)0x0;
ResponseWarning(this,"No such response \'%s\' for rule \'%s\'\n",pCVar1,
*(undefined4 *)(this + 4));
} while( true );
}
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.