L L4D2node

CBaseClient::EndTrace

0x000fa6e0 · 618 bytes · __cdecl

_ZN11CBaseClient8EndTraceER8bf_write

Decompiled

undefined (1 param)

/* CBaseClient::EndTrace(bf_write&) */

void CBaseClient::EndTrace(bf_write *param_1)

{
  CNetChan *pCVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  int *piVar5;
  undefined4 uVar6;
  undefined4 uVar7;
  undefined4 uVar8;
  int iVar9;
  double dVar10;
  char *local_54 [3];
  undefined4 local_48;
  int local_44;
  undefined1 local_40;
  undefined4 local_38;
  undefined4 local_34;
  
  if (*(int *)(param_1 + 0x1d6e4) != 0) {
    iVar9 = *(int *)(param_1 + 0x1d6ec) - *(int *)(param_1 + 0x1d6e8);
    if (*(int *)(param_1 + 0x1d6e4) * 8 <= iVar9) {
      pCVar1 = *(CNetChan **)(param_1 + 0xe8);
      if (pCVar1 != (CNetChan *)0x0) {
        iVar2 = CNetChan::GetBuffer(pCVar1,0);
        iVar2 = *(int *)(iVar2 + 0xc);
        iVar3 = CNetChan::GetBuffer(pCVar1,1);
        iVar3 = *(int *)(iVar3 + 0xc);
        iVar4 = CNetChan::GetBuffer(pCVar1,2);
        iVar4 = *(int *)(iVar4 + 0xc);
        TraceNetworkMsg((CBaseClient *)param_1,iVar2,"[Reliable payload]");
        TraceNetworkMsg((CBaseClient *)param_1,iVar3,"[Unreliable payload]");
        TraceNetworkMsg((CBaseClient *)param_1,iVar4,"[Voice payload]");
      }
      CUtlBuffer::CUtlBuffer((CUtlBuffer *)local_54,0,0,1);
      dVar10 = (double)((float)iVar9 * 0.125);
                    /* try { // try from 000fa7f6 to 000fa930 has its CatchHandler @ 000fa951 */
      piVar5 = (int *)(**(code **)(*(int *)param_1 + 0x20))(param_1);
      uVar6 = (**(code **)(*piVar5 + 4))(piVar5);
      uVar7 = (**(code **)(*(int *)param_1 + 0x10))(param_1);
      uVar8 = (**(code **)(*(int *)param_1 + 0x1c))(param_1);
      CUtlBuffer::Printf((CUtlBuffer *)local_54,
                         "%f/%d Player [%s][%d][adr:%s] was sent a datagram %d bits (%8.3f bytes)\n"
                         ,(double)realtime,host_tickcount,uVar8,uVar7,uVar6,iVar9,dVar10);
      iVar2 = 0;
      if (0 < *(int *)(param_1 + 0x1d6fc)) {
        iVar3 = 0;
        do {
          iVar4 = *(int *)(*(int *)(param_1 + 0x1d6f0) + iVar3 + 0x40);
          CUtlBuffer::Printf((CUtlBuffer *)local_54,"%64.64s : %8d bits (%8.3f bytes)\n",
                             *(int *)(param_1 + 0x1d6f0) + iVar3,iVar4,
                             (double)((float)iVar4 * 0.125),uVar7,uVar6,iVar9,dVar10);
          iVar4 = *(int *)(param_1 + 0x1d6fc);
          if ((0x2800 < local_44) && (iVar4 + -1 != iVar2)) {
            COM_LogString("netspike.txt",local_54[0]);
            local_48 = 0;
            local_44 = 0;
            local_40 = 0;
            local_34 = 0;
            local_38 = 0xffffffff;
            CUtlBuffer::AddNullTermination((CUtlBuffer *)local_54);
            iVar4 = *(int *)(param_1 + 0x1d6fc);
          }
          iVar2 = iVar2 + 1;
          iVar3 = iVar3 + 0x44;
        } while (iVar2 < iVar4);
      }
      COM_LogString("netspike.txt",local_54[0]);
      *(undefined4 *)(param_1 + 0x1d6fc) = 0;
      CUtlMemory<unsigned_char,int>::Purge((CUtlMemory<unsigned_char,int> *)local_54);
      return;
    }
    *(undefined4 *)(param_1 + 0x1d6fc) = 0;
  }
  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)