L L4D2node

CUtlPriorityQueue<CQueuedPacketSender::CQueuedPacket*,CDefUtlPriorityQueueLessFunc<CQueuedPacketSender::CQueuedPacket*>,CUtlMemory<CQueuedPacketSender::CQueuedPacket*,int>>::Insert

0x001caeb0 · 337 bytes · __thiscall

_ZN17CUtlPriorityQueueIPN19CQueuedPacketSender13CQueuedPacketE28CDefUtlPriorityQueueLessFuncIS2_E10CUtlMemoryIS2_iEE6InsertERKS2_

Decompiled

undefined (2 params)

/* CUtlPriorityQueue<CQueuedPacketSender::CQueuedPacket*,
   CDefUtlPriorityQueueLessFunc<CQueuedPacketSender::CQueuedPacket*>,
   CUtlMemory<CQueuedPacketSender::CQueuedPacket*, int>
   >::Insert(CQueuedPacketSender::CQueuedPacket* const&) */

void __thiscall
CUtlPriorityQueue<CQueuedPacketSender::CQueuedPacket*,CDefUtlPriorityQueueLessFunc<CQueuedPacketSender::CQueuedPacket*>,CUtlMemory<CQueuedPacketSender::CQueuedPacket*,int>>
::Insert(CUtlPriorityQueue<CQueuedPacketSender::CQueuedPacket*,CDefUtlPriorityQueueLessFunc<CQueuedPacketSender::CQueuedPacket*>,CUtlMemory<CQueuedPacketSender::CQueuedPacket*,int>>
         *this,CQueuedPacket **param_1)

{
  int iVar1;
  undefined4 uVar2;
  char cVar3;
  int iVar4;
  void *pvVar5;
  int iVar6;
  int iVar7;
  undefined4 *puVar8;
  int iVar9;
  
  iVar1 = *(int *)(this + 0xc);
  iVar6 = *(int *)(this + 4);
  iVar9 = iVar1 + 1;
  iVar7 = iVar9;
  if (iVar6 < iVar9) {
    iVar4 = *(int *)(this + 8);
    if (-1 < iVar4) {
      if (iVar4 == 0) {
        if (iVar6 == 0) {
          if (iVar9 < 9) {
            iVar4 = 8;
            goto LAB_001cafaf;
          }
          iVar6 = 8;
        }
        do {
          iVar4 = iVar6 * 2;
          if (iVar9 <= iVar4) break;
          iVar4 = iVar6 * 4;
          iVar6 = iVar4;
        } while (iVar4 < iVar9);
      }
      else {
        for (iVar4 = (iVar1 / iVar4 + 1) * iVar4; iVar4 < iVar9; iVar4 = (iVar4 + iVar9) / 2) {
        }
      }
LAB_001cafaf:
      *(int *)(this + 4) = iVar4;
      if (*(void **)this == (void *)0x0) {
        pvVar5 = malloc(iVar4 << 2);
        *(void **)this = pvVar5;
      }
      else {
        pvVar5 = realloc(*(void **)this,iVar4 << 2);
        *(void **)this = pvVar5;
        iVar7 = *(int *)(this + 0xc) + 1;
      }
      goto LAB_001caed1;
    }
  }
  pvVar5 = *(void **)this;
LAB_001caed1:
  *(int *)(this + 0xc) = iVar7;
  *(void **)(this + 0x10) = pvVar5;
  iVar6 = iVar1 * 4;
  iVar7 = (iVar7 - iVar1) + -1;
  if (0 < iVar7) {
    _V_memmove((void *)((int)pvVar5 + iVar6 + 4),(void *)((int)pvVar5 + iVar6),iVar7 * 4);
    pvVar5 = *(void **)this;
  }
  *(CQueuedPacket **)((int)pvVar5 + iVar6) = *param_1;
  while( true ) {
    if (iVar1 == 0) {
      return;
    }
    iVar9 = iVar9 / 2;
    iVar6 = (iVar9 + -1) * 4;
    cVar3 = (**(code **)(this + 0x14))(*(int *)this + iVar1 * 4,*(int *)this + iVar6);
    if (cVar3 != '\0') break;
    puVar8 = (undefined4 *)(iVar6 + *(int *)this);
    uVar2 = *puVar8;
    *puVar8 = *(undefined4 *)(*(int *)this + iVar1 * 4);
    *(undefined4 *)(*(int *)this + iVar1 * 4) = uVar2;
    iVar1 = iVar9 + -1;
  }
  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)