L L4D2node

CAchievementMgr::OnEvent

0x003e9a30 · 209 bytes · __thiscall

_ZN15CAchievementMgr7OnEventEP9KeyValues

Decompiled

undefined (2 params)

/* CAchievementMgr::OnEvent(KeyValues*) */

void __thiscall CAchievementMgr::OnEvent(CAchievementMgr *this,KeyValues *param_1)

{
  int *piVar1;
  char *pcVar2;
  int iVar3;
  uint uVar4;
  
  pcVar2 = (char *)KeyValues::GetName(param_1);
  if ((pcVar2 == "OnProfileDataLoaded") ||
     (iVar3 = _V_stricmp(pcVar2,"OnProfileDataLoaded"), iVar3 == 0)) {
    iVar3 = KeyValues::GetInt(param_1,"iController",0);
    ReadAchievementsFromTitleData(this,iVar3,0);
  }
  else {
    iVar3 = _V_stricmp(pcVar2,"OnProfileLeaderboardData");
    if (iVar3 == 0) {
      uVar4 = CUtlRBTree<CUtlMap<int,CBaseAchievement*,unsigned_short>::Node_t,unsigned_short,CUtlMap<int,CBaseAchievement*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,CBaseAchievement*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
              ::FirstInorder((CUtlRBTree<CUtlMap<int,CBaseAchievement*,unsigned_short>::Node_t,unsigned_short,CUtlMap<int,CBaseAchievement*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,CBaseAchievement*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                              *)(this + 0x38));
      uVar4 = uVar4 & 0xffff;
      if (uVar4 != 0xffff) {
        do {
          piVar1 = *(int **)(uVar4 * 0x10 + *(int *)(this + 0x3c) + 0xc);
          (**(code **)(*piVar1 + 0x3c))(piVar1,param_1);
          uVar4 = CUtlRBTree<CUtlMap<int,CBaseAchievement*,unsigned_short>::Node_t,unsigned_short,CUtlMap<int,CBaseAchievement*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,CBaseAchievement*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                  ::NextInorder((CUtlRBTree<CUtlMap<int,CBaseAchievement*,unsigned_short>::Node_t,unsigned_short,CUtlMap<int,CBaseAchievement*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,CBaseAchievement*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                                 *)(this + 0x38),(ushort)uVar4);
          uVar4 = uVar4 & 0xffff;
        } while (uVar4 != 0xffff);
        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)