CCSPlayer::ShouldRunRateLimitedCommand
0x0065c8f0 · 486 bytes · __thiscall
_ZN9CCSPlayer27ShouldRunRateLimitedCommandERK8CCommand
Decompiled
undefined (2 params)
/* CCSPlayer::ShouldRunRateLimitedCommand(CCommand const&) */
undefined4 __thiscall CCSPlayer::ShouldRunRateLimitedCommand(CCSPlayer *this,CCommand *param_1)
{
int iVar1;
char cVar2;
undefined4 uVar3;
int iVar4;
int iVar5;
char *local_38;
Node_t *local_34;
char *local_24;
undefined4 local_20;
if (*(int *)param_1 < 1) {
local_38 = "";
}
else {
local_38 = *(char **)(param_1 + 0x408);
if (local_38 == (char *)0x0) goto LAB_0065ca56;
}
iVar5 = *(int *)(this + 0x2a24);
local_24 = local_38;
if (iVar5 != -1) {
iVar4 = *(int *)(this + 0x2a18);
do {
iVar1 = iVar5 * 0x18;
cVar2 = (**(code **)(this + 0x2a14))(&local_24,iVar4 + 0x10 + iVar1);
if (cVar2 == '\0') {
uVar3 = (**(code **)(this + 0x2a14))(*(int *)(this + 0x2a18) + iVar1 + 0x10,&local_24);
if ((char)uVar3 == '\0') {
if (iVar5 != -1) {
if (*(float *)(gpGlobals + 0xc) - *(float *)(iVar1 + *(int *)(this + 0x2a18) + 0x14) <
0.3) {
return uVar3;
}
*(float *)(iVar1 + *(int *)(this + 0x2a18) + 0x14) = *(float *)(gpGlobals + 0xc);
return 1;
}
break;
}
if ((CUtlRBTree<CUtlMap<char_const*,float,int>::Node_t,int,CUtlMap<char_const*,float,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,float,int>::Node_t,int>,int>>
::Links(int)::s_Sentinel == '\0') &&
(iVar5 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<char_const*,float,int>::Node_t,int,CUtlMap<char_const*,float,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,float,int>::Node_t,int>,int>>
::Links(int)::s_Sentinel), iVar5 != 0)) {
CUtlRBTree<CUtlMap<char_const*,float,int>::Node_t,int,CUtlMap<char_const*,float,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,float,int>::Node_t,int>,int>>
::Links(int)::s_Sentinel = 0xffffffff;
DAT_00f2c9b4 = 0xffffffff;
DAT_00f2c9b8 = 0xffffffff;
__cxa_guard_release(&CUtlRBTree<CUtlMap<char_const*,float,int>::Node_t,int,CUtlMap<char_const*,float,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,float,int>::Node_t,int>,int>>
::Links(int)::s_Sentinel);
}
iVar4 = *(int *)(this + 0x2a18);
iVar5 = *(int *)(iVar4 + 4 + iVar1);
}
else {
if ((CUtlRBTree<CUtlMap<char_const*,float,int>::Node_t,int,CUtlMap<char_const*,float,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,float,int>::Node_t,int>,int>>
::Links(int)::s_Sentinel == '\0') &&
(iVar4 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<char_const*,float,int>::Node_t,int,CUtlMap<char_const*,float,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,float,int>::Node_t,int>,int>>
::Links(int)::s_Sentinel), iVar4 != 0)) {
CUtlRBTree<CUtlMap<char_const*,float,int>::Node_t,int,CUtlMap<char_const*,float,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,float,int>::Node_t,int>,int>>
::Links(int)::s_Sentinel = 0xffffffff;
DAT_00f2c9b4 = 0xffffffff;
DAT_00f2c9b8 = 0xffffffff;
__cxa_guard_release(&CUtlRBTree<CUtlMap<char_const*,float,int>::Node_t,int,CUtlMap<char_const*,float,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,float,int>::Node_t,int>,int>>
::Links(int)::s_Sentinel);
}
iVar4 = *(int *)(this + 0x2a18);
iVar5 = *(int *)(iVar4 + iVar5 * 0x18);
}
} while (iVar5 != -1);
}
LAB_0065ca56:
iVar5 = gpGlobals;
local_34 = (Node_t *)&local_24;
local_24 = strdup(local_38);
local_20 = *(undefined4 *)(iVar5 + 0xc);
CUtlRBTree<CUtlMap<char_const*,float,int>::Node_t,int,CUtlMap<char_const*,float,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,float,int>::Node_t,int>,int>>
::Insert((CUtlRBTree<CUtlMap<char_const*,float,int>::Node_t,int,CUtlMap<char_const*,float,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,float,int>::Node_t,int>,int>>
*)(this + 0x2a14),local_34);
return 1;
}
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.