L L4D2node

CBaseServer::CheckMasterServerRequestRestart

0x001090b0 · 235 bytes · __thiscall

_ZN11CBaseServer31CheckMasterServerRequestRestartEv

Decompiled

undefined (1 param)

/* CBaseServer::CheckMasterServerRequestRestart() */

void __thiscall CBaseServer::CheckMasterServerRequestRestart(CBaseServer *this)

{
  char cVar1;
  int iVar2;
  int *piVar3;
  
  iVar2 = Steam3Server();
  if (*(int *)(iVar2 + 4) != 0) {
    iVar2 = Steam3Server();
    cVar1 = (**(code **)(**(int **)(iVar2 + 4) + 0x2c))(*(int **)(iVar2 + 4));
    if (cVar1 != '\0') {
      Msg("%cMasterRequestRestart\n",3);
      piVar3 = (int *)CommandLine_Tier0();
      iVar2 = (**(code **)(*piVar3 + 0x28))(piVar3,"-autoupdate");
      if (iVar2 != 0) {
        Msg("Your server will be restarted on map change.\n");
        cVar1 = LoggingSystem_IsChannelEnabled(LOG_ServerLog,0);
        if (cVar1 != '\0') {
          LoggingSystem_Log(LOG_ServerLog,0,"Your server will be restarted on map change.\n");
        }
        this[0x14c] = (CBaseServer)0x1;
        return;
      }
      Msg("Your server needs to be restarted in order to receive the latest update.\n");
      cVar1 = LoggingSystem_IsChannelEnabled(LOG_ServerLog,0);
      if (cVar1 != '\0') {
        LoggingSystem_Log(LOG_ServerLog,0,
                          "Your server needs to be restarted in order to receive the latest update.\n"
                         );
        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)