L L4D2node

NET_GetPacket

0x001c72b0 · 264 bytes · __cdecl

_Z13NET_GetPacketiPh

Decompiled

undefined (2 params)

/* NET_GetPacket(int, unsigned char*) */

netadr_s * NET_GetPacket(int param_1,uchar *param_2)

{
  undefined8 uVar1;
  char cVar2;
  int iVar3;
  netadr_s *this;
  
  this = (netadr_s *)(param_1 * 0x50 + net_packets._0_4_);
  NET_AdjustLag();
  NET_DiscardStaleSplitpackets(param_1);
  netadr_s::SetType(this,3);
  netadr_s::Clear(this);
  *(int *)(this + 0xc) = param_1;
  uVar1 = net_time;
  *(undefined4 *)(this + 0x40) = 0;
  *(undefined4 *)(this + 0x44) = 0;
  *(undefined8 *)(this + 0x10) = uVar1;
  *(uchar **)(this + 0x18) = param_2;
  *(undefined4 *)(this + 0x4c) = 0;
  *(char **)(this + 0x1c) = "inpacket.message";
  cVar2 = NET_GetLoopPacket((netpacket_s *)this);
  if ((cVar2 != '\0') ||
     ((net_multiplayer != '\0' &&
      ((cVar2 = NET_ReceiveDatagram(param_1,(netpacket_s *)this), cVar2 != '\0' ||
       (cVar2 = NET_LagPacket(false,(netpacket_s *)this), cVar2 != '\0')))))) {
    CBitRead::StartReading
              ((CBitRead *)(this + 0x1c),*(void **)(this + 0x18),*(int *)(this + 0x40),0,-1);
    return this;
  }
  if ((*(int *)(this + 0x40) == 0) && (iVar3 = netadr_s::GetIP(this), iVar3 == 0)) {
    return (netadr_s *)0x0;
  }
  *(undefined4 *)(this + 0x40) = 0;
  return this;
}

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)