L L4D2node

CL4DGameStats::SendClientWeaponStats

0x008df2d0 · 349 bytes · __thiscall

_ZN13CL4DGameStats21SendClientWeaponStatsEP13CTerrorPlayer

Decompiled

undefined (2 params)

/* CL4DGameStats::SendClientWeaponStats(CTerrorPlayer*) */

void __thiscall CL4DGameStats::SendClientWeaponStats(CL4DGameStats *this,CTerrorPlayer *param_1)

{
  char cVar1;
  int iVar2;
  CL4DGameStats *pCVar3;
  CL4DGameStats *pCVar4;
  undefined **local_3c [11];
  
  if ((engine != (int *)0x0) && (cVar1 = (**(code **)(*engine + 0x1f8))(engine), cVar1 != '\0')) {
    return;
  }
  if ((param_1 != (CTerrorPlayer *)0x0) &&
     (cVar1 = (**(code **)(*(int *)param_1 + 0x778))(param_1), cVar1 == '\0')) {
    if (*(int *)(param_1 + 0x30) == 0) {
      iVar2 = -1;
    }
    else {
      iVar2 = (*(int *)(param_1 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4) + -1;
    }
    pCVar3 = this + iVar2 * 0x30c + 0x5ec;
    pCVar4 = pCVar3;
    do {
      if (*(int *)pCVar4 != 0) {
        CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_3c);
        local_3c[0] = &PTR__CSingleUserRecipientFilter_00c08ea8;
                    /* try { // try from 008df376 to 008df37a has its CatchHandler @ 008df43e */
        CRecipientFilter::AddRecipient((CRecipientFilter *)local_3c,(CBasePlayer *)param_1);
                    /* try { // try from 008df37e to 008df41c has its CatchHandler @ 008df450 */
        CRecipientFilter::MakeReliable((CRecipientFilter *)local_3c);
        UserMessageBegin((IRecipientFilter *)local_3c,"SteamWeaponStatData");
        iVar2 = 0;
        if (*(int *)pCVar3 != 0) goto LAB_008df3d3;
        iVar2 = 0;
        while( true ) {
          iVar2 = iVar2 + 1;
          *(int *)pCVar3 = 0;
          pCVar4 = pCVar3 + 0x14;
          *(int *)(pCVar3 + 4) = 0;
          *(int *)(pCVar3 + 8) = 0;
          *(int *)(pCVar3 + 0xc) = 0;
          *(int *)(pCVar3 + 0x10) = 0;
          if (iVar2 == 0x27) break;
          pCVar3 = pCVar4;
          if (*(int *)pCVar4 != 0) {
LAB_008df3d3:
            MessageWriteByte(iVar2);
            MessageWriteByte(*(int *)pCVar3);
            MessageWriteByte(*(int *)(pCVar3 + 4));
            MessageWriteByte(*(int *)(pCVar3 + 0xc));
            MessageWriteByte(*(int *)(pCVar3 + 0x10));
            MessageWriteByte(*(int *)(pCVar3 + 8));
          }
        }
        MessageEnd();
        local_3c[0] = &PTR__CSingleUserRecipientFilter_00c08ea8;
        CRecipientFilter::~CRecipientFilter((CRecipientFilter *)local_3c);
        return;
      }
      pCVar4 = pCVar4 + 0x14;
    } while (pCVar4 != this + iVar2 * 0x30c + 0x8f8);
  }
  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)