L L4D2node

CLagCompensationManager::FinishLagCompensation

0x007cc0d0 · 776 bytes · __cdecl

_ZN23CLagCompensationManager21FinishLagCompensationEP11CBasePlayer

Decompiled

undefined (1 param)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CLagCompensationManager::FinishLagCompensation(CBasePlayer*) */

void CLagCompensationManager::FinishLagCompensation(CBasePlayer *param_1)

{
  uint *puVar1;
  char *pcVar2;
  uint uVar3;
  char cVar4;
  ushort uVar5;
  int iVar6;
  undefined *puVar7;
  int iVar8;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_28;
  undefined4 local_24;
  int local_20;
  
  local_34 = 0;
  local_30 = 0;
  if (_towlower == 0) {
    local_20 = 0;
  }
  else {
    (**(code **)(_towlower + 0x50))
              (_towlower,&local_34,0,0,0,0,"/data/src/game/server/player_lagcompensation.cpp",0x2f0,
               &FinishLagCompensation(CBasePlayer*)::tm_fmt,"(%s)%s","Networking",
               "FinishLagCompensation");
    local_20 = _towlower;
  }
  iVar8 = _DAT_0105db00;
  local_28 = local_34;
  local_24 = local_30;
                    /* try { // try from 007cc182 to 007cc186 has its CatchHandler @ 007cc411 */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar6 = ThreadGetCurrentId(), iVar8 == iVar6)) {
    if ((char *)*_DAT_0105d15c != "FinishLagCompensation") {
                    /* try { // try from 007cc3c0 to 007cc3e3 has its CatchHandler @ 007cc411 */
      _DAT_0105d15c =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xcbc6d0,(char *)0x0,0xcbc6e6);
    }
    puVar1 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
    *puVar1 = *puVar1 | 3;
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
  param_1[0x54] = (CBasePlayer)0x0;
  iVar8 = _DAT_0105db00;
  if (param_1[0x2c] == (CBasePlayer)0x0) {
    if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
       (iVar6 = ThreadGetCurrentId(), iVar8 == iVar6)) {
      cVar4 = CVProfNode::ExitScope();
      if (cVar4 != '\0') {
        _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
      }
      DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
    }
    if (local_20 != 0) {
      (**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
    }
  }
  else {
    uVar5 = CUtlRBTree<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
            ::FirstInorder((CUtlRBTree<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                            *)(param_1 + 0x10));
    iVar8 = _DAT_0105db00;
    while (_DAT_0105db00 = iVar8, uVar5 != 0xffff) {
      iVar8 = (uint)uVar5 * 0x10 + *(int *)(param_1 + 0x14);
      pcVar2 = *(char **)(iVar8 + 0xc);
      if (((*pcVar2 != '\0') && (uVar3 = *(uint *)(iVar8 + 8), uVar3 != 0xffffffff)) &&
         ((puVar7 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc &&
          ((*(uint *)(puVar7 + 8) == uVar3 >> 0xc &&
           (*(CBaseEntity **)(puVar7 + 4) != (CBaseEntity *)0x0)))))) {
                    /* try { // try from 007cc241 to 007cc245 has its CatchHandler @ 007cc3f0 */
        RestoreEntityFromRecords
                  ((CLagCompensationManager *)param_1,*(CBaseEntity **)(puVar7 + 4),
                   (LagRecord *)(pcVar2 + 0x30),(LagRecord *)(pcVar2 + 0x160),true);
      }
      uVar5 = CUtlRBTree<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
              ::NextInorder((CUtlRBTree<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CHandle<CBaseEntity>,CLagCompensationManager::EntityLagData*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                             *)(param_1 + 0x10),uVar5);
      iVar8 = _DAT_0105db00;
    }
    if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
       (iVar6 = ThreadGetCurrentId(), iVar8 == iVar6)) {
      cVar4 = CVProfNode::ExitScope();
      if (cVar4 != '\0') {
        _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
      }
      DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
    }
    if (local_20 != 0) {
      (**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
      return;
    }
  }
  return;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)