L L4D2node

CGameServer::AssignClassIds

0x00205ca0 · 247 bytes · __thiscall

_ZN11CGameServer14AssignClassIdsEv

Decompiled

undefined (1 param)

/* CGameServer::AssignClassIds() */

void __thiscall CGameServer::AssignClassIds(CGameServer *this)

{
  undefined4 *puVar1;
  undefined4 *puVar2;
  int iVar3;
  int *piVar4;
  int iVar5;
  uint uVar6;
  
  puVar1 = (undefined4 *)(**(code **)(*serverGameDLL + 0x28))(serverGameDLL);
  if (puVar1 == (undefined4 *)0x0) {
    *(undefined4 *)(this + 0xf8) = 0;
    iVar3 = Q_log2(0);
    *(int *)(this + 0xfc) = iVar3 + 1;
    piVar4 = (int *)CommandLine_Tier0();
    (**(code **)(*piVar4 + 0x28))(piVar4,"-netspike");
  }
  else {
    uVar6 = 0;
    puVar2 = puVar1;
    do {
      puVar2 = (undefined4 *)puVar2[2];
      uVar6 = uVar6 + 1;
    } while (puVar2 != (undefined4 *)0x0);
    if (0x200 < (int)uVar6) {
      Error("CGameServer::AssignClassIds: too many server classes (%i, MAX = %i).\n",uVar6,0x200);
    }
    *(uint *)(this + 0xf8) = uVar6;
    iVar3 = Q_log2(uVar6);
    *(int *)(this + 0xfc) = iVar3 + 1;
    piVar4 = (int *)CommandLine_Tier0();
    iVar5 = (**(code **)(*piVar4 + 0x28))(piVar4,"-netspike");
    iVar3 = 0;
    do {
      puVar1[3] = iVar3;
      if (iVar5 == 0) {
        puVar1 = (undefined4 *)puVar1[2];
      }
      else {
        Msg("%d == \'%s\'\n",iVar3,*puVar1);
        puVar1 = (undefined4 *)puVar1[2];
      }
      iVar3 = iVar3 + 1;
    } while (puVar1 != (undefined4 *)0x0);
  }
  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)