L L4D2node

CMatchEventsSubscription::Subscribe

0x0005ca30 · 140 bytes · __thiscall

_ZN24CMatchEventsSubscription9SubscribeEP16IMatchEventsSink

Decompiled

undefined (2 params)

/* CMatchEventsSubscription::Subscribe(IMatchEventsSink*) */

void __thiscall
CMatchEventsSubscription::Subscribe(CMatchEventsSubscription *this,IMatchEventsSink *param_1)

{
  int iVar1;
  int iVar2;
  int iVar3;
  int local_20 [4];
  
  if (param_1 != (IMatchEventsSink *)0x0) {
    iVar1 = *(int *)(this + 0x10);
    if (0 < iVar1) {
      if (param_1 == (IMatchEventsSink *)**(int **)(this + 4)) {
        iVar3 = 0;
LAB_0005caab:
        *(int *)(iVar3 + *(int *)(this + 0x18)) = *(int *)(iVar3 + *(int *)(this + 0x18)) + 1;
        return;
      }
      iVar2 = 0;
      do {
        iVar2 = iVar2 + 1;
        if (iVar2 == iVar1) goto LAB_0005ca6b;
        iVar3 = iVar2 * 4;
      } while (param_1 != (IMatchEventsSink *)(*(int **)(this + 4))[iVar2]);
      if (-1 < iVar2) goto LAB_0005caab;
    }
LAB_0005ca6b:
    CUtlVector<IMatchEventsSink*,CUtlMemory<IMatchEventsSink*,int>>::InsertBefore
              ((CUtlVector<IMatchEventsSink*,CUtlMemory<IMatchEventsSink*,int>> *)(this + 4),iVar1,
               &param_1);
    local_20[0] = 1;
    CUtlVector<int,CUtlMemory<int,int>>::InsertBefore
              ((CUtlVector<int,CUtlMemory<int,int>> *)(this + 0x18),*(int *)(this + 0x24),local_20);
  }
  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)