SV_InitGameDLL
0x001fc170 · 609 bytes · unknown
_Z14SV_InitGameDLLv
Decompiled
undefined (0 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* WARNING: Unknown calling convention -- yet parameter storage is locked */
/* SV_InitGameDLL() */
void SV_InitGameDLL(void)
{
char cVar1;
int *piVar2;
int iVar3;
ServerClass *pSVar4;
int iVar5;
longdouble lVar6;
double dVar7;
COM_TimestampedLog("SV_InitGameDLL");
Cbuf_Execute();
if (DAT_003b8185 == '\0') {
if (serverGameDLL != (int *)0x0) {
DAT_003b8185 = 1;
COM_TimestampedLog("serverGameDLL->DLLInit - Start");
cVar1 = (**(code **)*serverGameDLL)
(serverGameDLL,g_GameSystemFactory,g_AppSystemFactory,g_AppSystemFactory,
g_ServerGlobalVariables);
if (cVar1 == '\0') {
Sys_Error("serverGameDLL->DLLInit() failed.\n");
}
COM_TimestampedLog("serverGameDLL->DLLInit - Finish");
piVar2 = (int *)CommandLine_Tier0();
iVar3 = (**(code **)(*piVar2 + 0x28))(piVar2,"-NoLoadPluginsForClient");
if (iVar3 == 0) {
CServerPlugin::LoadPlugins((CServerPlugin *)g_pServerPluginHandler);
}
Host_EnsureHostNameSet();
sv_noclipduringpause = (**(code **)(*g_pCVar + 0x30))(g_pCVar,"sv_noclipduringpause");
COM_TimestampedLog("SV_InitSendTables");
pSVar4 = (ServerClass *)(**(code **)(*serverGameDLL + 0x28))(serverGameDLL);
SV_InitSendTables(pSVar4);
lVar6 = (longdouble)(**(code **)(*serverGameDLL + 0x24))(serverGameDLL);
DAT_003a1730 = (float)lVar6;
dVar7 = (double)DAT_003a1730;
if ((dVar7 < 0.001) || (0.1 < dVar7)) {
Sys_Error("GetTickInterval returned bogus tick interval (%f)[%f to %f is valid range]",dVar7
,0x3f50624dd2f1a9fc,0x3fb999999999999a);
}
iVar3 = (**(code **)(*serverGameClients + 0x44))(serverGameClients);
iVar5 = 4;
if (iVar3 < 5) {
iVar3 = (**(code **)(*serverGameClients + 0x44))(serverGameClients);
iVar5 = 1;
if (0 < iVar3) {
iVar5 = (**(code **)(*serverGameClients + 0x44))(serverGameClients);
}
}
DAT_003a1734 = iVar5;
_DAT_003a1738 = iVar5;
piVar2 = (int *)CommandLine_Tier0();
iVar3 = (**(code **)(*piVar2 + 0xc))(piVar2,"-tools",0);
if (iVar3 == 0) {
if (1 < DAT_003a1734) {
Msg("Game supporting (%d) split screen players\n",DAT_003a1734);
}
}
else {
Msg("Clamping split screen users to 1 due to -tools mode\n");
DAT_003a1734 = 1;
}
(**(code **)(*g_pCVar + 0x68))(g_pCVar,DAT_003a1734);
CGameServer::InitMaxClients((CGameServer *)&sv);
Cbuf_Execute();
return;
}
Warning("Failed to load server binary\n");
}
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.