L L4D2node

CServerGameDLL::ServerHibernationUpdate

0x006cb170 · 382 bytes · __thiscall

_ZN14CServerGameDLL23ServerHibernationUpdateEb

Decompiled

undefined (2 params)

/* CServerGameDLL::ServerHibernationUpdate(bool) */

void __thiscall CServerGameDLL::ServerHibernationUpdate(CServerGameDLL *this,bool param_1)

{
  char cVar1;
  char *pcVar2;
  int iVar3;
  KeyValues *this_00;
  char *pcVar4;
  undefined4 local_2c;
  undefined4 local_28;
  undefined1 local_24;
  int local_20;
  undefined4 local_1c;
  undefined4 local_18;
  undefined1 local_14;
  int local_10;
  
  this[0xc] = (CServerGameDLL)param_1;
  if (((param_1) && (TheDirector != (CDirector *)0x0)) && (g_pGameRules != 0)) {
    cVar1 = (**(code **)(*engine + 8))(engine);
    if ((cVar1 != '\0') && (this[0xc] != (CServerGameDLL)0x0)) {
      local_28 = 2;
      local_24 = 0;
      local_20 = 0;
      local_2c = 0xffffffff;
      ForEachPlayer<PlayerCounter>((PlayerCounter *)&local_2c);
      local_18 = 3;
      local_14 = 0;
      local_10 = 0;
      local_1c = 0xffffffff;
      ForEachPlayer<PlayerCounter>((PlayerCounter *)&local_1c);
      if ((local_20 == 0) && (local_10 == 0)) {
        pcVar4 = *(char **)(gpGlobals + 0x3c);
        pcVar2 = "FCVAR_NEVER_AS_STRING";
        if (pcVar4 == (char *)0x0) {
          pcVar4 = "";
        }
        if (((mp_gamemode[0x15] & 0x10) == 0) &&
           (pcVar2 = *(char **)(mp_gamemode._28_4_ + 0x24), pcVar2 == (char *)0x0)) {
          pcVar2 = "";
        }
        iVar3 = StringAfterPrefix(pcVar2,"team");
        if (iVar3 != 0) {
          ConVar::SetValue(mp_gamemode);
        }
        cVar1 = CTerrorGameRules::IsSingleChapterMode();
        if (cVar1 == '\0') {
          this_00 = (KeyValues *)CTerrorGameRules::GetMissionFirstMap((KeyValues **)0x0);
          if (this_00 != (KeyValues *)0x0) {
            pcVar4 = (char *)KeyValues::GetString(this_00,"map",pcVar4);
          }
        }
        CDirector::RestartScenarioFromVote(TheDirector,pcVar4);
        CDirector::Restart(TheDirector);
        CDirector::PlayerAvatarResetAll(TheDirector);
        CDirectorSessionManager::Reset(*(CDirectorSessionManager **)(TheDirector + 0x634));
      }
    }
  }
  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)