L L4D2node

CTeamplayRoundBasedRules::CheckWaitingForPlayers

0x004cb2b0 · 1465 bytes · __thiscall

_ZN24CTeamplayRoundBasedRules22CheckWaitingForPlayersEv

Decompiled

undefined (1 param)

/* CTeamplayRoundBasedRules::CheckWaitingForPlayers() */

void __thiscall CTeamplayRoundBasedRules::CheckWaitingForPlayers(CTeamplayRoundBasedRules *this)

{
  int *piVar1;
  uint uVar2;
  int iVar3;
  char cVar4;
  int *piVar5;
  uint *puVar6;
  int iVar7;
  undefined4 uVar8;
  undefined *puVar9;
  int iVar10;
  undefined *puVar11;
  float fVar12;
  int *local_40;
  int local_30 [3];
  undefined4 local_24;
  undefined4 local_20;
  
  cVar4 = CMultiplayRules::IsLoadingBugBaitReport();
  iVar7 = gpGlobals;
  puVar9 = g_pEntityList;
  if ((cVar4 == '\0') && (*(int *)(gpGlobals + 0x48) != 3)) {
    if (*(int *)(mp_waitingforplayers_restart._28_4_ + 0x30) != 0) {
      if (this[0x328] == (CTeamplayRoundBasedRules)0x0) {
        SetInWaitingForPlayers(this,true);
      }
      else {
        uVar2 = *(uint *)(this + 0x24c);
        fVar12 = *(float *)(mp_waitingforplayers_time._28_4_ + 0x2c) + *(float *)(gpGlobals + 0xc);
        *(float *)(this + 0x248) = fVar12;
        if ((((uVar2 != 0xffffffff) &&
             (puVar9 = puVar9 + (uVar2 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
            (*(uint *)(puVar9 + 8) == uVar2 >> 0xc)) &&
           (piVar5 = *(int **)(puVar9 + 4), piVar5 != (int *)0x0)) {
          local_30[0] = (int)(fVar12 - *(float *)(iVar7 + 0xc));
          local_24 = 0xffffffff;
          local_20 = 5;
          (**(code **)(*piVar5 + 0xb4))(piVar5,"SetTime",0,0,local_30,0);
        }
      }
      ConVar::SetValue(0xf7de60);
    }
    if ((*(int *)(mp_waitingforplayers_cancel._28_4_ + 0x30) != 0) &&
       (*(int *)(mp_tournament._28_4_ + 0x30) == 0)) {
      SetInWaitingForPlayers(this,false);
      ConVar::SetValue(0xf7de00);
    }
    if ((this[0x328] != (CTeamplayRoundBasedRules)0x0) &&
       (*(int *)(mp_tournament._28_4_ + 0x30) == 0)) {
      fVar12 = *(float *)(gpGlobals + 0xc);
      if ((fVar12 < *(float *)(this + 0x248) || fVar12 == *(float *)(this + 0x248)) ||
         ((0.0 <= *(float *)(this + 0x32c) || (this[0x329] != (CTeamplayRoundBasedRules)0x0)))) {
        uVar2 = *(uint *)(this + 0x24c);
        if ((uVar2 == 0xffffffff) ||
           (((puVar9 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc ||
             (*(uint *)(puVar9 + 8) != uVar2 >> 0xc)) || (*(int *)(puVar9 + 4) == 0)))) {
          HideActiveTimer(this);
          piVar5 = (int *)CBaseEntity::Create("team_round_timer",(Vector *)&vec3_origin,
                                              (QAngle *)&vec3_angle,(CBaseEntity *)0x0);
          if (piVar5 == (int *)0x0) {
            *(undefined4 *)(this + 0x24c) = 0xffffffff;
            iVar7 = 0;
            puVar9 = g_pEntityList;
          }
          else {
            puVar6 = (uint *)(**(code **)(*piVar5 + 0xc))(piVar5);
            puVar9 = g_pEntityList;
            uVar2 = *puVar6;
            *(uint *)(this + 0x24c) = uVar2;
            if (((uVar2 == 0xffffffff) ||
                (puVar11 = puVar9 + (uVar2 & 0xfff) * 0x10, puVar11 == (undefined *)0xfffffffc)) ||
               (*(uint *)(puVar11 + 8) != uVar2 >> 0xc)) {
              iVar7 = 0;
            }
            else {
              iVar7 = *(int *)(puVar11 + 4);
            }
          }
          *(char **)(iVar7 + 0x154) = "zz_teamplay_waiting_timer";
          piVar5 = (int *)0x0;
          uVar2 = *(uint *)(this + 0x24c);
          if (((uVar2 != 0xffffffff) &&
              (puVar9 = puVar9 + (uVar2 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
             (*(uint *)(puVar9 + 8) == uVar2 >> 0xc)) {
            piVar5 = *(int **)(puVar9 + 4);
          }
          (**(code **)(*piVar5 + 0x84))(piVar5,"show_in_hud",&DAT_00cbe2d5);
          piVar5 = (int *)0x0;
          uVar2 = *(uint *)(this + 0x24c);
          iVar7 = (int)(*(float *)(this + 0x248) - *(float *)(gpGlobals + 0xc));
          if (((uVar2 != 0xffffffff) &&
              (puVar9 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc))
             && (*(uint *)(puVar9 + 8) == uVar2 >> 0xc)) {
            piVar5 = *(int **)(puVar9 + 4);
          }
          local_24 = 0xffffffff;
          local_20 = 5;
          local_30[0] = iVar7;
          (**(code **)(*piVar5 + 0xb4))(piVar5,"SetTime",0,0,local_30,0);
          uVar2 = *(uint *)(this + 0x24c);
          local_40 = (int *)0x0;
          if (((uVar2 != 0xffffffff) &&
              (puVar9 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc))
             && (*(uint *)(puVar9 + 8) == uVar2 >> 0xc)) {
            local_40 = *(int **)(puVar9 + 4);
          }
          local_24 = 0xffffffff;
          local_20 = 5;
          local_30[0] = iVar7;
          (**(code **)(*local_40 + 0xb4))(local_40,"Resume",0,0,local_30,0);
          uVar2 = *(uint *)(this + 0x24c);
          piVar5 = (int *)0x0;
          if (((uVar2 != 0xffffffff) &&
              (puVar9 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc))
             && (*(uint *)(puVar9 + 8) == uVar2 >> 0xc)) {
            piVar5 = *(int **)(puVar9 + 4);
          }
          local_24 = 0xffffffff;
          local_20 = 5;
          local_30[0] = iVar7;
          (**(code **)(*piVar5 + 0xb4))(piVar5,"Enable",0,0,local_30,0);
        }
      }
      else {
        if (fVar12 != *(float *)(this + 0x32c)) {
          CGameRulesProxy::NotifyNetworkStateChanged();
          *(float *)(this + 0x32c) = fVar12;
        }
        cVar4 = (**(code **)(*(int *)this + 0x29c))(this);
        if (cVar4 == '\0') {
          if (((((DAT_00f9ebe8 != 0) && (uVar2 = *g_hControlPointMasters, uVar2 != 0xffffffff)) &&
               (puVar9 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc))
              && ((*(uint *)(puVar9 + 8) == uVar2 >> 0xc &&
                  (iVar7 = *(int *)(puVar9 + 4), iVar7 != 0)))) &&
             ((0 < *(int *)(iVar7 + 0x46c) && (*(int *)(iVar7 + 0x474) != -1)))) {
            piVar5 = *(int **)(iVar7 + 0x460);
            iVar3 = piVar5[*(int *)(iVar7 + 0x474)];
            if (iVar3 != 0) {
              iVar10 = -1;
              piVar1 = piVar5 + *(int *)(iVar7 + 0x46c);
              do {
                if ((*piVar5 != 0) && (iVar7 = *(int *)(*piVar5 + 0x45c), iVar10 < iVar7)) {
                  iVar10 = iVar7;
                }
                piVar5 = piVar5 + 1;
              } while (piVar5 != piVar1);
              uVar8 = 0;
              if (*(int *)(iVar3 + 0x45c) == iVar10) {
                uVar8 = *(undefined4 *)(iVar3 + 0x154);
              }
              *(undefined4 *)(this + 0x26c) = uVar8;
            }
          }
        }
        else if (*(float *)(this + 0x248) <= *(float *)(gpGlobals + 0xc) &&
                 *(float *)(gpGlobals + 0xc) != *(float *)(this + 0x248)) {
          SetInWaitingForPlayers(this,false);
          State_Leave(this);
          State_Enter(this,3);
        }
      }
    }
  }
  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)