L L4D2node

CNetChan::RemoveHeadInWaitingList

0x001afb30 · 211 bytes · __thiscall

_ZN8CNetChan23RemoveHeadInWaitingListEi

Decompiled

undefined (2 params)

/* CNetChan::RemoveHeadInWaitingList(int) */

void __thiscall CNetChan::RemoveHeadInWaitingList(CNetChan *this,int param_1)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  undefined4 *puVar4;
  int iVar5;
  int iVar6;
  
  iVar1 = param_1 * 0x14;
  piVar2 = (int *)**(undefined4 **)(this + iVar1 + 0xbc);
  if ((void *)piVar2[0x42] != (void *)0x0) {
    operator_delete__((void *)piVar2[0x42]);
  }
  if (*piVar2 != 0) {
    (**(code **)(*(int *)(g_pFileSystem + 4) + 0xc))(g_pFileSystem + 4,*piVar2);
    *piVar2 = 0;
  }
  iVar3 = *(int *)(this + iVar1 + 200);
  if (iVar3 < 1) {
LAB_001afbac:
    operator_delete(piVar2);
    return;
  }
  puVar4 = *(undefined4 **)(this + iVar1 + 0xbc);
  iVar5 = 0;
  if (piVar2 != (int *)*puVar4) {
    do {
      iVar5 = iVar5 + 1;
      if (iVar5 == iVar3) goto LAB_001afbac;
    } while (piVar2 != (int *)puVar4[iVar5]);
    if (iVar5 == -1) goto LAB_001afbac;
  }
  iVar6 = (iVar3 - iVar5) + -1;
  if (iVar6 < 1) {
    *(int *)(this + iVar1 + 200) = iVar3 + -1;
  }
  else {
    _V_memmove(puVar4 + iVar5,puVar4 + iVar5 + 1,iVar6 * 4);
    *(int *)(this + iVar1 + 200) = *(int *)(this + iVar1 + 200) + -1;
  }
  operator_delete(piVar2);
  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)