CGameClient::SetupPackInfo
0x001e9270 · 640 bytes · __thiscall
_ZN11CGameClient13SetupPackInfoEP14CFrameSnapshot
Decompiled
undefined (2 params)
/* CGameClient::SetupPackInfo(CFrameSnapshot*) */
void __thiscall CGameClient::SetupPackInfo(CGameClient *this,CFrameSnapshot *param_1)
{
CClientFrameManager *this_00;
float fVar1;
int *piVar2;
char cVar3;
CClientFrame *this_01;
int iVar4;
int iVar5;
undefined4 *puVar6;
int iVar7;
undefined4 *puVar8;
byte bVar9;
longdouble lVar10;
float fVar11;
piVar2 = serverGameClients;
bVar9 = 0;
iVar7 = DAT_0039453c + 0xe;
if (-1 < DAT_0039453c + 7) {
iVar7 = DAT_0039453c + 7;
}
this_00 = (CClientFrameManager *)(this + 0x1d704);
*(int *)(this + 0x1f774) = iVar7 >> 3;
(**(code **)(*piVar2 + 0x20))
(piVar2,*(undefined4 *)(this + 0x1d768),*(undefined4 *)(this + 0x1d770),this + 0x1d774,
iVar7 >> 3);
this_01 = (CClientFrame *)CClientFrameManager::AllocateFrame(this_00);
*(CClientFrame **)(this + 0x1d76c) = this_01;
CClientFrame::Init(this_01,param_1);
*(int *)(this + 0x1f778) = *(int *)(this + 0x1d76c) + 0xc;
cVar3 = (**(code **)(*(int *)this + 0x7c))(this);
if (cVar3 == '\0') {
*(undefined4 *)(this + 0x1f77c) = 0;
}
else {
puVar6 = operator_new(0x100);
if (puVar6 != (undefined4 *)0x0) {
puVar8 = puVar6;
for (iVar7 = 0x40; iVar7 != 0; iVar7 = iVar7 + -1) {
*puVar8 = 0;
puVar8 = puVar8 + (uint)bVar9 * -2 + 1;
}
}
*(undefined4 **)(*(int *)(this + 0x1d76c) + 0x110) = puVar6;
*(undefined4 *)(this + 0x1f77c) = *(undefined4 *)(*(int *)(this + 0x1d76c) + 0x110);
}
iVar7 = 0x80;
if (0x7f < *(int *)(sv_maxclientframes._28_4_ + 0x30)) {
iVar7 = *(int *)(sv_maxclientframes._28_4_ + 0x30);
}
if (((*(float *)(this + 0x21ae4) != -1.0) &&
(fVar1 = *(float *)(sv_extra_client_connect_time._28_4_ + 0x2c),
realtime - *(float *)(this + 0x21ae4) < fVar1)) &&
(lVar10 = (longdouble)(**(code **)(**(int **)(this + 0xb8) + 0x30))(*(int **)(this + 0xb8)),
iVar7 <= (int)(fVar1 / (float)lVar10))) {
fVar1 = *(float *)(sv_extra_client_connect_time._28_4_ + 0x2c);
lVar10 = (longdouble)(**(code **)(**(int **)(this + 0xb8) + 0x30))(*(int **)(this + 0xb8));
iVar7 = (int)(fVar1 / (float)lVar10);
}
fVar1 = *(float *)(sv_maxreplay._28_4_ + 0x2c);
if (0.0 < fVar1) {
fVar11 = (float)iVar7;
lVar10 = (longdouble)(**(code **)(**(int **)(this + 0xb8) + 0x30))(*(int **)(this + 0xb8));
iVar7 = (int)fVar11;
if (fVar11 <= fVar1 / (float)lVar10) {
fVar1 = *(float *)(sv_maxreplay._28_4_ + 0x2c);
lVar10 = (longdouble)(**(code **)(**(int **)(this + 0xb8) + 0x30))(*(int **)(this + 0xb8));
iVar7 = (int)(fVar1 / (float)lVar10);
}
}
iVar4 = CClientFrameManager::AddClientFrame(this_00,*(CClientFrame **)(this + 0x1d76c));
if (iVar7 < iVar4) {
CClientFrameManager::RemoveOldestFrame(this_00);
}
iVar4 = DAT_003b7894;
iVar5 = 0;
*(undefined4 *)(this + 0x1f780) = 0;
iVar7 = g_AreasNetworked;
if (0 < iVar4) {
do {
*(undefined4 *)(this + iVar5 * 4 + 0x1f784) = *(undefined4 *)(iVar7 + iVar5 * 4);
iVar5 = iVar5 + 1;
*(int *)(this + 0x1f780) = iVar5;
} while (iVar5 != iVar4);
}
CM_SetupAreaFloodNums((uchar *)(this + 0x1f7a4),(int *)(this + 0x1f8a4));
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.