L L4D2node

CDedicatedServerAPI::Connect

0x00216240 · 369 bytes · __thiscall

_ZN19CDedicatedServerAPI7ConnectEPFPvPKcPiE

Decompiled

undefined (2 params)

/* CDedicatedServerAPI::Connect(void* (*)(char const*, int*)) */

undefined4 __thiscall
CDedicatedServerAPI::Connect(CDedicatedServerAPI *this,_func_void_ptr_char_ptr_int_ptr *param_1)

{
  int *piVar1;
  int iVar2;
  undefined4 uVar3;
  _func_void_ptr_char_ptr_int_ptr *local_18;
  _func_void_ptr_char_ptr_int_ptr *local_14;
  _func_void_ptr_char_ptr_int_ptr *local_10;
  
  piVar1 = (int *)CommandLine_Tier0();
  iVar2 = (**(code **)(*piVar1 + 0x28))(piVar1,"-sv_benchmark");
  if (iVar2 != 0) {
    Plat_SetBenchmarkMode(1);
  }
  g_AppSystemFactory = param_1;
  local_18 = param_1;
  local_14 = param_1;
  local_10 = param_1;
  if (this[4] != (CDedicatedServerAPI)0x0) {
    ConnectTier1Libraries((_func_void_ptr_char_ptr_int_ptr *)&local_10,1);
    if (this[4] != (CDedicatedServerAPI)0x0) {
      ConnectTier2Libraries((_func_void_ptr_char_ptr_int_ptr *)&local_14,1);
      if (this[4] != (CDedicatedServerAPI)0x0) {
        ConnectTier3Libraries((_func_void_ptr_char_ptr_int_ptr *)&local_18,1);
      }
    }
  }
  uVar3 = 0;
  dedicated = (*param_1)("VENGINE_DEDICATEDEXPORTS_API_VERSION003",(int *)0x0);
  if (dedicated != (void *)0x0) {
    g_pFileSystem = g_pFullFileSystem;
    (**(code **)(*g_pFullFileSystem + 0x100))(g_pFullFileSystem,Warning);
    uVar3 = Shader_Connect(false);
    if ((char)uVar3 != '\0') {
      if (g_pStudioRender == 0) {
        uVar3 = 0;
        Sys_Error("Unable to init studio render system version %s\n","VStudioRender026");
      }
      else {
        g_pPhysics = (*param_1)("VPhysics031",(int *)0x0);
        if (((g_pDataCache == 0) || (g_pPhysics == (void *)0x0)) || (g_pMDLCache == 0)) {
          uVar3 = 0;
          Warning("Engine wasn\'t able to acquire required interfaces!\n");
        }
        else {
          ConnectMDLCacheNotify();
        }
      }
    }
  }
  return uVar3;
}

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)