L L4D2node

GCSDK::CSharedObject::RegisterFactory

0x00086e10 · 96 bytes · __cdecl

_ZN5GCSDK13CSharedObject15RegisterFactoryEiPFPS0_vE

Decompiled

undefined (2 params)

/* GCSDK::CSharedObject::RegisterFactory(int, GCSDK::CSharedObject* (*)()) */

void GCSDK::CSharedObject::RegisterFactory(int param_1,_func_CSharedObject_ptr *param_2)

{
  ushort uVar1;
  int local_14;
  _func_CSharedObject_ptr *local_10;
  
  local_14 = param_1;
  uVar1 = CUtlRBTree<CUtlMap<int,GCSDK::CSharedObject*(*)(),unsigned_short>::Node_t,unsigned_short,CUtlMap<int,GCSDK::CSharedObject*(*)(),unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,GCSDK::CSharedObject*(*)(),unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
          ::Find((CUtlRBTree<CUtlMap<int,GCSDK::CSharedObject*(*)(),unsigned_short>::Node_t,unsigned_short,CUtlMap<int,GCSDK::CSharedObject*(*)(),unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,GCSDK::CSharedObject*(*)(),unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                  *)sm_mapFactories,(Node_t *)&local_14);
  if (uVar1 != 0xffff) {
    *(_func_CSharedObject_ptr **)((uint)uVar1 * 0x10 + sm_mapFactories._4_4_ + 0xc) = param_2;
    return;
  }
  local_14 = param_1;
  local_10 = param_2;
  CUtlRBTree<CUtlMap<int,GCSDK::CSharedObject*(*)(),unsigned_short>::Node_t,unsigned_short,CUtlMap<int,GCSDK::CSharedObject*(*)(),unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,GCSDK::CSharedObject*(*)(),unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
  ::Insert((CUtlRBTree<CUtlMap<int,GCSDK::CSharedObject*(*)(),unsigned_short>::Node_t,unsigned_short,CUtlMap<int,GCSDK::CSharedObject*(*)(),unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,GCSDK::CSharedObject*(*)(),unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
            *)sm_mapFactories,(Node_t *)&local_14);
  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)