Host_StartAsyncServer
0x00177730 · 280 bytes · __cdecl
_Z21Host_StartAsyncServeri
Decompiled
undefined (1 param)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* Host_StartAsyncServer(int) */
void Host_StartAsyncServer(int param_1)
{
pthread_mutexattr_t *__attr;
undefined4 *puVar1;
undefined4 *puVar2;
puVar1 = operator_new(0x18);
puVar1[3] = 1;
*puVar1 = &PTR_AddRef_002b42c8;
puVar1[2] = &PTR__CFunctor1_002b42e4;
puVar1[4] = _Host_RunFrame_Server_Async;
puVar1[5] = param_1;
puVar2 = operator_new(0xcc);
puVar2[2] = 1;
__attr = (pthread_mutexattr_t *)(puVar2 + 0xb);
*puVar2 = &PTR_AddRef_002b4248;
puVar2[1] = &PTR__CJob_002b4274;
puVar2[3] = 4;
puVar2[4] = 1;
pthread_mutexattr_init(__attr);
pthread_mutexattr_settype(__attr,1);
pthread_mutex_init((pthread_mutex_t *)(puVar2 + 5),__attr);
*(undefined1 *)(puVar2 + 0xe) = 0;
*(undefined1 *)((int)puVar2 + 0x39) = 0xff;
puVar2[0xf] = 0xffffffff;
puVar2[0x10] = 0;
/* try { // try from 001777ec to 001777f0 has its CatchHandler @ 00177848 */
CThreadEvent::CThreadEvent((CThreadEvent *)(puVar2 + 0x11),true);
*(undefined1 *)(puVar2 + 0x26) = 0;
*puVar2 = &PTR_AddRef_002b4288;
puVar2[1] = &PTR__CFunctorJob_002b42b4;
puVar2[0x2e] = puVar1;
/* try { // try from 00177824 to 00177828 has its CatchHandler @ 00177872 */
V_strncpy((char *)(puVar2 + 0x2f),"_Host_RunFrame_Server_Async",0x10);
g_pAsyncServerJob = puVar2;
(**(code **)(*_g_pThreadPool + 0x38))(_g_pThreadPool,puVar2);
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.