L L4D2node

CGameEventManager::WriteListenEventList

0x00160dd0 · 203 bytes · __thiscall

_ZN17CGameEventManager20WriteListenEventListEP16CLC_ListenEvents

Decompiled

undefined (2 params)

/* CGameEventManager::WriteListenEventList(CLC_ListenEvents*) */

void __thiscall
CGameEventManager::WriteListenEventList(CGameEventManager *this,CLC_ListenEvents *param_1)

{
  int iVar1;
  int iVar2;
  int iVar3;
  CLC_ListenEvents *pCVar4;
  CLC_ListenEvents *pCVar5;
  int *piVar6;
  int local_20;
  
  pCVar4 = param_1 + 0x4c;
  if (pCVar4 != (CLC_ListenEvents *)0x0) {
    pCVar5 = pCVar4;
    for (iVar3 = 0x10; iVar3 != 0; iVar3 = iVar3 + -1) {
      *(undefined4 *)pCVar5 = 0;
      pCVar5 = pCVar5 + 4;
    }
  }
  iVar3 = 0;
  local_20 = 0;
  if (0 < *(int *)(this + 0x10)) {
    do {
      piVar6 = (int *)(*(int *)(this + 4) + iVar3);
      if (((char)piVar6[8] == '\0') && (0 < piVar6[6])) {
        iVar2 = *(int *)(*(int *)piVar6[3] + 4);
        if ((iVar2 != 4) && (iVar2 != 1)) {
          iVar2 = 0;
          do {
            iVar2 = iVar2 + 1;
            if (iVar2 == piVar6[6]) goto LAB_00160e47;
            iVar1 = *(int *)(((int *)piVar6[3])[iVar2] + 4);
          } while ((iVar1 != 4) && (iVar1 != 1));
        }
        iVar2 = *piVar6;
        if (iVar2 == -1) {
          DevMsg("Warning! Client listens to event \'%s\' unknown by server.\n",
                 *(undefined4 *)(piVar6[1] * 0x18 + *(int *)(this + 0x7c) + 0x10));
        }
        else {
          *(uint *)(pCVar4 + (iVar2 >> 5) * 4) =
               *(uint *)(pCVar4 + (iVar2 >> 5) * 4) | 1 << ((byte)iVar2 & 0x1f);
        }
      }
LAB_00160e47:
      local_20 = local_20 + 1;
      iVar3 = iVar3 + 0x34;
    } while (local_20 < *(int *)(this + 0x10));
  }
  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)