L L4D2node

CMaster::RebuildPlayers

0x00204170 · 508 bytes · __thiscall

_ZN7CMaster14RebuildPlayersEP11CGameServer

Decompiled

undefined (2 params)

/* CMaster::RebuildPlayers(CGameServer*) */

void __thiscall CMaster::RebuildPlayers(CMaster *this,CGameServer *param_1)

{
  char cVar1;
  bf_write *this_00;
  int iVar2;
  char *pcVar3;
  int *piVar4;
  int iVar5;
  uint uVar6;
  CGameClient *local_34;
  int local_30 [8];
  
  *(undefined4 *)(this + 0x9c0) = realtime;
  this_00 = (bf_write *)(this + 0xe74);
  bf_write::Reset(this_00);
  bf_write::WriteLong(this_00,-1);
  bf_write::WriteByte(this_00,0x44);
  local_30[0] = 0;
  local_30[1] = 0;
  local_30[2] = 0;
  local_30[3] = 0;
  local_30[4] = 0;
                    /* try { // try from 002041f8 to 00204378 has its CatchHandler @ 0020437e */
  for (iVar5 = 0; iVar2 = (**(code **)(*(int *)param_1 + 0x20))(param_1), iVar5 < iVar2;
      iVar5 = iVar5 + 1) {
    local_34 = *(CGameClient **)(*(int *)(param_1 + 0x114) + iVar5 * 4);
    cVar1 = (**(code **)(*(int *)local_34 + 0x6c))(local_34);
    if (((cVar1 != '\0') &&
        (cVar1 = (**(code **)(*(int *)local_34 + 0x80))(local_34), cVar1 != '\0')) &&
       (iVar2 = (**(code **)(*serverGameClients + 0x2c))
                          (serverGameClients,*(int *)(local_34 + 0x1d750)), iVar2 != 0)) {
      CUtlVector<CGameClient*,CUtlMemory<CGameClient*,int>>::InsertBefore
                ((CUtlVector<CGameClient*,CUtlMemory<CGameClient*,int>> *)local_30,local_30[3],
                 &local_34);
    }
  }
  bf_write::WriteByte(this_00,local_30[3]);
  if (0 < local_30[3]) {
    uVar6 = 0;
    do {
      while( true ) {
        piVar4 = *(int **)(local_30[0] + uVar6 * 4);
        iVar5 = (**(code **)(*serverGameClients + 0x2c))(serverGameClients,piVar4[0x75d4]);
        if (iVar5 != 0) break;
LAB_00204288:
        uVar6 = uVar6 + 1;
        if (local_30[3] <= (int)uVar6) goto LAB_00204320;
      }
      bf_write::WriteByte(this_00,uVar6);
      pcVar3 = (char *)(**(code **)(*piVar4 + 0x1c))(piVar4);
      bf_write::WriteString(this_00,pcVar3);
      bf_write::WriteLong(this_00,*(long *)(iVar5 + 0x2c));
      cVar1 = (**(code **)(*piVar4 + 0x78))(piVar4);
      if (cVar1 == '\0') {
        piVar4 = (int *)(**(code **)(*piVar4 + 0x20))(piVar4);
        (**(code **)(*piVar4 + 0xc))(piVar4);
        bf_write::WriteFloat((float)this_00);
        goto LAB_00204288;
      }
      bf_write::WriteFloat((float)this_00);
      uVar6 = uVar6 + 1;
    } while ((int)uVar6 < local_30[3]);
  }
LAB_00204320:
  local_30[3] = 0;
  CUtlMemory<CGameClient*,int>::Purge((CUtlMemory<CGameClient*,int> *)local_30);
  local_30[4] = local_30[0];
  CUtlMemory<CGameClient*,int>::Purge((CUtlMemory<CGameClient*,int> *)local_30);
  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)