L L4D2node

CDirector::OnServerShutdown

0x00873570 · 456 bytes · __thiscall

_ZN9CDirector16OnServerShutdownEv

Decompiled

undefined (1 param)

/* CDirector::OnServerShutdown() */

void __thiscall CDirector::OnServerShutdown(CDirector *this)

{
  int *piVar1;
  char cVar2;
  KeyValues *this_00;
  char *pcVar3;
  IBaseFileSystem *pIVar4;
  char *pcVar5;
  longdouble lVar6;
  CDirector *pCVar7;
  
  (**(code **)**(undefined4 **)(this + 0x634))(*(undefined4 **)(this + 0x634));
  ResetTransitionedEntities();
  ResetTransitionedSurvivors();
  this[0x28e] = (CDirector)0x0;
  pCVar7 = (CDirector *)0x1;
  m_isTransitioning = 0;
  m_isScenarioRestart = 0;
  ClearTeamScores(this,true);
  (**(code **)(*(int *)this + 0x14))(this);
  *(undefined4 *)(this + 0x3b0) = 0;
  lVar6 = (longdouble)IntervalTimer::Now();
  if ((float)lVar6 != *(float *)(this + 0x3ac)) {
    pCVar7 = this + 0x3ac;
    (**(code **)(*(int *)(this + 0x3a8) + 4))(this + 0x3a8);
    *(float *)(this + 0x3ac) = (float)lVar6;
  }
  piVar1 = engine;
  *(undefined4 *)(this + 0x390) = 0;
  *(undefined4 *)(this + 0x38c) = 0;
  *(undefined4 *)(this + 0x394) = 0;
  this[0x3b4] = (CDirector)0x0;
  cVar2 = (**(code **)(*piVar1 + 8))(piVar1);
  if (cVar2 == '\0') {
    this_00 = KeyValues::operator_new((KeyValues *)0x2c,(uint)pCVar7);
                    /* try { // try from 00873679 to 0087367d has its CatchHandler @ 00873747 */
    KeyValues::KeyValues(this_00,"ServerConfig",(IKeyValuesSystem *)0x0,false);
    if (this_00 != (KeyValues *)0x0) {
      pIVar4 = (IBaseFileSystem *)0x0;
      if (filesystem != 0) {
        pIVar4 = (IBaseFileSystem *)(filesystem + 4);
      }
      KeyValues::LoadFromFile(this_00,pIVar4,"ServerConfig.vdf","MOD");
      pcVar5 = "FCVAR_NEVER_AS_STRING";
      if ((ZombieDifficulty[0x15] & 0x10) == 0) {
        pcVar5 = "";
        if (*(char **)(ZombieDifficulty._28_4_ + 0x24) != (char *)0x0) {
          pcVar5 = *(char **)(ZombieDifficulty._28_4_ + 0x24);
        }
      }
      pcVar3 = (char *)ConVar::GetName((ConVar *)ZombieDifficulty);
      KeyValues::SetString(this_00,pcVar3,pcVar5);
      pIVar4 = (IBaseFileSystem *)0x0;
      if (filesystem != 0) {
        pIVar4 = (IBaseFileSystem *)(filesystem + 4);
      }
      KeyValues::SaveToFile(this_00,pIVar4,"ServerConfig.vdf","MOD");
      KeyValues::deleteThis();
    }
                    /* WARNING: Could not recover jumptable at 0x00873725. Too many branches */
                    /* WARNING: Treating indirect jump as call */
    (**(code **)(**(int **)(this + 0x630) + 8))();
    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)