L L4D2node

GCSDK::CGCBase::FindOrCreateGSSession

0x0007b300 · 306 bytes · __thiscall

_ZN5GCSDK7CGCBase21FindOrCreateGSSessionERK8CSteamID

Decompiled

undefined (2 params)

/* GCSDK::CGCBase::FindOrCreateGSSession(CSteamID const&) */

int __thiscall GCSDK::CGCBase::FindOrCreateGSSession(CGCBase *this,CSteamID *param_1)

{
  CSteamID CVar1;
  int iVar2;
  undefined4 uVar3;
  byte bVar4;
  undefined4 local_18;
  undefined4 local_14;
  int local_10;
  
  iVar2 = 0;
  CVar1 = param_1[6];
  bVar4 = (byte)CVar1 & 0xf0;
  if (((((byte)CVar1 & 0xf0) != 0) && ((byte)CVar1 < 0xb0)) && ((byte)((char)param_1[7] - 1U) < 4))
  {
    if (bVar4 == 0x10) {
      if (*(int *)param_1 == 0) {
        return 0;
      }
      if ((((byte)param_1[6] & 0xf) << 0x10 | (uint)*(ushort *)(param_1 + 4)) != 1) {
        return 0;
      }
    }
    else if (bVar4 == 0x70) {
      if (*(int *)param_1 == 0) {
        return 0;
      }
      if (((byte)param_1[6] & 0xf) != 0 || *(short *)(param_1 + 4) != 0) {
        return 0;
      }
    }
    else if ((bVar4 == 0x30) && (*(int *)param_1 == 0)) {
      return 0;
    }
    iVar2 = FindGSSession(this,param_1);
    if (iVar2 == 0) {
      uVar3 = FindOrLoadSOCache(this,param_1);
      iVar2 = (**(code **)(*(int *)this + 0x44))(this,param_1,uVar3);
      local_14 = *(undefined4 *)(param_1 + 4);
      local_18 = *(undefined4 *)param_1;
      local_10 = iVar2;
      CUtlRBTree<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
      ::Insert((CUtlRBTree<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short,CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CSteamID,GCSDK::CGCGSSession*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                *)(this + 0x158),(Node_t *)&local_18);
      (**(code **)(*(int *)this + 0x50))(this,iVar2);
    }
  }
  return iVar2;
}

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)