L L4D2node

CLagCompensationManager::StartLagCompensation

0x007cc530 · 1756 bytes · __thiscall

_ZN23CLagCompensationManager20StartLagCompensationEP11CBasePlayer19LagCompensationTypeRK6VectorRK6QAnglef

Decompiled

undefined (6 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CLagCompensationManager::StartLagCompensation(CBasePlayer*, LagCompensationType, Vector const&,
   QAngle const&, float) */

void __thiscall
CLagCompensationManager::StartLagCompensation
          (CLagCompensationManager *this,CBaseEntity *param_1,undefined4 param_3,undefined4 *param_4
          ,undefined4 *param_5,undefined4 param_6)

{
  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>>
  *this_00;
  void *pvVar1;
  int iVar2;
  uint uVar3;
  CBaseEntity *pCVar4;
  char cVar5;
  undefined1 uVar6;
  ushort uVar7;
  undefined1 *puVar8;
  int *piVar9;
  undefined4 uVar10;
  undefined1 *puVar11;
  int iVar12;
  undefined *puVar13;
  int iVar14;
  longdouble lVar15;
  float fVar16;
  float fVar17;
  float fVar18;
  uint local_4c;
  undefined4 local_48;
  undefined4 local_44 [2];
  uint local_3c;
  undefined4 local_38;
  int local_34;
  int local_30;
  undefined4 local_2c;
  undefined4 local_28;
  int local_24;
  int local_20;
  
  local_30 = 0;
  local_2c = 0;
  local_28 = 0;
  local_24 = 0;
  local_20 = 0;
  this_00 = (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>>
             *)(this + 0x10);
  for (uVar7 = 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(this_00); uVar7 != 0xffff;
      uVar7 = 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(this_00,uVar7)) {
    iVar14 = (uint)uVar7 * 0x10 + *(int *)(this + 0x14);
    puVar11 = *(undefined1 **)(iVar14 + 0xc);
    local_3c = *(uint *)(iVar14 + 8);
    if ((((local_3c == 0xffffffff) ||
         (puVar13 = g_pEntityList + (local_3c & 0xfff) * 0x10, puVar13 == (undefined *)0xfffffffc))
        || (*(uint *)(puVar13 + 8) != local_3c >> 0xc)) || (*(int *)(puVar13 + 4) == 0)) {
                    /* try { // try from 007cc594 to 007cc90e has its CatchHandler @ 007ccc1a */
      CUtlVector<CHandle<CBaseEntity>,CUtlMemory<CHandle<CBaseEntity>,int>>::InsertBefore
                ((CUtlVector<CHandle<CBaseEntity>,CUtlMemory<CHandle<CBaseEntity>,int>> *)&local_30,
                 local_24,(CHandle *)&local_3c);
    }
    else {
      *puVar11 = 0;
      iVar14 = 0xf;
      *(undefined4 *)(puVar11 + 0x30) = 0;
      *(undefined4 *)(puVar11 + 0x34) = 0;
      *(undefined4 *)(puVar11 + 0x38) = 0;
      *(undefined4 *)(puVar11 + 0x3c) = 0;
      *(undefined4 *)(puVar11 + 0x40) = 0;
      *(undefined4 *)(puVar11 + 0x44) = 0;
      *(undefined4 *)(puVar11 + 0x48) = 0;
      *(undefined4 *)(puVar11 + 0x4c) = 0;
      *(undefined4 *)(puVar11 + 0x50) = 0;
      *(undefined4 *)(puVar11 + 0x54) = 0;
      *(undefined4 *)(puVar11 + 0x58) = 0;
      *(undefined4 *)(puVar11 + 0x5c) = 0;
      *(undefined4 *)(puVar11 + 0x60) = 0;
      *(undefined4 *)(puVar11 + 100) = 0xbf800000;
      *(undefined4 *)(puVar11 + 0x158) = 0;
      *(undefined4 *)(puVar11 + 0x15c) = 0;
      puVar8 = puVar11;
      do {
        *(undefined4 *)(puVar8 + 0x68) = 0;
        *(undefined4 *)(puVar8 + 0x6c) = 0;
        *(undefined4 *)(puVar8 + 0x70) = 0;
        *(undefined4 *)(puVar8 + 0x74) = 0;
        iVar14 = iVar14 + -1;
        puVar8 = puVar8 + 0x10;
      } while (iVar14 != 0);
      *(undefined4 *)(puVar11 + 0x160) = 0;
      iVar14 = 0xf;
      *(undefined4 *)(puVar11 + 0x164) = 0;
      *(undefined4 *)(puVar11 + 0x168) = 0;
      *(undefined4 *)(puVar11 + 0x16c) = 0;
      *(undefined4 *)(puVar11 + 0x170) = 0;
      *(undefined4 *)(puVar11 + 0x174) = 0;
      *(undefined4 *)(puVar11 + 0x178) = 0;
      *(undefined4 *)(puVar11 + 0x17c) = 0;
      *(undefined4 *)(puVar11 + 0x180) = 0;
      *(undefined4 *)(puVar11 + 0x184) = 0;
      *(undefined4 *)(puVar11 + 0x188) = 0;
      *(undefined4 *)(puVar11 + 0x18c) = 0;
      *(undefined4 *)(puVar11 + 400) = 0;
      *(undefined4 *)(puVar11 + 0x194) = 0xbf800000;
      *(undefined4 *)(puVar11 + 0x288) = 0;
      *(undefined4 *)(puVar11 + 0x28c) = 0;
      do {
        *(undefined4 *)(puVar11 + 0x198) = 0;
        *(undefined4 *)(puVar11 + 0x19c) = 0;
        *(undefined4 *)(puVar11 + 0x1a0) = 0;
        *(undefined4 *)(puVar11 + 0x1a4) = 0;
        iVar14 = iVar14 + -1;
        puVar11 = puVar11 + 0x10;
      } while (iVar14 != 0);
    }
  }
  iVar14 = 0;
  if (0 < local_24) {
    do {
      local_44[0] = *(undefined4 *)(local_30 + iVar14 * 4);
      uVar7 = 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>>
              ::Find(this_00,(Node_t *)local_44);
      if (uVar7 != 0xffff) {
        pvVar1 = *(void **)((uint)uVar7 * 0x10 + *(int *)(this + 0x14) + 0xc);
        if (pvVar1 != (void *)0x0) {
          CUtlLinkedList<LagRecord,int,true,int,CUtlFixedMemory<UtlLinkedListElem_t<LagRecord,int>>>
          ::RemoveAll((CUtlLinkedList<LagRecord,int,true,int,CUtlFixedMemory<UtlLinkedListElem_t<LagRecord,int>>>
                       *)((int)pvVar1 + 4));
          CUtlFixedMemory<UtlLinkedListElem_t<LagRecord,int>>::Purge();
          operator_delete(pvVar1);
        }
        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>>
        ::RemoveAt(this_00,uVar7);
      }
      iVar14 = iVar14 + 1;
    } while (iVar14 < local_24);
  }
  this[0x2c] = (CLagCompensationManager)0x0;
  *(CBaseEntity **)(this + 0x30) = param_1;
  if (((param_1[0x1cf4] != (CBaseEntity)0x0) && (1 < *(int *)(gpGlobals + 0x14))) &&
     ((*(int *)(sv_unlag._28_4_ + 0x30) != 0 &&
      ((cVar5 = (**(code **)(*(int *)param_1 + 0x778))(param_1), cVar5 == '\0' &&
       (((byte)param_1[0x1d20] & 8) == 0)))))) {
    iVar14 = *(int *)(param_1 + 0x1fe4);
    if (iVar14 == 0) {
                    /* try { // try from 007ccc05 to 007ccc09 has its CatchHandler @ 007ccc1a */
      Error("CLagCompensationManager::StartLagCompensation with NULL CUserCmd!!!\n");
    }
    local_4c = 0;
    local_48 = 0;
    if (_towlower == 0) {
      local_34 = 0;
    }
    else {
      (**(code **)(_towlower + 0x50))
                (_towlower,&local_4c,0,0,0,0,"/data/src/game/server/player_lagcompensation.cpp",
                 0x142,&StartLagCompensation(CBasePlayer*,LagCompensationType,Vector_const&,QAngle_const&,float)
                        ::tm_fmt,"(%s)%s","Networking","StartLagCompensation");
      local_34 = _towlower;
    }
    local_3c = local_4c;
    local_38 = local_48;
                    /* try { // try from 007cc953 to 007cc957 has its CatchHandler @ 007ccc4a */
    CVProfile::EnterScope
              ((CVProfile *)&g_VProfCurrentProfile,"StartLagCompensation",0,"Networking",false,4);
    this[0x54] = (CLagCompensationManager)0x1;
    if (*(int *)(param_1 + 0x30) == 0) {
      iVar12 = 0;
    }
    else {
      iVar12 = *(int *)(param_1 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
    }
                    /* try { // try from 007cc98a to 007ccbbe has its CatchHandler @ 007ccc2f */
    piVar9 = (int *)(**(code **)(*engine + 0x54))(engine,iVar12);
    if (piVar9 == (int *)0x0) {
      fVar16 = 0.0;
    }
    else {
      lVar15 = (longdouble)(**(code **)(*piVar9 + 0x24))(piVar9,0);
      fVar16 = (float)lVar15;
    }
    iVar12 = gpGlobals;
    fVar16 = fVar16 + *(float *)(param_1 + 0x1cf0);
    fVar18 = *(float *)(sv_maxunlag._28_4_ + 0x2c);
    if ((fVar16 <= *(float *)(sv_maxunlag._28_4_ + 0x2c)) && (fVar18 = 0.0, 0.0 <= fVar16)) {
      fVar18 = fVar16;
    }
    fVar16 = *(float *)(gpGlobals + 0x1c);
    fVar17 = (float)*(int *)(iVar14 + 8) * fVar16 - *(float *)(param_1 + 0x1cf0);
    if (0.2 < ABS((fVar17 - *(float *)(gpGlobals + 0xc)) + fVar18)) {
      fVar17 = *(float *)(gpGlobals + 0xc) - fVar18;
    }
    iVar2 = *(int *)(sv_lagpushticks._28_4_ + 0x30);
    *(undefined4 *)(this + 0x34) = param_3;
    piVar9 = engine;
    *(undefined4 *)(this + 0x38) = *param_4;
    *(undefined4 *)(this + 0x3c) = param_4[1];
    *(undefined4 *)(this + 0x40) = param_4[2];
    *(undefined4 *)(this + 0x44) = *param_5;
    *(undefined4 *)(this + 0x48) = param_5[1];
    *(undefined4 *)(this + 0x4c) = param_5[2];
    *(undefined4 *)(this + 0x50) = param_6;
    if (*(int *)(param_1 + 0x30) == 0) {
      iVar12 = -1;
    }
    else {
      iVar12 = (*(int *)(param_1 + 0x30) - *(int *)(iVar12 + 0x58) >> 4) + -1;
    }
    uVar10 = (**(code **)(*piVar9 + 0x144))(piVar9,iVar12);
    for (uVar7 = 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(this_00); uVar7 != 0xffff;
        uVar7 = 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(this_00,uVar7)) {
      iVar12 = (uint)uVar7 * 0x10 + *(int *)(this + 0x14);
      puVar11 = *(undefined1 **)(iVar12 + 0xc);
      uVar3 = *(uint *)(iVar12 + 8);
      if (((((uVar3 != 0xffffffff) &&
            (puVar13 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar13 != (undefined *)0xfffffffc))
           && (*(uint *)(puVar13 + 8) == uVar3 >> 0xc)) &&
          ((pCVar4 = *(CBaseEntity **)(puVar13 + 4), pCVar4 != (CBaseEntity *)0x0 &&
           (param_1 != pCVar4)))) &&
         (cVar5 = (**(code **)(*(int *)param_1 + 0x56c))(param_1,pCVar4,iVar14,uVar10),
         cVar5 != '\0')) {
        uVar6 = BacktrackEntity(this,pCVar4,fVar17 + fVar16 * (float)iVar2,
                                (CUtlFixedLinkedList *)(puVar11 + 4),(LagRecord *)(puVar11 + 0x30),
                                (LagRecord *)(puVar11 + 0x160),true);
        *puVar11 = uVar6;
      }
    }
    CVProfile::ExitScope((CVProfile *)&g_VProfCurrentProfile);
    Tm_Zone::~Tm_Zone((Tm_Zone *)&local_3c);
  }
  local_24 = 0;
  CUtlMemory<CHandle<CBaseEntity>,int>::Purge((CUtlMemory<CHandle<CBaseEntity>,int> *)&local_30);
  local_20 = local_30;
  CUtlMemory<CHandle<CBaseEntity>,int>::Purge((CUtlMemory<CHandle<CBaseEntity>,int> *)&local_30);
  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)