CNetSupportImpl::CreateChannel
0x001c1ae0 · 160 bytes · __thiscall
_ZN15CNetSupportImpl13CreateChannelEiRK8netadr_sPKcP18INetChannelHandler
Decompiled
undefined (5 params)
/* CNetSupportImpl::CreateChannel(int, netadr_s const&, char const*, INetChannelHandler*) */
void __thiscall
CNetSupportImpl::CreateChannel
(CNetSupportImpl *this,int param_1,netadr_s *param_2,char *param_3,
INetChannelHandler *param_4)
{
short sVar1;
ushort uVar2;
int iVar3;
int in_GS_OFFSET;
undefined4 local_2c;
undefined4 local_28;
undefined4 local_24;
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
local_2c = *(undefined4 *)param_2;
local_28 = *(undefined4 *)(param_2 + 4);
local_24 = *(undefined4 *)(param_2 + 8);
sVar1 = netadr_s::GetPort((netadr_s *)&local_2c);
if (sVar1 == 0) {
iVar3 = netadr_s::GetType((netadr_s *)&local_2c);
if (iVar3 == 3) {
uVar2 = NET_GetUDPPort(param_1);
netadr_s::SetPort((netadr_s *)&local_2c,uVar2);
}
}
NET_CreateNetChannel(param_1,(netadr_s *)&local_2c,param_3,param_4,false);
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
SourceMod gamedata
paste intoaddons/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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.