L L4D2node

CTerrorGameRules::ClientConnected

0x00502750 · 221 bytes · __thiscall

_ZN16CTerrorGameRules15ClientConnectedEP7edict_tPKcS3_Pci

Decompiled

undefined (6 params)

/* CTerrorGameRules::ClientConnected(edict_t*, char const*, char const*, char*, int) */

undefined4 __thiscall
CTerrorGameRules::ClientConnected
          (CTerrorGameRules *this,edict_t *param_1,char *param_2,char *param_3,char *param_4,
          int param_5)

{
  char cVar1;
  int *piVar2;
  undefined4 uVar3;
  int iVar4;
  int iVar5;
  
  if (*(int *)(gpGlobals + 0x14) < 1) {
    iVar4 = 0;
  }
  else {
    iVar5 = 1;
    iVar4 = 0;
    do {
      piVar2 = (int *)UTIL_PlayerByIndex(iVar5);
      if (piVar2 != (int *)0x0) {
        cVar1 = (**(code **)(*piVar2 + 0x778))(piVar2);
        iVar4 = iVar4 + (uint)(cVar1 == '\0');
      }
      iVar5 = iVar5 + 1;
    } while (iVar5 <= *(int *)(gpGlobals + 0x14));
  }
  iVar5 = (**(code **)(*(int *)this + 0x224))(this);
  if (iVar4 < iVar5) {
    uVar3 = CMultiplayRules::ClientConnected
                      ((edict_t *)this,(char *)param_1,param_2,param_3,(int)param_4);
    return uVar3;
  }
  V_snprintf(param_4,param_5,"Human player limit reached (%d/%d)",iVar4,iVar5);
  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)