RecvTable_MergeDeltas
0x00150140 · 800 bytes · __cdecl
_Z21RecvTable_MergeDeltasP9RecvTableP7bf_readS2_P8bf_writeiPib
Decompiled
undefined (7 params)
/* RecvTable_MergeDeltas(RecvTable*, bf_read*, bf_read*, bf_write*, int, int*, bool) */
int RecvTable_MergeDeltas
(RecvTable *param_1,bf_read *param_2,bf_read *param_3,bf_write *param_4,int param_5,
int *param_6,bool param_7)
{
int iVar1;
CRecvDecoder *pCVar2;
int iVar3;
int iVar4;
int local_64;
int local_60;
int local_5c;
int local_58;
CDeltaBitsWriter local_48 [12];
CDeltaBitsReader local_3c [16];
CDeltaBitsReader local_2c [28];
if (((param_1 == (RecvTable *)0x0) || (param_3 == (bf_read *)0x0)) || (param_4 == (bf_write *)0x0)
) {
Error("RecvTable_MergeDeltas: invalid parameters passed.");
}
pCVar2 = *(CRecvDecoder **)(param_1 + 8);
if (pCVar2 == (CRecvDecoder *)0x0) {
Error("RecvTable_MergeDeltas: table \'%s\' is missing its decoder.",
*(undefined4 *)(param_1 + 0xc));
}
CDeltaBitsReader::CDeltaBitsReader(local_3c,param_2);
/* try { // try from 0015019e to 001501a2 has its CatchHandler @ 001504af */
CDeltaBitsReader::CDeltaBitsReader(local_2c,param_3);
/* try { // try from 001501b0 to 001501b4 has its CatchHandler @ 001504ab */
CDeltaBitsWriter::CDeltaBitsWriter(local_48,param_4);
if (param_2 == (bf_read *)0x0) {
iVar4 = *(int *)(param_3 + 0x20);
iVar3 = 0x7fffffff;
}
else {
/* try { // try from 001501c6 to 001503ed has its CatchHandler @ 00150480 */
iVar3 = CDeltaBitsReader::ReadNextPropIndex(local_3c);
iVar4 = *(int *)(param_3 + 0x20);
if (iVar3 < 0) {
iVar3 = 0x7fffffff;
}
}
if (iVar4 == 0) {
local_5c = 0;
}
else {
iVar4 = (((uint)(*(int *)(param_3 + 0x18) - iVar4) >> 2) * 0x20 - *(int *)(param_3 + 0x14)) +
(*(uint *)(param_3 + 0xc) & 3) * 8;
local_5c = *(int *)(param_3 + 8);
if (iVar4 <= *(int *)(param_3 + 8)) {
local_5c = iVar4;
}
}
iVar4 = CDeltaBitsReader::ReadNextPropIndex(local_2c);
if (iVar4 < 0) {
iVar4 = 0x7fffffff;
}
local_64 = 0;
local_60 = 0;
local_58 = 0;
do {
if (iVar4 <= iVar3) {
do {
if (iVar4 == 0x7fffffff) {
if (((param_2 != (bf_read *)0x0) && (param_2[4] != (bf_read)0x0)) ||
((param_3[4] != (bf_read)0x0 || (param_4[0x10] != (bf_write)0x0)))) {
Error("RecvTable_MergeDeltas: overflowed in RecvTable \'%s\'.",
*(undefined4 *)(param_1 + 0xc));
}
CDeltaBitsWriter::~CDeltaBitsWriter(local_48);
CDeltaBitsReader::~CDeltaBitsReader(local_2c);
CDeltaBitsReader::~CDeltaBitsReader(local_3c);
return local_58;
}
if (iVar3 == iVar4) {
iVar3 = *(int *)(*(int *)(pCVar2 + 0x34) + iVar4 * 4);
(**(code **)(g_PropTypeFns + *(int *)(iVar3 + 8) * 0x24 + 0x20))(iVar3,param_2);
iVar3 = CDeltaBitsReader::ReadNextPropIndex(local_3c);
if (iVar3 < 0) {
iVar3 = 0x7fffffff;
}
}
if ((param_7) && (g_bDTIEnabled != '\0')) {
if (*(int *)(param_3 + 0x20) == 0) {
local_60 = 0;
}
else {
iVar1 = (((uint)(*(int *)(param_3 + 0x18) - *(int *)(param_3 + 0x20)) >> 2) * 0x20 -
*(int *)(param_3 + 0x14)) + (*(uint *)(param_3 + 0xc) & 3) * 8;
local_60 = *(int *)(param_3 + 8);
if (iVar1 <= *(int *)(param_3 + 8)) {
local_60 = iVar1;
}
}
local_64 = local_60 - local_5c;
}
CopyPropState(pCVar2,iVar4,param_3,local_48);
if (param_6 != (int *)0x0) {
param_6[local_58] = iVar4;
}
local_58 = local_58 + 1;
if ((param_7) && (g_bDTIEnabled != '\0')) {
if (*(int *)(param_3 + 0x20) == 0) {
local_5c = 0;
}
else {
iVar1 = (((uint)(*(int *)(param_3 + 0x18) - *(int *)(param_3 + 0x20)) >> 2) * 0x20 -
*(int *)(param_3 + 0x14)) + (*(uint *)(param_3 + 0xc) & 3) * 8;
local_5c = *(int *)(param_3 + 8);
if (iVar1 <= *(int *)(param_3 + 8)) {
local_5c = iVar1;
}
}
_DTI_HookDeltaBits(pCVar2,iVar4,local_5c - local_60,local_64);
}
iVar4 = CDeltaBitsReader::ReadNextPropIndex(local_2c);
if (iVar4 < 0) {
iVar4 = 0x7fffffff;
}
} while (iVar4 <= iVar3);
}
CopyPropState(pCVar2,iVar3,param_2,local_48);
iVar3 = CDeltaBitsReader::ReadNextPropIndex(local_3c);
if (iVar3 < 0) {
iVar3 = 0x7fffffff;
}
} 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.