L L4D2node

CDirector::IsSinglePlayerGame

0x00870f40 · 94 bytes · __cdecl

_ZN9CDirector18IsSinglePlayerGameEv

Decompiled

undefined (0 params)

/* CDirector::IsSinglePlayerGame() */

undefined4 CDirector::IsSinglePlayerGame(void)

{
  int *piVar1;
  KeyValues *this;
  char *pcVar2;
  int iVar3;
  
  piVar1 = (int *)(**(code **)(*g_pMatchFramework + 0x24))(g_pMatchFramework);
  if (piVar1 != (int *)0x0) {
    this = (KeyValues *)(**(code **)(*piVar1 + 4))(piVar1);
    if (this != (KeyValues *)0x0) {
      pcVar2 = (char *)KeyValues::GetString(this,"System/network","");
      if (pcVar2 != (char *)0x0) {
        iVar3 = _V_stricmp(pcVar2,"offline");
        if (iVar3 == 0) {
          return 1;
        }
      }
    }
  }
  return 0;
}

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)