L L4D2node

CBaseServer::GetMasterServerPlayerCounts

0x00109fc0 · 83 bytes · __thiscall

_ZN11CBaseServer27GetMasterServerPlayerCountsERiS0_S0_

Decompiled

undefined (4 params)

/* CBaseServer::GetMasterServerPlayerCounts(int&, int&, int&) */

void __thiscall
CBaseServer::GetMasterServerPlayerCounts(CBaseServer *this,int *param_1,int *param_2,int *param_3)

{
  int iVar1;
  
  iVar1 = GetNumHumanPlayers(this);
  *param_1 = iVar1;
  iVar1 = GetMaxHumanPlayers(this);
  *param_2 = iVar1;
  iVar1 = GetNumFakeClients((CBaseServer *)&sv);
  *param_3 = iVar1;
  if (0 < *(int *)(sv_visiblemaxplayers._28_4_ + 0x30)) {
    *param_2 = *(int *)(sv_visiblemaxplayers._28_4_ + 0x30);
  }
  *param_3 = 0;
  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)