CNetConsoleMgr::RunFrame
0x001a2990 · 602 bytes · __thiscall
_ZN14CNetConsoleMgr8RunFrameEv
Decompiled
undefined (1 param)
/* CNetConsoleMgr::RunFrame() */
void __thiscall CNetConsoleMgr::RunFrame(CNetConsoleMgr *this)
{
CSocketCreator *this_00;
char cVar1;
int iVar2;
ssize_t sVar3;
uint __n;
int __fd;
int in_GS_OFFSET;
int local_140;
int local_138;
int local_134;
CConnectedNetConsoleData *local_130;
undefined1 local_125;
uint local_124;
char local_120 [256];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
this_00 = (CSocketCreator *)(this + 4);
CSocketCreator::RunFrame(this_00);
iVar2 = CSocketCreator::GetAcceptedSocketCount(this_00);
__fd = *(int *)(this + 0x13c);
local_134 = iVar2 + -1 + (uint)(__fd != -1);
if (-1 < local_134) {
do {
local_140 = local_134;
iVar2 = local_134;
if ((__fd == -1) || (iVar2 = local_134 + -1, local_134 != 0)) {
local_138 = local_134 + -1;
local_130 = (CConnectedNetConsoleData *)CSocketCreator::GetAcceptedSocketData(this_00,iVar2)
;
__fd = *(int *)local_130;
}
else {
local_130 = (CConnectedNetConsoleData *)(this + 0x13c);
local_138 = -1;
}
sVar3 = recv(__fd,&local_125,1,2);
if (sVar3 == -1) {
cVar1 = SocketWouldBlock();
if (cVar1 == '\0') goto LAB_001a2b69;
}
else if (sVar3 < 1) {
LAB_001a2b69:
if (*(int *)(this + 0x13c) != -1) {
if (local_134 == 0) goto LAB_001a2b10;
local_140 = local_138;
}
LAB_001a2b88:
CSocketCreator::CloseAcceptedSocket(this_00,local_140);
}
else {
ioctl(__fd,0x541b,&local_124);
while (local_124 != 0) {
__n = local_124;
if (0x100 < local_124) {
__n = 0x100;
}
sVar3 = recv(__fd,local_120,__n,0);
if (sVar3 == 0) {
if ((*(int *)(this + 0x13c) == -1) || (local_140 = local_138, local_134 != 0))
goto LAB_001a2b88;
break;
}
if ((sVar3 < 0) && (cVar1 = SocketWouldBlock(), cVar1 == '\0')) break;
local_124 = local_124 - sVar3;
HandleInputChars(this,local_120,sVar3,local_130);
}
}
LAB_001a2b10:
local_134 = local_138;
if (local_138 < 0) break;
__fd = *(int *)(this + 0x13c);
} while( true );
}
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.