SendTable_CalcDelta
0x00155830 · 797 bytes · __cdecl
_Z19SendTable_CalcDeltaPK9SendTablePKviS3_iPiii
Decompiled
undefined (8 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* SendTable_CalcDelta(SendTable const*, void const*, int, void const*, int, int*, int, int) */
undefined4
SendTable_CalcDelta(SendTable *param_1,void *param_2,int param_3,void *param_4,int param_5,
int *param_6,int param_7,int param_8)
{
undefined8 uVar1;
int iVar2;
char cVar3;
int iVar4;
undefined4 uVar5;
bool bVar6;
undefined4 local_cc;
undefined4 local_c8;
undefined4 local_c0;
undefined4 local_bc;
int local_b8;
SendTable *local_b4;
undefined4 local_b0;
uint local_ac;
int local_a8;
CDeltaCalculator local_a4 [92];
CDeltaBitsReader local_48 [24];
int local_30;
undefined4 local_20;
local_ac = 0;
local_a8 = 0;
if (g_bServerDTIEnabled != '\0') {
local_b4 = param_1;
local_b0 = 0;
uVar1 = rdtsc();
local_a8 = (int)((ulonglong)uVar1 >> 0x20);
local_ac = (uint)uVar1;
}
local_cc = 0;
local_c8 = 0;
if (_exit == 0) {
local_b8 = 0;
}
else {
/* try { // try from 001558fb to 001558fd has its CatchHandler @ 00155b6a */
(**(code **)(_exit + 0x50))
(_exit,&local_cc,0,0,0,0,"/data/src/engine/./dt_send_eng.cpp",0x310,
&SendTable_CalcDelta(SendTable_const*,void_const*,int,void_const*,int,int*,int,int)::
tm_fmt,"(%s)%s","Unaccounted","SendTable_CalcDelta");
local_b8 = _exit;
}
iVar2 = _DAT_0040b9d4;
local_c0 = local_cc;
local_bc = local_c8;
if ((_DAT_0040b028 != 0) || (DAT_0040b02c == '\0')) {
/* try { // try from 00155ae6 to 00155b34 has its CatchHandler @ 00155ba8 */
iVar4 = ThreadGetCurrentId();
if (iVar2 == iVar4) {
if ((char *)*_DAT_0040b030 != "SendTable_CalcDelta") {
_DAT_0040b030 =
(int *)CVProfNode::GetSubNode((char *)_DAT_0040b030,0x2ae3a6,&DAT_00000001,0x2a054b);
}
CVProfNode::EnterScope();
DAT_0040b02c = '\0';
}
}
/* try { // try from 00155955 to 001559a4 has its CatchHandler @ 00155bac */
cVar3 = CompareBitArrays(param_2,param_4,param_3,param_5);
if (cVar3 == '\0') {
CDeltaCalculator::CDeltaCalculator
(local_a4,*(CSendTablePrecalc **)(param_1 + 0xc),param_2,param_3,param_4,param_5,
param_6,param_7,param_8);
while( true ) {
local_30 = CDeltaBitsReader::ReadNextPropIndex(local_48);
if (local_30 < 0) break;
if (local_30 == 0x7fffffff) goto LAB_001559dd;
if (param_2 == (void *)0x0) {
/* try { // try from 00155b48 to 00155b4c has its CatchHandler @ 00155b82 */
CDeltaCalculator::PropCalcNonZero(local_a4);
}
else {
/* try { // try from 001559c5 to 001559d1 has its CatchHandler @ 00155b82 */
CDeltaCalculator::PropCalcDelta(local_a4);
}
}
local_30 = 0x7fffffff;
LAB_001559dd:
CDeltaCalculator::~CDeltaCalculator(local_a4);
uVar5 = local_20;
}
else {
uVar5 = 0;
}
iVar2 = _DAT_0040b9d4;
if ((DAT_0040b02c == '\0') || (_DAT_0040b028 != 0)) {
iVar4 = ThreadGetCurrentId();
if (iVar2 == iVar4) {
cVar3 = CVProfNode::ExitScope();
if (cVar3 != '\0') {
_DAT_0040b030 = (int *)_DAT_0040b030[0x19];
}
DAT_0040b02c = _DAT_0040b030 == (int *)0x40b034;
}
}
if (local_b8 != 0) {
(**(code **)(local_b8 + 0x54))(local_b8,local_c0,local_bc,0,0,0);
}
if ((g_bServerDTIEnabled != '\0') && (local_b4 != (SendTable *)0x0)) {
uVar1 = rdtsc();
bVar6 = (uint)uVar1 < local_ac;
local_ac = (uint)uVar1 - local_ac;
local_a8 = ((int)((ulonglong)uVar1 >> 0x20) - local_a8) - (uint)bVar6;
_ServerDTI_HookTimer(local_b4,local_b0,&local_ac);
}
return uVar5;
}
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.