L L4D2node

CNetChan::SendData

0x001adaf0 · 151 bytes · __thiscall

_ZN8CNetChan8SendDataER8bf_writeb

Decompiled

undefined (3 params)

/* CNetChan::SendData(bf_write&, bool) */

uint __thiscall CNetChan::SendData(CNetChan *this,bf_write *param_1,bool param_2)

{
  int iVar1;
  uint uVar2;
  bf_write *this_00;
  
  iVar1 = netadr_s::GetType((netadr_s *)(this + 0x98));
  if ((iVar1 == 0) || (iVar1 = *(int *)(param_1 + 0xc), iVar1 < 1)) {
    uVar2 = 1;
  }
  else {
    if (param_1[0x10] == (bf_write)0x0) {
      if (!param_2) {
        this_00 = (bf_write *)(this + 0x44);
        if (*(int *)(this + 0x4c) - *(int *)(this + 0x50) < iVar1) {
          return 0;
        }
        goto LAB_001adb71;
      }
    }
    else if (!param_2) {
      return (uint)(byte)param_1[0x10];
    }
    if (iVar1 <= *(int *)(this + 0x28) - *(int *)(this + 0x2c)) {
      this_00 = (bf_write *)(this + 0x20);
LAB_001adb71:
      uVar2 = bf_write::WriteBits(this_00,*(void **)param_1,iVar1);
      return uVar2;
    }
    ConMsg("ERROR! SendData reliabe data too big (%i)",iVar1 + 7 >> 3);
    uVar2 = 0;
  }
  return uVar2;
}

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)