CBaseClient::ProcessBaselineAck
0x000f9030 · 768 bytes · __thiscall
_ZN11CBaseClient18ProcessBaselineAckEP15CLC_BaselineAck
Decompiled
undefined (2 params)
/* CBaseClient::ProcessBaselineAck(CLC_BaselineAck*) */
undefined4 __thiscall CBaseClient::ProcessBaselineAck(CBaseClient *this,CLC_BaselineAck *param_1)
{
CBaseClient *pCVar1;
int iVar2;
int iVar3;
int iVar4;
int iVar5;
uint uVar6;
uint uVar7;
int iVar8;
iVar3 = *(int *)(param_1 + 0x4c);
if (iVar3 != *(int *)(this + 0x108)) {
return 1;
}
if (*(int *)(param_1 + 0x50) != *(int *)(this + 0x20c)) {
DevMsg("CBaseClient::ProcessBaselineAck: wrong baseline nr received (%i)\n",iVar3);
return 1;
}
iVar3 = (**(code **)(*(int *)this + 0xe0))(this,iVar3);
if (iVar3 == 0) {
return 1;
}
iVar3 = *(int *)(iVar3 + 0x118);
if (iVar3 == 0) {
DevMsg("CBaseClient::ProcessBaselineAck: invalid frame snapshot (%i)\n",
*(undefined4 *)(this + 0x108));
return 0;
}
uVar6 = *(uint *)(this + 0x10c) & GetStartBitMask(int)::g_StartMask;
if (uVar6 == 0) {
uVar6 = *(uint *)(this + 0x110);
iVar4 = 1;
do {
if (uVar6 != 0) {
iVar4 = iVar4 << 5;
goto LAB_000f90f6;
}
uVar6 = *(uint *)(this + iVar4 * 4 + 0x110);
iVar4 = iVar4 + 1;
} while (iVar4 != 0x40);
}
else {
iVar4 = 0;
LAB_000f90f6:
if ((uVar6 & 0xff) == 0) {
uVar7 = uVar6 >> 8 & 0xff;
if (uVar7 == 0) {
uVar7 = uVar6 >> 0x10 & 0xff;
if (uVar7 == 0) {
if (uVar6 >> 0x18 == 0) goto LAB_000f9278;
iVar4 = iVar4 + 0x18 +
*(int *)(FirstBitInWord(unsigned_int,int)::firstBitLUT + (uVar6 >> 0x18) * 4);
}
else {
iVar4 = iVar4 + 0x10 + *(int *)(FirstBitInWord(unsigned_int,int)::firstBitLUT + uVar7 * 4)
;
}
}
else {
iVar4 = iVar4 + 8 + *(int *)(FirstBitInWord(unsigned_int,int)::firstBitLUT + uVar7 * 4);
}
}
else {
iVar4 = iVar4 + *(int *)(FirstBitInWord(unsigned_int,int)::firstBitLUT + (uVar6 & 0xff) * 4);
}
if (-1 < iVar4) {
iVar8 = iVar4 * 0xc;
iVar5 = *(int *)(*(int *)(iVar3 + 8) + 8 + iVar8);
do {
if (iVar5 == 0) {
DevMsg("CBaseClient::ProcessBaselineAck: invalid packet handle (%i)\n",iVar4);
return 0;
}
iVar2 = *(int *)(*(int *)(*(int *)(this + 0x104) + 8) + 8 + iVar8);
if (iVar2 != 0) {
CFrameSnapshotManager::RemoveEntityReference
((CFrameSnapshotManager *)framesnapshotmanager,iVar2);
}
CFrameSnapshotManager::AddEntityReference
((CFrameSnapshotManager *)framesnapshotmanager,iVar5);
iVar5 = *(int *)(iVar3 + 8);
iVar2 = *(int *)(*(int *)(this + 0x104) + 8);
*(undefined4 *)(iVar2 + iVar8) = *(undefined4 *)(iVar5 + iVar8);
*(undefined4 *)(iVar2 + 4 + iVar8) = *(undefined4 *)(iVar5 + 4 + iVar8);
*(undefined4 *)(iVar2 + 8 + iVar8) = *(undefined4 *)(iVar5 + 8 + iVar8);
uVar6 = iVar4 + 1;
if (0x7ff < (int)uVar6) break;
iVar5 = (int)uVar6 >> 5;
pCVar1 = this + iVar5 * 4 + 0x10c;
uVar6 = *(uint *)pCVar1 & (&GetStartBitMask(int)::g_StartMask)[uVar6 & 0x1f];
iVar4 = iVar5;
if (uVar6 == 0) {
iVar4 = iVar5 + 1;
uVar6 = *(uint *)(pCVar1 + 4);
if (iVar4 == 0x40) break;
while (uVar6 == 0) {
uVar6 = *(uint *)(pCVar1 + iVar4 * 4 + iVar5 * -4 + 4);
iVar4 = iVar4 + 1;
if (iVar4 == 0x40) goto LAB_000f9278;
}
}
iVar4 = iVar4 * 0x20;
if ((uVar6 & 0xff) == 0) {
uVar7 = uVar6 >> 8 & 0xff;
if (uVar7 == 0) {
uVar7 = uVar6 >> 0x10 & 0xff;
if (uVar7 == 0) {
if (uVar6 >> 0x18 == 0) break;
iVar4 = iVar4 + 0x18 +
*(int *)(FirstBitInWord(unsigned_int,int)::firstBitLUT + (uVar6 >> 0x18) * 4);
}
else {
iVar4 = iVar4 + 0x10 +
*(int *)(FirstBitInWord(unsigned_int,int)::firstBitLUT + uVar7 * 4);
}
}
else {
iVar4 = iVar4 + 8 + *(int *)(FirstBitInWord(unsigned_int,int)::firstBitLUT + uVar7 * 4);
}
}
else {
iVar4 = iVar4 + *(int *)(FirstBitInWord(unsigned_int,int)::firstBitLUT +
(uVar6 & 0xff) * 4);
}
if (iVar4 < 0) break;
iVar8 = iVar4 * 0xc;
iVar5 = *(int *)(*(int *)(iVar3 + 8) + 8 + iVar8);
} while( true );
}
}
LAB_000f9278:
*(undefined4 *)(*(int *)(this + 0x104) + 4) = *(undefined4 *)(this + 0x108);
*(undefined4 *)(this + 0x108) = 0xffffffff;
*(uint *)(this + 0x20c) = (uint)(*(int *)(this + 0x20c) != 1);
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.