GCSDK::CGCClient::OnGCMessageAvailable
0x0005e670 · 398 bytes · __cdecl
_ZN5GCSDK9CGCClient20OnGCMessageAvailableEP20GCMessageAvailable_t
Decompiled
undefined (1 param)
/* GCSDK::CGCClient::OnGCMessageAvailable(GCMessageAvailable_t*) */
void GCSDK::CGCClient::OnGCMessageAvailable(GCMessageAvailable_t *param_1)
{
int *piVar1;
char cVar2;
size_t __size;
uint *puVar3;
int iVar4;
CNetPacket *this;
size_t sVar5;
uint local_3c;
uint local_38;
uint local_34;
undefined4 local_30;
undefined4 local_2c;
undefined4 local_28;
undefined4 local_24;
undefined4 local_20;
while( true ) {
piVar1 = *(int **)(param_1 + 0x18);
if (piVar1 == (int *)0x0) {
return;
}
cVar2 = (**(code **)(*piVar1 + 4))(piVar1,&local_3c);
if (cVar2 == '\0') break;
sVar5 = *(size_t *)(param_1 + 0x20);
__size = local_3c + 0xc;
if (((int)sVar5 < (int)__size) && (-1 < *(int *)(param_1 + 0x24))) {
*(size_t *)(param_1 + 0x20) = __size;
if (*(void **)(param_1 + 0x1c) == (void *)0x0) {
puVar3 = malloc(__size);
*(uint **)(param_1 + 0x1c) = puVar3;
sVar5 = __size;
}
else {
puVar3 = realloc(*(void **)(param_1 + 0x1c),__size);
*(uint **)(param_1 + 0x1c) = puVar3;
sVar5 = *(size_t *)(param_1 + 0x20);
}
}
else {
puVar3 = *(uint **)(param_1 + 0x1c);
}
iVar4 = (**(code **)(**(int **)(param_1 + 0x18) + 8))
(*(int **)(param_1 + 0x18),&local_38,puVar3 + 3,sVar5,&local_3c);
if (iVar4 == 0) {
puVar3[1] = 0;
puVar3[2] = 0;
*puVar3 = local_38;
g_cNetPacket = g_cNetPacket + 1;
this = (CNetPacket *)
CUtlMemoryPool::Alloc((CUtlMemoryPool *)CNetPacketPool::sm_MemPoolNetPacket);
if (this != (CNetPacket *)0x0) {
CNetPacket::CNetPacket(this);
}
CNetPacket::Init(this,(uchar *)puVar3,__size,(uchar *)0x0);
local_24 = *(undefined4 *)((int)puVar3 + 0x12);
local_28 = *(undefined4 *)((int)puVar3 + 0xe);
local_2c = *(undefined4 *)((int)puVar3 + 0x1a);
local_30 = *(undefined4 *)((int)puVar3 + 0x16);
local_34 = local_38;
local_20 = 2;
CJobMgr::BRouteMsgToJob((CJobMgr *)(param_1 + 0x28),param_1,this,(JobMsgInfo_t *)&local_34);
CMessageList::TallySendmessage((CMessageList *)g_theMessageList,local_38,local_3c);
CNetPacket::Release(this);
}
}
return;
}
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.