L L4D2node

CNetChan::DumpSocketProcessingStats

0x001b58f0 · 816 bytes · __thiscall

_ZN8CNetChan25DumpSocketProcessingStatsEPKc

Decompiled

undefined (2 params)

/* CNetChan::DumpSocketProcessingStats(char const*) */

void __thiscall CNetChan::DumpSocketProcessingStats(CNetChan *this,char *param_1)

{
  double *pdVar1;
  double dVar2;
  undefined4 uVar3;
  int iVar4;
  int iVar5;
  
  if ((*(int *)(net_chan_stats_dump._28_4_ + 0x30) != 0) && (*(int *)(this + 0x4294) != 0)) {
    uVar3 = netadr_s::ToString((netadr_s *)(this + 0x98),false);
    Msg("Channel %d processing stats for %s (%s)\n",*(undefined4 *)(this + 0x8c),uVar3,param_1);
    Msg("   Lifetime: %.3f\n",net_time - *(double *)(this + 0x4284));
    Msg("   Packets:  %u pkts\n",*(undefined4 *)(this + 0x4294));
    Msg("   Messages: %u msgs\n",*(undefined4 *)(this + 0x42a0));
    Msg("   Traffic:  %u bytes\n",*(undefined4 *)(this + 0x42a4));
    Msg("   CPU cost: %llu usec\n",*(undefined4 *)(this + 0x4298),*(undefined4 *)(this + 0x429c));
    Msg("   Avg rate: %.3f bytes/sec\n",
        ((double)(*(int *)(this + 0x42a4) + -0x80000000) + 2147483648.0) /
        ((net_time + 1.0) - *(double *)(this + 0x4284)));
    dVar2 = (double)*(longlong *)(this + 0x4298);
    if (*(int *)(this + 0x429c) < 0) {
      dVar2 = dVar2 + 1.8446744073709552e+19;
    }
    Msg("   Avg CPU:  %.3f usec/sec\n",dVar2 / ((net_time + 1.0) - *(double *)(this + 0x4284)));
    MapPerMessageProcessingStats_t::DumpSocketProcessingStats
              ((double)CONCAT44(SUB84(net_time - *(double *)(this + 0x4284),0),this + 0x42a8));
    if (0 < *(int *)(this + 17000)) {
      iVar5 = 0;
      do {
        pdVar1 = *(double **)(*(int *)(this + 0x425c) + iVar5 * 4);
        iVar4 = iVar5 + 1;
        Msg("Frame-%u (-%.3f sec):\n",iVar5,net_time - *pdVar1);
        Msg("   Packets:  %u pkts\n",*(undefined4 *)(pdVar1 + 2));
        Msg("   Messages: %u msgs\n",*(undefined4 *)((int)pdVar1 + 0x1c));
        Msg("   Traffic:  %u bytes\n",*(undefined4 *)(pdVar1 + 4));
        Msg("   CPU cost: %llu usec\n",*(undefined4 *)((int)pdVar1 + 0x14),
            *(undefined4 *)(pdVar1 + 3));
        MapPerMessageProcessingStats_t::DumpSocketProcessingStats
                  ((double)(ulonglong)((int)pdVar1 + 0x24));
        iVar5 = iVar4;
      } while (iVar4 < *(int *)(this + 17000));
    }
    if (0 < *(int *)(this + 0x427c)) {
      iVar5 = 0;
      do {
        pdVar1 = *(double **)(*(int *)(this + 0x4270) + iVar5 * 4);
        iVar4 = iVar5 + 1;
        Msg("PeakFrame-%u (-%.3f sec):\n",iVar5,net_time - *pdVar1);
        Msg("   Packets:  %u pkts\n",*(undefined4 *)(pdVar1 + 2));
        Msg("   Messages: %u msgs\n",*(undefined4 *)((int)pdVar1 + 0x1c));
        Msg("   Traffic:  %u bytes\n",*(undefined4 *)(pdVar1 + 4));
        Msg("   CPU cost: %llu usec\n",*(undefined4 *)((int)pdVar1 + 0x14),
            *(undefined4 *)(pdVar1 + 3));
        MapPerMessageProcessingStats_t::DumpSocketProcessingStats
                  ((double)(ulonglong)((int)pdVar1 + 0x24));
        iVar5 = iVar4;
      } while (iVar4 < *(int *)(this + 0x427c));
      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)