L L4D2node

CHLTVServer::GetRelayStats

0x00170a70 · 205 bytes · __thiscall

_ZN11CHLTVServer13GetRelayStatsERiS0_S0_

Decompiled

undefined (4 params)

/* CHLTVServer::GetRelayStats(int&, int&, int&) */

void __thiscall CHLTVServer::GetRelayStats(CHLTVServer *this,int *param_1,int *param_2,int *param_3)

{
  int *piVar1;
  char cVar2;
  int iVar3;
  char *pcVar4;
  int iVar5;
  
  iVar5 = 0;
  *param_3 = 0;
  *param_2 = 0;
  *param_1 = 0;
  while( true ) {
    iVar3 = (**(code **)(*(int *)(this + 4) + 0x20))(this + 4);
    if (iVar3 <= iVar5) break;
    piVar1 = *(int **)(*(int *)(this + 0x118) + iVar5 * 4);
    cVar2 = (**(code **)(*piVar1 + 0x6c))(piVar1);
    if (cVar2 != '\0') {
      cVar2 = (**(code **)(*piVar1 + 0x7c))(piVar1);
      if (cVar2 != '\0') {
        pcVar4 = (char *)(**(code **)(*piVar1 + 0x28))(piVar1,"hltv_proxies");
        iVar3 = V_atoi(pcVar4);
        *param_1 = *param_1 + iVar3;
        pcVar4 = (char *)(**(code **)(*piVar1 + 0x28))(piVar1,"hltv_slots");
        iVar3 = V_atoi(pcVar4);
        *param_2 = *param_2 + iVar3;
        pcVar4 = (char *)(**(code **)(*piVar1 + 0x28))(piVar1,"hltv_clients");
        iVar3 = V_atoi(pcVar4);
        *param_3 = *param_3 + iVar3;
      }
    }
    iVar5 = iVar5 + 1;
  }
  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)