L L4D2node

CServerGameEnts::CheckTransmit

0x006c6a00 · 1598 bytes · __thiscall

_ZN15CServerGameEnts13CheckTransmitEP18CCheckTransmitInfoPKti

Decompiled

undefined (4 params)

/* CServerGameEnts::CheckTransmit(CCheckTransmitInfo*, unsigned short const*, int) */

void __thiscall
CServerGameEnts::CheckTransmit
          (CServerGameEnts *this,CCheckTransmitInfo *param_1,ushort *param_2,int param_3)

{
  ushort *puVar1;
  CBasePlayer CVar2;
  ushort uVar3;
  byte *pbVar4;
  int *piVar5;
  int iVar6;
  uint uVar7;
  int *piVar8;
  char cVar9;
  byte *pbVar10;
  int iVar11;
  uint uVar12;
  uint uVar13;
  CServerNetworkProperty *this_00;
  int *piVar14;
  byte *pbVar15;
  uint *puVar16;
  int iVar17;
  uint *puVar18;
  bool bVar19;
  float fVar20;
  int local_54;
  int local_4c;
  CBasePlayer *local_38;
  int local_34;
  int local_28;
  
  pbVar15 = *(byte **)param_1;
  pbVar4 = *(byte **)(gpGlobals + 0x58);
  pbVar10 = pbVar15;
  if ((pbVar15 != (byte *)0x0) ||
     ((pbVar4 != (byte *)0x0 && (pbVar10 = pbVar4, (*pbVar4 & 2) == 0)))) {
    piVar5 = *(int **)(pbVar10 + 0xc);
    if (piVar5 == (int *)0x0) {
      local_38 = (CBasePlayer *)0x0;
    }
    else {
      local_38 = (CBasePlayer *)(**(code **)(*piVar5 + 0x18))(piVar5);
      pbVar15 = *(byte **)param_1;
    }
    piVar5 = mdlcache;
    if (pbVar15 == (byte *)0x0) {
      cVar9 = '\0';
    }
    else {
      cVar9 = (char)((int)pbVar15 - *(int *)(gpGlobals + 0x58) >> 4);
    }
    if (local_38 != (CBasePlayer *)0x0) {
      (**(code **)(*mdlcache + 0x68))(mdlcache);
      iVar6 = *(int *)(local_38 + 0x1ae8);
                    /* try { // try from 006c6a8b to 006c6dae has its CatchHandler @ 006c7057 */
      iVar11 = (**(code **)(*(int *)local_38 + 0x794))(local_38);
      bVar19 = *(int *)(ent_steadystate_enable._28_4_ + 0x30) != 0;
      local_4c = 0;
      if (bVar19) {
        local_4c = iVar11;
      }
      fVar20 = *(float *)(gpGlobals + 0xc) - *(float *)(ent_steadystate_delay._28_4_ + 0x2c);
      CVar2 = local_38[0x1ca4];
      if (0 < param_3) {
        uVar7 = 1 << (cVar9 - 1U & 0x1f);
        puVar1 = param_2 + param_3;
        do {
          while (uVar3 = *param_2, 0x7ff < uVar3) {
joined_r0x006c6e8b:
            param_2 = param_2 + 1;
            if (param_2 == puVar1) goto LAB_006c6dbc;
          }
          uVar12 = (uint)uVar3;
          puVar16 = (uint *)(pbVar4 + uVar12 * 0x10);
          uVar13 = *puVar16;
          if (((uVar13 & 0x10) != 0) ||
             (iVar11 = *(int *)(param_1 + 0x2008),
             (*(uint *)(iVar11 + (uint)(uVar3 >> 5) * 4) & 1 << ((byte)uVar3 & 0x1f)) != 0))
          goto joined_r0x006c6e8b;
          if ((uVar13 & 8) != 0) {
            while( true ) {
              uVar13 = 1 << ((byte)uVar12 & 0x1f);
              iVar17 = ((int)uVar12 >> 5) * 4;
              puVar18 = (uint *)(iVar11 + iVar17);
              *puVar18 = *puVar18 | uVar13;
              if (CVar2 != (CBasePlayer)0x0) {
                puVar18 = (uint *)(iVar17 + *(int *)(param_1 + 0x200c));
                *puVar18 = *puVar18 | uVar13;
              }
              if (((CServerNetworkProperty *)puVar16[2] == (CServerNetworkProperty *)0x0) ||
                 (iVar11 = CServerNetworkProperty::GetNetworkParent
                                     ((CServerNetworkProperty *)puVar16[2]), iVar11 == 0)) break;
              puVar16 = *(uint **)(iVar11 + 0xc);
              if (puVar16 == (uint *)0x0) {
                uVar12 = 0;
              }
              else {
                uVar12 = (int)puVar16 - *(int *)(gpGlobals + 0x58) >> 4;
              }
              iVar11 = *(int *)(param_1 + 0x2008);
            }
            goto joined_r0x006c6e8b;
          }
          piVar8 = (int *)puVar16[3];
          cVar9 = (**(code **)(*piVar8 + 0x16c))(piVar8);
          if (cVar9 != '\0') {
            if (piVar8[0xc] == 0) {
              iVar11 = 0;
            }
            else {
              iVar11 = piVar8[0xc] - *(int *)(gpGlobals + 0x58) >> 4;
            }
            CBasePlayer::SetPlayerInPVS(local_38,iVar11,false);
          }
          uVar13 = uVar13 & 0x38;
          if ((uVar13 == 0) &&
             (uVar13 = (**(code **)(*piVar8 + 0x54))(piVar8,param_1), (uVar13 & 8) != 0)) {
LAB_006c6e22:
            (**(code **)(*piVar8 + 0x5c))(piVar8,param_1,1);
            cVar9 = (**(code **)(*piVar8 + 0x16c))(piVar8);
LAB_006c6e49:
            if (cVar9 != '\0') {
              local_34 = 0;
              if (piVar8[0xc] != 0) {
                local_34 = piVar8[0xc] - *(int *)(gpGlobals + 0x58) >> 4;
              }
              CBasePlayer::SetPlayerInPVS(local_38,local_34,true);
            }
            goto joined_r0x006c6e8b;
          }
          if ((uVar13 & 0x20) == 0) goto joined_r0x006c6e8b;
          if (!bVar19) {
LAB_006c6c6a:
            this_00 = (CServerNetworkProperty *)puVar16[2];
            if (CVar2 == (CBasePlayer)0x0) {
              iVar11 = (**(code **)(*(int *)this_00 + 0x14))();
              if (iVar6 == iVar11) goto LAB_006c6e22;
              cVar9 = CServerNetworkProperty::IsInPVS(this_00,param_1);
              if ((cVar9 != '\0') || (*(int *)(sv_force_transmit_ents._28_4_ + 0x30) != 0)) {
                (**(code **)(*piVar8 + 0x5c))(piVar8,param_1,0);
                cVar9 = (**(code **)(*piVar8 + 0x16c))(piVar8);
                goto LAB_006c6e49;
              }
              do {
                do {
                  this_00 = (CServerNetworkProperty *)
                            CServerNetworkProperty::GetNetworkParent(this_00);
                  if (this_00 == (CServerNetworkProperty *)0x0) goto joined_r0x006c6e8b;
                  puVar16 = *(uint **)(this_00 + 0xc);
                  if (puVar16 == (uint *)0x0) {
                    uVar13 = 1;
                    iVar11 = 0;
                  }
                  else {
                    uVar12 = (int)puVar16 - *(int *)(gpGlobals + 0x58) >> 4;
                    uVar13 = 1 << ((byte)uVar12 & 0x1f);
                    iVar11 = (uVar12 >> 5) << 2;
                  }
                  if ((*(uint *)(*(int *)(param_1 + 0x2008) + iVar11) & uVar13) != 0) {
                    (**(code **)(*piVar8 + 0x5c))(piVar8,param_1,1);
                    cVar9 = (**(code **)(*piVar8 + 0x16c))(piVar8);
                    if (cVar9 != '\0') {
                      local_54 = 0;
                      if (piVar8[0xc] != 0) {
                        local_54 = piVar8[0xc] - *(int *)(gpGlobals + 0x58) >> 4;
                      }
                      CBasePlayer::SetPlayerInPVS(local_38,local_54,true);
                    }
                    goto joined_r0x006c6e8b;
                  }
                  uVar13 = *puVar16;
                  if ((uVar13 & 0x10) != 0) goto joined_r0x006c6e8b;
                  if ((uVar13 & 8) != 0) {
                    (**(code **)(*piVar8 + 0x5c))(piVar8,param_1,1);
                    cVar9 = (**(code **)(*piVar8 + 0x16c))(piVar8);
                    if (cVar9 != '\0') {
                      iVar11 = 0;
                      if (piVar8[0xc] != 0) {
                        iVar11 = piVar8[0xc] - *(int *)(gpGlobals + 0x58) >> 4;
                      }
                      CBasePlayer::SetPlayerInPVS(local_38,iVar11,true);
                    }
                    goto joined_r0x006c6e8b;
                  }
                  if ((uVar13 & 0x38) == 0) {
                    piVar14 = (int *)(**(code **)(*(int *)this_00 + 0x1c))(this_00);
                    uVar13 = (**(code **)(*piVar14 + 0x54))(piVar14,param_1);
                    if ((uVar13 & 8) == 0) goto joined_r0x006c6e8b;
                    (**(code **)(*piVar14 + 0x5c))(piVar14,param_1,1);
                    (**(code **)(*piVar8 + 0x5c))(piVar8,param_1,1);
                    goto LAB_006c6d6c;
                  }
                } while ((uVar13 & 0x20) == 0);
                CServerNetworkProperty::RecomputePVSInformation(this_00);
                cVar9 = CServerNetworkProperty::IsInPVS(this_00,param_1);
              } while (cVar9 == '\0');
              (**(code **)(*piVar8 + 0x5c))(piVar8,param_1,1);
LAB_006c6d6c:
              cVar9 = (**(code **)(*piVar8 + 0x16c))(piVar8);
              if (cVar9 != '\0') {
                local_28 = 0;
                if (piVar8[0xc] != 0) {
                  local_28 = piVar8[0xc] - *(int *)(gpGlobals + 0x58) >> 4;
                }
                CBasePlayer::SetPlayerInPVS(local_38,local_28,true);
              }
            }
            else {
                    /* try { // try from 006c6dd0 to 006c7051 has its CatchHandler @ 006c7057 */
              iVar17 = (**(code **)(*(int *)this_00 + 0x14))(this_00);
              iVar11 = *piVar8;
              if (iVar6 == iVar17) goto LAB_006c6eea;
              (**(code **)(iVar11 + 0x5c))(piVar8,param_1,0);
            }
            goto joined_r0x006c6e8b;
          }
          if ((local_4c < 1) || (fVar20 < (float)piVar8[0x1d] || fVar20 == (float)piVar8[0x1d])) {
LAB_006c6c5b:
            if ((piVar8[0x1e] & uVar7) == 0) goto LAB_006c6c6a;
          }
          else if ((uVar7 & piVar8[0x1e]) == 0) {
            local_4c = local_4c + -1;
            piVar8[0x1e] = piVar8[0x1e] | uVar7;
            CBasePlayer::OnEntitySteadyStateStart(local_38);
            goto LAB_006c6c5b;
          }
          iVar11 = *piVar8;
LAB_006c6eea:
          (**(code **)(iVar11 + 0x5c))(piVar8,param_1,1);
          param_2 = param_2 + 1;
        } while (param_2 != puVar1);
      }
LAB_006c6dbc:
                    /* WARNING: Could not recover jumptable at 0x006c6dce. Too many branches */
                    /* WARNING: Treating indirect jump as call */
      (**(code **)(*piVar5 + 0x6c))();
      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)