L L4D2node

CL4DGameStats::Event_PlayerDisconnected

0x008e0a70 · 301 bytes · __thiscall

_ZN13CL4DGameStats24Event_PlayerDisconnectedEP11CBasePlayer

Decompiled

undefined (2 params)

/* CL4DGameStats::Event_PlayerDisconnected(CBasePlayer*) */

void __thiscall CL4DGameStats::Event_PlayerDisconnected(CL4DGameStats *this,CBasePlayer *param_1)

{
  CSteamWorksGameStatsUploader *pCVar1;
  char cVar2;
  uint uVar3;
  CL4DGameStats *pCVar4;
  int iVar5;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  undefined4 local_1c;
  undefined4 local_18;
  int local_14;
  undefined4 local_10;
  
  if ((param_1 != (CBasePlayer *)0x0) &&
     (cVar2 = (**(code **)(*(int *)param_1 + 0x16c))(param_1), cVar2 != '\0')) {
    if (*(int *)(param_1 + 0x30) == 0) {
      return;
    }
    uVar3 = (*(int *)(param_1 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4) - 1;
    if (0x1f < uVar3) {
      return;
    }
    iVar5 = 0x27;
    pCVar4 = this + uVar3 * 0x30c + 0x5ec;
    do {
      *(undefined4 *)pCVar4 = 0;
      *(undefined4 *)(pCVar4 + 4) = 0;
      *(undefined4 *)(pCVar4 + 8) = 0;
      *(undefined4 *)(pCVar4 + 0xc) = 0;
      *(undefined4 *)(pCVar4 + 0x10) = 0;
      iVar5 = iVar5 + -1;
      pCVar4 = pCVar4 + 0x14;
    } while (iVar5 != 0);
  }
  if ((this[0x70] == (CL4DGameStats)0x0) &&
     (cVar2 = CTerrorGameRules::HasPlayerControlledZombies(), cVar2 == '\0')) {
    local_20 = 0;
    local_1c = 0;
    local_18 = 0;
    local_14 = 0;
    local_10 = 0;
    local_30 = 2;
    local_2c = 7;
    local_28 = 1;
    local_24 = 9;
                    /* try { // try from 008e0b4e to 008e0b7a has its CatchHandler @ 008e0ba6 */
    ForEachTerrorPlayer<PlayerCollector>((PlayerCollector *)&local_30);
    pCVar1 = steamGameStats;
    if (local_14 == 0) {
      this[0x70] = (CL4DGameStats)0x1;
      CSteamWorksGameStatsUploader::SetExitStatus(pCVar1,7);
      SpoofMapTransitionAndSendStats(this);
      this[0x70] = (CL4DGameStats)0x1;
    }
    local_14 = 0;
    CUtlMemory<CTerrorPlayer*,int>::Purge((CUtlMemory<CTerrorPlayer*,int> *)&local_20);
    local_10 = local_20;
    CUtlMemory<CTerrorPlayer*,int>::Purge((CUtlMemory<CTerrorPlayer*,int> *)&local_20);
    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)