L L4D2node

CGameServer::UpdateHibernationState

0x001fdc40 · 460 bytes · __thiscall

_ZN11CGameServer22UpdateHibernationStateEv

Decompiled

undefined (1 param)

/* WARNING: Removing unreachable block (ram,0x001fddb2) */
/* CGameServer::UpdateHibernationState() */

void __thiscall CGameServer::UpdateHibernationState(CGameServer *this)

{
  int *piVar1;
  byte bVar2;
  char cVar3;
  bool bVar4;
  int iVar5;
  longdouble lVar6;
  double dVar7;
  
  cVar3 = (**(code **)(*(int *)this + 0x60))(this);
  if (cVar3 == '\0') {
    return;
  }
  if (0 < *(int *)(this + 0x120)) {
    iVar5 = 0;
    do {
      piVar1 = *(int **)(*(int *)(this + 0x114) + iVar5 * 4);
      cVar3 = (**(code **)(*piVar1 + 0x6c))(piVar1);
      if ((cVar3 != '\0') &&
         ((cVar3 = (**(code **)(*piVar1 + 0x94))(piVar1), cVar3 != '\0' ||
          (cVar3 = (**(code **)(*piVar1 + 0x78))(piVar1), cVar3 == '\0')))) {
        bVar2 = 1;
        *(undefined4 *)(this + 0x178) = 0xbf800000;
        goto LAB_001fdd58;
      }
      iVar5 = iVar5 + 1;
    } while (iVar5 < *(int *)(this + 0x120));
  }
  if (*(int *)(this + 0x170) != 0 || *(int *)(this + 0x16c) != 0) {
    if (*(float *)(this + 0x178) == -1.0) {
      lVar6 = (longdouble)Plat_FloatTime();
      *(float *)(this + 0x178) = (float)lVar6;
    }
    lVar6 = (longdouble)Plat_FloatTime();
    bVar2 = 0;
    if ((*(int *)(this + 0x170) == 0 && *(int *)(this + 0x16c) == 0) ||
       (bVar2 = 0,
       (float)lVar6 - *(float *)(this + 0x178) <
       *(float *)(sv_hibernate_postgame_delay._28_4_ + 0x2c) ||
       (float)lVar6 - *(float *)(this + 0x178) ==
       *(float *)(sv_hibernate_postgame_delay._28_4_ + 0x2c))) goto LAB_001fdd58;
    if (*(float *)(this + 0x174) == 0.0) {
      dVar7 = 0.0;
    }
    else {
      dVar7 = (double)*(float *)(this + 0x174);
      if (net_time <= dVar7) goto LAB_001fdd58;
    }
    CBaseServer::SetReservationCookie
              (ZEXT48(this),(char *)0x0,"reserved(%s), clients(%s), reservationexpires(%.2f)",
               &DAT_002b6517,&DAT_0029fe20,dVar7);
  }
  bVar2 = 0;
LAB_001fdd58:
  bVar4 = false;
  if ((*(int *)(sv_hibernate_when_empty._28_4_ + 0x30) != 0) &&
     (bVar4 = false, *(int *)(this + 0x170) == 0 && *(int *)(this + 0x16c) == 0)) {
    bVar4 = (bool)(bVar2 ^ 1);
  }
  SetHibernating(this,bVar4);
  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)