L L4D2node

CModAppSystemGroup::Create

0x002174d0 · 751 bytes · __thiscall

_ZN18CModAppSystemGroup6CreateEv

Decompiled

undefined (1 param)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CModAppSystemGroup::Create() */

undefined4 __thiscall CModAppSystemGroup::Create(CModAppSystemGroup *this)

{
  IAppSystem *pIVar1;
  char cVar2;
  char *pcVar3;
  undefined4 uVar4;
  int *piVar5;
  int iVar6;
  char *pcVar7;
  int iVar8;
  char *local_38;
  char *local_34;
  AppSystemInfo_t *local_30;
  undefined4 local_2c;
  undefined4 local_28;
  int local_24;
  AppSystemInfo_t *local_20;
  
  COM_TimestampedLog("CModAppSystemGroup::Create() - Start");
  Sys_Version((bool)this[0x50]);
  pcVar3 = "matchmaking_ds_srv.so";
  if (this[0x50] == (CModAppSystemGroup)0x0) {
    pcVar3 = "matchmaking_srv.so";
  }
  g_pMatchmakingDllModule =
       (CSysModule *)(**(code **)(*g_pFileSystem + 0x68))(g_pFileSystem,pcVar3,"GAMEBIN",0);
  if (g_pMatchmakingDllModule == (CSysModule *)0x0) {
    Sys_Error("Could not load library matchmaking");
    pIVar1 = g_pMatchFramework;
  }
  else {
    g_pfnMatchmakingFactory = (code *)Sys_GetFactory(g_pMatchmakingDllModule);
    if (g_pfnMatchmakingFactory == (code *)0x0) {
      Sys_Error("Could not find factory interface in library matchmaking");
      pIVar1 = g_pMatchFramework;
    }
    else {
      g_pIfaceMatchFramework = (IAppSystem *)(*g_pfnMatchmakingFactory)("MATCHFRAMEWORK_001",0);
      pIVar1 = g_pIfaceMatchFramework;
      if (g_pIfaceMatchFramework == (IAppSystem *)0x0) {
        Sys_Error("Could not get matchmaking.dll interface from library matchmaking");
        pIVar1 = g_pIfaceMatchFramework;
      }
    }
  }
  g_pMatchFramework = pIVar1;
  CAppSystemGroup::AddSystem((CAppSystemGroup *)this,g_pIfaceMatchFramework,"MATCHFRAMEWORK_001");
  Host_SubscribeForProfileEvents(true);
  uVar4 = ServerDLL_Load();
  if ((char)uVar4 != '\0') {
    piVar5 = (int *)(*g_ServerFactory)("VServerDllSharedAppSystems001",0);
    if (piVar5 != (int *)0x0) {
      local_30 = (AppSystemInfo_t *)0x0;
      local_2c = 0;
      local_28 = 0;
      local_24 = 0;
      local_20 = (AppSystemInfo_t *)0x0;
                    /* try { // try from 002175fd to 0021777b has its CatchHandler @ 002177d2 */
      iVar6 = (**(code **)*piVar5)(piVar5);
      iVar8 = 0;
      if (0 < iVar6) {
        do {
          pcVar3 = (char *)(**(code **)(*piVar5 + 4))(piVar5,iVar8);
          local_34 = (char *)(**(code **)(*piVar5 + 8))(piVar5,iVar8);
          local_38 = pcVar3;
          CUtlVector<AppSystemInfo_t,CUtlMemory<AppSystemInfo_t,int>>::InsertBefore
                    ((CUtlVector<AppSystemInfo_t,CUtlMemory<AppSystemInfo_t,int>> *)&local_30,
                     local_24,(AppSystemInfo_t *)&local_38);
          iVar8 = iVar8 + 1;
        } while (iVar8 != iVar6);
      }
      if ((this[0x50] == (CModAppSystemGroup)0x0) &&
         (iVar6 = (*(code *)*_DAT_00000000)(0), 0 < iVar6)) {
        iVar8 = 0;
        do {
          while( true ) {
            pcVar3 = (char *)(*(code *)_DAT_00000000[1])(0,iVar8);
            pcVar7 = (char *)(*(code *)_DAT_00000000[2])(0,iVar8);
            cVar2 = ModuleAlreadyInList(this,(CUtlVector *)&local_30,pcVar3,pcVar7);
            if (cVar2 != '\0') break;
            local_38 = pcVar3;
            local_34 = pcVar7;
            CUtlVector<AppSystemInfo_t,CUtlMemory<AppSystemInfo_t,int>>::InsertBefore
                      ((CUtlVector<AppSystemInfo_t,CUtlMemory<AppSystemInfo_t,int>> *)&local_30,
                       local_24,(AppSystemInfo_t *)&local_38);
            iVar8 = iVar8 + 1;
            if (iVar8 == iVar6) goto LAB_00217700;
          }
          iVar8 = iVar8 + 1;
        } while (iVar8 != iVar6);
      }
LAB_00217700:
      local_38 = "";
      local_34 = "";
      CUtlVector<AppSystemInfo_t,CUtlMemory<AppSystemInfo_t,int>>::InsertBefore
                ((CUtlVector<AppSystemInfo_t,CUtlMemory<AppSystemInfo_t,int>> *)&local_30,local_24,
                 (AppSystemInfo_t *)&local_38);
      uVar4 = CAppSystemGroup::AddSystems((CAppSystemGroup *)this,local_30);
      if ((char)uVar4 != '\0') {
        COM_TimestampedLog("CModAppSystemGroup::Create() - Finish");
      }
      local_24 = 0;
      CUtlMemory<AppSystemInfo_t,int>::Purge((CUtlMemory<AppSystemInfo_t,int> *)&local_30);
      local_20 = local_30;
      CUtlMemory<AppSystemInfo_t,int>::Purge((CUtlMemory<AppSystemInfo_t,int> *)&local_30);
      return uVar4;
    }
    uVar4 = AddLegacySystems(this);
  }
  return uVar4;
}

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)