CVoteController::RecordVoteCallerHistory
0x00b3fca0 · 437 bytes · __thiscall
_ZN15CVoteController23RecordVoteCallerHistoryEb
Decompiled
undefined (2 params)
/* CVoteController::RecordVoteCallerHistory(bool) */
void __thiscall CVoteController::RecordVoteCallerHistory(CVoteController *this,bool param_1)
{
int iVar1;
bool bVar2;
int iVar3;
int iVar4;
int iVar5;
int *piVar6;
int *local_24;
bVar2 = param_1;
_param_1 = (uint)param_1;
iVar5 = *(int *)(this + 0x558);
if (iVar5 != 0) {
iVar4 = *(int *)(this + 0x568);
if (iVar4 < 1) {
local_24 = *(int **)(this + 0x55c);
LAB_00b3fd05:
iVar3 = *(int *)(this + 0x560);
iVar5 = iVar4 + 1;
if (iVar3 < iVar5) {
iVar1 = *(int *)(this + 0x564);
if (-1 < iVar1) {
if (iVar1 == 0) {
if ((iVar3 != 0) || (iVar3 = 2, 2 < iVar5)) {
do {
iVar3 = iVar3 * 2;
} while (iVar3 < iVar5);
}
}
else {
for (iVar3 = (iVar4 / iVar1 + 1) * iVar1; iVar3 < iVar5; iVar3 = (iVar3 + iVar5) / 2) {
}
}
*(int *)(this + 0x560) = iVar3;
if (local_24 == (int *)0x0) {
local_24 = malloc(iVar3 * 0x18);
*(int **)(this + 0x55c) = local_24;
}
else {
local_24 = realloc(local_24,iVar3 * 0x18);
*(int **)(this + 0x55c) = local_24;
iVar5 = *(int *)(this + 0x568) + 1;
}
}
}
*(int *)(this + 0x568) = iVar5;
*(int **)(this + 0x56c) = local_24;
iVar5 = (iVar5 - iVar4) + -1;
if (0 < iVar5) {
_V_memmove(local_24 + iVar4 * 6 + 6,local_24 + iVar4 * 6,iVar5 * 0x18);
local_24 = *(int **)(this + 0x55c);
}
piVar6 = local_24 + iVar4 * 6;
iVar3 = 0;
iVar4 = 0;
iVar5 = *(int *)(this + 0x558);
piVar6[2] = 0;
*piVar6 = iVar5;
piVar6[3] = 0;
}
else {
local_24 = *(int **)(this + 0x55c);
piVar6 = local_24;
if (iVar5 != *local_24) {
iVar3 = 0;
do {
piVar6 = piVar6 + 6;
iVar3 = iVar3 + 1;
if (iVar3 == iVar4) goto LAB_00b3fd05;
} while (iVar5 != *piVar6);
}
iVar4 = piVar6[2];
iVar3 = piVar6[3];
}
piVar6[1] = *gpGlobals;
piVar6[2] = (uint)bVar2 + iVar4;
piVar6[3] = (_param_1 ^ 1) + iVar3;
piVar6[4] = *(int *)(this + 0x440);
*(bool *)(piVar6 + 5) = bVar2;
}
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.