L L4D2node

CServerRemoteAccess::GetPlayerList

0x0020da80 · 625 bytes · __thiscall

_ZN19CServerRemoteAccess13GetPlayerListER10CUtlBuffer

Decompiled

undefined (2 params)

/* CServerRemoteAccess::GetPlayerList(CUtlBuffer&) */

void __thiscall CServerRemoteAccess::GetPlayerList(CServerRemoteAccess *this,CUtlBuffer *param_1)

{
  int *piVar1;
  undefined4 uVar2;
  char cVar3;
  int iVar4;
  int *piVar5;
  undefined4 uVar6;
  undefined4 uVar7;
  undefined4 uVar8;
  int iVar9;
  longdouble lVar10;
  longdouble lVar11;
  longdouble lVar12;
  
  if (serverGameClients != (int *)0x0) {
    iVar9 = 0;
    if (0 < DAT_003b8080) {
      do {
        while (((piVar1 = *(int **)(DAT_003b8074 + iVar9 * 4), piVar1 == (int *)0x0 ||
                (cVar3 = (**(code **)(*piVar1 + 0x74))(piVar1), cVar3 == '\0')) ||
               (iVar4 = (**(code **)(*serverGameClients + 0x2c))(serverGameClients,piVar1[0x75d4]),
               iVar4 == 0))) {
LAB_0020daf0:
          iVar9 = iVar9 + 1;
          if (DAT_003b8080 <= iVar9) goto LAB_0020dc43;
        }
        cVar3 = (**(code **)(*piVar1 + 0x78))(piVar1);
        if (cVar3 != '\0') {
          uVar2 = *(undefined4 *)(iVar4 + 0x2c);
          uVar6 = (**(code **)(*piVar1 + 0x2c))(piVar1);
          uVar7 = (**(code **)(*piVar1 + 0x1c))(piVar1);
          CUtlBuffer::Printf(param_1,"\"%s\" %s 0 0 0 %d 0\n",uVar7,uVar6,uVar2);
          goto LAB_0020daf0;
        }
        iVar9 = iVar9 + 1;
        piVar5 = (int *)(**(code **)(*piVar1 + 0x20))(piVar1);
        lVar10 = (longdouble)(**(code **)(*piVar5 + 0xc))(piVar5);
        uVar2 = *(undefined4 *)(iVar4 + 0x2c);
        piVar5 = (int *)(**(code **)(*piVar1 + 0x20))(piVar1);
        lVar11 = (longdouble)(**(code **)(*piVar5 + 0x2c))(piVar5,1);
        piVar5 = (int *)(**(code **)(*piVar1 + 0x20))(piVar1);
        lVar12 = (longdouble)(**(code **)(*piVar5 + 0x28))(piVar5,0);
        piVar5 = (int *)(**(code **)(*piVar1 + 0x20))(piVar1);
        uVar6 = (**(code **)(*piVar5 + 4))(piVar5);
        uVar7 = (**(code **)(*piVar1 + 0x2c))(piVar1);
        uVar8 = (**(code **)(*piVar1 + 0x1c))(piVar1);
        CUtlBuffer::Printf(param_1,"\"%s\" %s %s %d %d %d %d\n",uVar8,uVar7,uVar6,
                           (int)((float)lVar12 * 1000.0),(int)lVar11,uVar2,(int)lVar10);
      } while (iVar9 < DAT_003b8080);
    }
LAB_0020dc43:
    if (((((byte)param_1[0x15] & 1) != 0) && (*(int *)(param_1 + 0x10) != 0)) &&
       (*(char *)(*(int *)param_1 + ((*(int *)(param_1 + 0x10) + -1) - *(int *)(param_1 + 0x20))) ==
        '\n')) {
      iVar9 = 0;
      if (((byte)param_1[0x15] & 0x10) == 0) {
        iVar9 = *(int *)(param_1 + 0x18);
      }
      while (iVar9 = iVar9 + -1, -1 < iVar9) {
        while (cVar3 = CUtlBuffer::CheckPut(param_1,1), cVar3 != '\0') {
          *(undefined1 *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))) =
               9;
          *(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + 1;
          CUtlBuffer::AddNullTermination(param_1);
          iVar9 = iVar9 + -1;
          if (iVar9 < 0) goto LAB_0020dcb0;
        }
      }
    }
LAB_0020dcb0:
    cVar3 = CUtlBuffer::CheckPut(param_1,1);
    if (cVar3 != '\0') {
      *(undefined1 *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))) = 0;
      *(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + 1;
      CUtlBuffer::AddNullTermination(param_1);
      return;
    }
  }
  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)