SV_ActivateServer
0x001fd320 · 756 bytes · unknown
_Z17SV_ActivateServerv
Decompiled
undefined (0 params)
/* WARNING: Unknown calling convention -- yet parameter storage is locked */
/* SV_ActivateServer() */
undefined4 SV_ActivateServer(void)
{
code *pcVar1;
char *pcVar2;
bool bVar3;
char cVar4;
undefined1 uVar5;
ushort uVar6;
undefined4 uVar7;
int iVar8;
int *piVar9;
uint uVar10;
CGameClient *pCVar11;
CHLTVServer *this;
char *pcVar12;
COM_TimestampedLog("SV_ActivateServer");
COM_TimestampedLog("serverGameDLL->ServerActivate");
bVar3 = (bool)CNetworkStringTableContainer::Lock
((CNetworkStringTableContainer *)networkStringTableContainerServer,false);
pcVar1 = *(code **)(*(int *)g_pServerPluginHandler + 0x10);
uVar7 = CBaseServer::GetMaxClients((CBaseServer *)&sv);
(*pcVar1)(g_pServerPluginHandler,DAT_003b8174,DAT_003b816c,uVar7);
DAT_003b7f64 = 2;
COM_TimestampedLog("SV_CreateBaseline");
SV_CreateBaseline();
DAT_003b8184 = 0;
iVar8 = (**(code **)(*g_pCVar + 0x30))(g_pCVar,"sv_skyname");
if (iVar8 == 0) {
V_strncpy(&DAT_003b7fb0,"unknown",0x40);
}
else {
pcVar12 = "FCVAR_NEVER_AS_STRING";
if ((*(byte *)(iVar8 + 0x15) & 0x10) == 0) {
pcVar2 = *(char **)(*(int *)(iVar8 + 0x1c) + 0x24);
pcVar12 = "";
if (pcVar2 != (char *)0x0) {
pcVar12 = pcVar2;
}
}
V_strncpy(&DAT_003b7fb0,pcVar12,0x40);
}
COM_TimestampedLog("Send Reconnects");
CBaseServer::ReconnectClients((CBaseServer *)&sv);
if (DAT_003b8064 < 2) {
ConDMsg("Game started\n");
}
else {
uVar7 = CBaseServer::GetMaxClients((CBaseServer *)&sv);
ConDMsg("%i player server started\n",uVar7);
}
if (*(int *)(tv_enable._28_4_ + 0x30) == 0) {
uVar6 = Steam3Server();
uVar7 = 0;
CSteam3Server::UpdateSpectatorPort(uVar6);
if (hltv != (CHLTVServer *)0x0) {
(**(code **)(*(int *)hltv + 0x14))(hltv,uVar7);
}
}
else {
piVar9 = (int *)CommandLine_Tier0();
iVar8 = (**(code **)(*piVar9 + 0x28))(piVar9,"-nohltv");
if (iVar8 == 0) {
if (hltv == (CHLTVServer *)0x0) {
this = operator_new(0x8abc);
/* try { // try from 001fd609 to 001fd60d has its CatchHandler @ 001fd634 */
CHLTVServer::CHLTVServer(this);
pcVar1 = *(code **)(*(int *)this + 0x10);
hltv = this;
uVar5 = NET_IsDedicated();
(*pcVar1)(hltv,uVar5);
}
uVar10 = NET_GetUDPPort(2);
uVar10 = uVar10 & 0xffff;
uVar6 = Steam3Server();
CSteam3Server::UpdateSpectatorPort(uVar6);
cVar4 = (**(code **)(*(int *)(hltv + 4) + 0x58))(hltv + 4,uVar10);
if ((cVar4 == '\0') || (cVar4 = (**(code **)(*(int *)hltv + 0x54))(hltv), cVar4 == '\0')) {
pCVar11 = (CGameClient *)CBaseServer::CreateFakeClient((CBaseServer *)&sv,"SourceTV");
CHLTVServer::StartMaster(hltv,pCVar11);
}
else {
(**(code **)(**(int **)(hltv + 0x210) + 0xf4))(*(int **)(hltv + 0x210));
CHLTVServer::StartMaster(hltv,*(CGameClient **)(hltv + 0x210));
}
}
else {
ConMsg("SourceTV is disabled on this server.\n");
}
}
if (DAT_003b8088 != '\0') {
(**(code **)(*(int *)modelloader + 0x30))(modelloader);
}
CNetworkStringTableContainer::Lock
((CNetworkStringTableContainer *)networkStringTableContainerServer,bVar3);
COM_TimestampedLog("SV_ActivateServer(finished)");
SV_ActivateSteamGameServer();
return 1;
}
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.