L L4D2node

CBaseClientState::LinkClasses

0x00101c60 · 297 bytes · __thiscall

_ZN16CBaseClientState11LinkClassesEv

Decompiled

undefined (1 param)

/* CBaseClientState::LinkClasses() */

undefined4 __thiscall CBaseClientState::LinkClasses(CBaseClientState *this)

{
  char *pcVar1;
  char *pcVar2;
  int iVar3;
  int iVar4;
  int *piVar5;
  
  if (*(int *)(this + 0x41c8) < 1) {
    return 1;
  }
  iVar4 = *(int *)(this + 0x41c4);
  iVar3 = 0;
  if (*(int *)(iVar4 + 8) == 0) {
    iVar3 = 0;
  }
  else {
    do {
      iVar3 = iVar3 + 1;
      if (iVar3 == *(int *)(this + 0x41c8)) {
        iVar3 = 0;
        do {
          piVar5 = (int *)(iVar3 * 0x10 + iVar4);
          iVar4 = FindClientClass((char *)piVar5[1]);
          *piVar5 = iVar4;
          if (iVar4 == 0) {
            Msg("Client missing DT class %s\n",piVar5[1]);
            if (*(int *)(this + 0x41c8) <= iVar3 + 1) {
              return 1;
            }
          }
          else {
            pcVar1 = (char *)piVar5[2];
            pcVar2 = *(char **)(*(int *)(iVar4 + 0xc) + 0xc);
            iVar4 = _V_stricmp(pcVar1,pcVar2);
            if (iVar4 != 0) {
              Host_EndGame(true,
                           "CL_ParseClassInfo_EndClasses: server and client classes for \'%s\' use different datatables (server: %s, client: %s)"
                           ,piVar5[1],pcVar1,pcVar2);
              return 0;
            }
            *(int *)(*piVar5 + 0x14) = iVar3;
            if (*(int *)(this + 0x41c8) <= iVar3 + 1) {
              return 1;
            }
          }
          iVar3 = iVar3 + 1;
          iVar4 = *(int *)(this + 0x41c4);
        } while( true );
      }
    } while (*(int *)(iVar4 + 8 + iVar3 * 0x10) != 0);
  }
  Host_EndGame(true,"CL_ParseClassInfo_EndClasses: class %d not initialized.\n",iVar3);
  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)