L L4D2node

CBaseServer::GetNumPlayers

0x00106ce0 · 149 bytes · __thiscall

_ZN11CBaseServer13GetNumPlayersEv

Decompiled

undefined (1 param)

/* CBaseServer::GetNumPlayers() */

int __thiscall CBaseServer::GetNumPlayers(CBaseServer *this)

{
  int iVar1;
  int iVar2;
  int *piVar3;
  int iVar4;
  int iVar5;
  
  piVar3 = *(int **)(this + 200);
  if (piVar3 == (int *)0x0) {
    piVar3 = *(int **)(this + 0xbc);
    if (piVar3 == (int *)0x0) {
      return 0;
    }
    piVar3 = (int *)(**(code **)(*piVar3 + 0x10))(piVar3,"userinfo");
    *(int **)(this + 200) = piVar3;
    if (piVar3 == (int *)0x0) {
      return 0;
    }
  }
  iVar1 = (**(code **)(*piVar3 + 0x10))(piVar3);
  if (iVar1 < 1) {
    return 0;
  }
  iVar5 = 0;
  iVar4 = 0;
  do {
    iVar2 = (**(code **)(**(int **)(this + 200) + 0x30))(*(int **)(this + 200),iVar5,0);
    if (iVar2 != 0) {
      iVar4 = iVar4 + (uint)(*(char *)(iVar2 + 0x74) == '\0');
    }
    iVar5 = iVar5 + 1;
  } while (iVar5 != iVar1);
  return iVar4;
}

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)