L L4D2node

CServerPlugin::ClientConnect

0x00208480 · 321 bytes · __thiscall

_ZN13CServerPlugin13ClientConnectEP7edict_tPKcS3_Pci

Decompiled

undefined (6 params)

/* CServerPlugin::ClientConnect(edict_t*, char const*, char const*, char*, int) */

uint __thiscall
CServerPlugin::ClientConnect
          (CServerPlugin *this,edict_t *param_1,char *param_2,char *param_3,char *param_4,
          int param_5)

{
  int *piVar1;
  bool bVar2;
  int iVar3;
  uint uVar4;
  uint uVar5;
  int iVar6;
  byte local_2e;
  byte local_1d [13];
  
  local_1d[0] = 1;
  if (*(int *)(this + 0x10) < 1) {
    uVar5 = (**(code **)(*serverGameClients + 4))
                      (serverGameClients,param_1,param_2,param_3,param_4,param_5);
  }
  else {
    bVar2 = false;
    iVar6 = 0;
    local_2e = 1;
    do {
      iVar3 = *(int *)(*(int *)(this + 4) + iVar6 * 4);
      if (*(char *)(iVar3 + 0x100) == '\0') {
        piVar1 = *(int **)(iVar3 + 0x104);
        if (piVar1 == (int *)0x0) {
          Warning("Unable to get callback interface for \"%s\"\n",iVar3);
        }
        iVar3 = (**(code **)(*piVar1 + 0x38))
                          (piVar1,local_1d,param_1,param_2,param_3,param_4,param_5);
        if (iVar3 == 2) {
          return (uint)local_1d[0];
        }
        if ((iVar3 == 1) && (!bVar2)) {
          bVar2 = true;
          local_2e = local_1d[0];
        }
      }
      iVar6 = iVar6 + 1;
    } while (iVar6 < *(int *)(this + 0x10));
    uVar4 = (**(code **)(*serverGameClients + 4))
                      (serverGameClients,param_1,param_2,param_3,param_4,param_5);
    uVar5 = (uint)local_2e;
    if (!bVar2) {
      uVar5 = uVar4;
    }
  }
  return uVar5;
}

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)