L L4D2node

CNetChan::SendFile

0x001b46f0 · 173 bytes · __thiscall

_ZN8CNetChan8SendFileEPKcjb

Decompiled

undefined (4 params)

/* CNetChan::SendFile(char const*, unsigned int, bool) */

undefined4 __thiscall CNetChan::SendFile(CNetChan *this,char *param_1,uint param_2,bool param_3)

{
  int iVar1;
  undefined4 uVar2;
  uint uVar3;
  
  iVar1 = netadr_s::GetType((netadr_s *)(this + 0x98));
  if (iVar1 != 0) {
    uVar3 = (uint)param_3;
    uVar2 = CreateFragmentsFromFile((char *)this,(int)param_1,1,SUB41(param_2,0));
    if ((char)uVar2 == '\0') {
      (**(code **)(*(int *)this + 0xb4))(this,param_1,param_2,(uint)param_3,uVar3);
      return uVar2;
    }
    if (*(int *)(net_showfragments._28_4_ + 0x30) == 2) {
      DevMsg("SendFile: %s (ID %i)\n",param_1,param_2);
      return uVar2;
    }
  }
  return 1;
}

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)