L L4D2node

CUtlRBTree<CNetChan::SplitPlayer_t,unsigned_short,bool(*)(CNetChan::SplitPlayer_t_const&,CNetChan::SplitPlayer_t_const&),CUtlMemory<UtlRBTreeNode_t<CNetChan::SplitPlayer_t,unsigned_short>,unsigned_short>>::Insert

0x001bc1b0 · 482 bytes · __thiscall

_ZN10CUtlRBTreeIN8CNetChan13SplitPlayer_tEtPFbRKS1_S3_E10CUtlMemoryI15UtlRBTreeNode_tIS1_tEtEE6InsertES3_

Decompiled

undefined (2 params)

/* CUtlRBTree<CNetChan::SplitPlayer_t, unsigned short, bool (*)(CNetChan::SplitPlayer_t const&,
   CNetChan::SplitPlayer_t const&), CUtlMemory<UtlRBTreeNode_t<CNetChan::SplitPlayer_t, unsigned
   short>, unsigned short> >::Insert(CNetChan::SplitPlayer_t const&) */

ushort __thiscall
CUtlRBTree<CNetChan::SplitPlayer_t,unsigned_short,bool(*)(CNetChan::SplitPlayer_t_const&,CNetChan::SplitPlayer_t_const&),CUtlMemory<UtlRBTreeNode_t<CNetChan::SplitPlayer_t,unsigned_short>,unsigned_short>>
::Insert(CUtlRBTree<CNetChan::SplitPlayer_t,unsigned_short,bool(*)(CNetChan::SplitPlayer_t_const&,CNetChan::SplitPlayer_t_const&),CUtlMemory<UtlRBTreeNode_t<CNetChan::SplitPlayer_t,unsigned_short>,unsigned_short>>
         *this,SplitPlayer_t *param_1)

{
  ushort uVar1;
  undefined4 uVar2;
  bool bVar3;
  char cVar4;
  int iVar5;
  undefined2 *puVar6;
  int iVar7;
  ushort uVar8;
  int local_24;
  ushort local_1e;
  
  uVar1 = *(ushort *)(this + 0x10);
  if (*(ushort *)(this + 0x10) == 0xffff) {
    local_1e = NewNode(this);
    local_24 = (uint)local_1e * 0x10;
    puVar6 = (undefined2 *)(local_24 + *(int *)(this + 4));
    puVar6[2] = 0xffff;
    puVar6[1] = 0xffff;
    *puVar6 = 0xffff;
    puVar6[3] = 0;
  }
  else {
    do {
      uVar8 = uVar1;
      iVar7 = (uint)uVar8 * 0x10;
      cVar4 = (**(code **)this)(param_1,*(int *)(this + 4) + iVar7 + 8);
      if (cVar4 == '\0') {
        if ((Links(unsigned_short)::s_Sentinel == '\0') &&
           (iVar5 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar5 != 0)) {
          Links(unsigned_short)::s_Sentinel = 0xffff;
          DAT_00341692 = 0xffff;
          DAT_00341694 = 0xffff;
          __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        }
        bVar3 = false;
        uVar1 = *(ushort *)(*(int *)(this + 4) + 2 + iVar7);
      }
      else {
        if ((Links(unsigned_short)::s_Sentinel == '\0') &&
           (iVar5 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar5 != 0)) {
          Links(unsigned_short)::s_Sentinel = 0xffff;
          DAT_00341692 = 0xffff;
          DAT_00341694 = 0xffff;
          __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        }
        bVar3 = true;
        uVar1 = *(ushort *)(*(int *)(this + 4) + iVar7);
      }
    } while (uVar1 != 0xffff);
    local_1e = NewNode(this);
    local_24 = (uint)local_1e * 0x10;
    puVar6 = (undefined2 *)(local_24 + *(int *)(this + 4));
    puVar6[1] = 0xffff;
    *puVar6 = 0xffff;
    puVar6[2] = uVar8;
    puVar6[3] = 0;
    if (uVar8 != 0xffff) {
      if (bVar3) {
        *(ushort *)(*(int *)(this + 4) + iVar7) = local_1e;
      }
      else {
        *(ushort *)(*(int *)(this + 4) + 2 + iVar7) = local_1e;
      }
      goto LAB_001bc285;
    }
  }
  *(ushort *)(this + 0x10) = local_1e;
LAB_001bc285:
  InsertRebalance(this,local_1e);
  *(short *)(this + 0x12) = *(short *)(this + 0x12) + 1;
  local_24 = local_24 + *(int *)(this + 4);
  if (local_24 != -8) {
    uVar2 = *(undefined4 *)param_1;
    *(undefined4 *)(local_24 + 0xc) = *(undefined4 *)(param_1 + 4);
    *(undefined4 *)(local_24 + 8) = uVar2;
  }
  return local_1e;
}

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)