L L4D2node

CNetChan::MergeSplitUserBuffers

0x001b3300 · 455 bytes · __thiscall

_ZN8CNetChan21MergeSplitUserBuffersENS_8EBufTypeER8bf_write

Decompiled

undefined (3 params)

/* CNetChan::MergeSplitUserBuffers(CNetChan::EBufType, bf_write&) */

void __thiscall CNetChan::MergeSplitUserBuffers(CNetChan *this,int param_2,bf_write *param_3)

{
  ushort uVar1;
  int iVar2;
  short *psVar3;
  int iVar4;
  int iVar5;
  uint uVar6;
  ushort *puVar7;
  int local_70;
  NET_SplitScreenUser local_6c [92];
  
  local_70 = 0;
  uVar1 = *(ushort *)(this + 0x4250);
  do {
    uVar6 = (uint)uVar1;
    if ((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>>
         ::Links(unsigned_short)::s_Sentinel == '\0') &&
       (iVar2 = __cxa_guard_acquire(&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>>
                                     ::Links(unsigned_short)::s_Sentinel), iVar2 != 0)) {
      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>>
      ::Links(unsigned_short)::s_Sentinel = 0xffff;
      DAT_00341692 = 0xffff;
      DAT_00341694 = 0xffff;
      __cxa_guard_release(&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>>
                           ::Links(unsigned_short)::s_Sentinel);
      if (uVar1 == 0xffff) goto LAB_001b33d0;
LAB_001b3342:
      psVar3 = (short *)(uVar6 * 0x10 + *(int *)(this + 0x4244));
    }
    else {
      if (uVar1 != 0xffff) goto LAB_001b3342;
LAB_001b33d0:
      psVar3 = &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>>
                ::Links(unsigned_short)::s_Sentinel;
    }
    if (*psVar3 == -1) {
      for (; uVar6 != 0xffff; uVar6 = uVar6 & 0xffff) {
        iVar5 = uVar6 * 0x10 + *(int *)(this + 0x4244);
        iVar2 = *(int *)(iVar5 + 0xc);
        if (iVar2 != 0) {
          iVar4 = iVar2 + 0x44;
          if (param_2 != 1) {
            iVar4 = iVar2 + 0x20;
            if (param_2 == 2) {
              iVar4 = iVar2 + 0x68;
            }
          }
          MaybeAppendBuffer(this,param_2,param_3,iVar5 + 8,iVar4,&local_70);
        }
        uVar6 = 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>>
                ::NextInorder((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 + 0x4240),(ushort)uVar6);
      }
      if (local_70 != 0) {
        NET_SplitScreenUser::NET_SplitScreenUser(local_6c,0);
        NET_SplitScreenUser::WriteToBuffer(local_6c,param_3);
      }
      return;
    }
    if (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>>
        ::Links(unsigned_short)::s_Sentinel == '\0') {
      iVar2 = __cxa_guard_acquire(&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>>
                                   ::Links(unsigned_short)::s_Sentinel);
      if (iVar2 != 0) {
        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>>
        ::Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_00341692 = 0xffff;
        DAT_00341694 = 0xffff;
        __cxa_guard_release(&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>>
                             ::Links(unsigned_short)::s_Sentinel);
      }
      if (uVar1 != 0xffff) goto LAB_001b3371;
LAB_001b34a1:
      puVar7 = &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>>
                ::Links(unsigned_short)::s_Sentinel;
    }
    else {
      if (uVar1 == 0xffff) goto LAB_001b34a1;
LAB_001b3371:
      puVar7 = (ushort *)(uVar6 * 0x10 + *(int *)(this + 0x4244));
    }
    uVar1 = *puVar7;
  } while( true );
}

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)