@@ -186,7 +186,7 @@ bool MultiAddonManager::Load(PluginId id, ISmmAPI *ismm, char *error, size_t max
186
186
funchook_install (g_pHostStateRequestHook, 0 );
187
187
188
188
SH_ADD_HOOK (IServerGameDLL, GameServerSteamAPIActivated, g_pSource2Server, SH_MEMBER (this , &MultiAddonManager::Hook_GameServerSteamAPIActivated), false );
189
- SH_ADD_HOOK (INetworkServerService, StartupServer, g_pNetworkServerService, SH_MEMBER (this , &MultiAddonManager::Hook_StartupServer), false );
189
+ SH_ADD_HOOK (INetworkServerService, StartupServer, g_pNetworkServerService, SH_MEMBER (this , &MultiAddonManager::Hook_StartupServer), true );
190
190
SH_ADD_HOOK (IServerGameClients, ClientConnect, g_pSource2GameClients, SH_MEMBER (this , &MultiAddonManager::Hook_ClientConnect), false );
191
191
SH_ADD_HOOK (IServerGameDLL, GameFrame, g_pSource2Server, SH_MEMBER (this , &MultiAddonManager::Hook_GameFrame), true );
192
192
@@ -212,7 +212,7 @@ bool MultiAddonManager::Unload(char *error, size_t maxlen)
212
212
ClearAddons ();
213
213
214
214
SH_REMOVE_HOOK (IServerGameDLL, GameServerSteamAPIActivated, g_pSource2Server, SH_MEMBER (this , &MultiAddonManager::Hook_GameServerSteamAPIActivated), false );
215
- SH_REMOVE_HOOK (INetworkServerService, StartupServer, g_pNetworkServerService, SH_MEMBER (this , &MultiAddonManager::Hook_StartupServer), false );
215
+ SH_REMOVE_HOOK (INetworkServerService, StartupServer, g_pNetworkServerService, SH_MEMBER (this , &MultiAddonManager::Hook_StartupServer), true );
216
216
SH_REMOVE_HOOK (IServerGameClients, ClientConnect, g_pSource2GameClients, SH_MEMBER (this , &MultiAddonManager::Hook_ClientConnect), false );
217
217
SH_REMOVE_HOOK (IServerGameDLL, GameFrame, g_pSource2Server, SH_MEMBER (this , &MultiAddonManager::Hook_GameFrame), true );
218
218
@@ -410,7 +410,7 @@ void MultiAddonManager::ClearAddons()
410
410
void MultiAddonManager::Hook_GameServerSteamAPIActivated ()
411
411
{
412
412
// This is only intended for dedicated servers
413
- if (!CommandLine ()->FindParm (" -dedicated" ))
413
+ if (!CommandLine ()->HasParm (" -dedicated" ))
414
414
return ;
415
415
416
416
Message (" Steam API Activated\n " );
@@ -627,12 +627,11 @@ ClientJoinInfo_t *GetPendingClient(INetChannel *pNetChan)
627
627
return nullptr ;
628
628
}
629
629
630
- void MultiAddonManager::Hook_StartupServer (const GameSessionConfiguration_t &config, ISource2WorldSession *, const char *)
630
+ void MultiAddonManager::Hook_StartupServer (const GameSessionConfiguration_t &config, ISource2WorldSession *session , const char *mapname )
631
631
{
632
- gpGlobals = g_pEngineServer->GetServerGlobals ();
633
-
634
- Message (" %s: %s\n " , __func__, gpGlobals->mapname );
632
+ Message (" Hook_StartupServer: %s\n " , mapname);
635
633
634
+ gpGlobals = g_pEngineServer->GetServerGlobals ();
636
635
g_pNetworkGameServer = g_pNetworkServerService->GetIGameServer ();
637
636
g_ClientsPendingAddon.RemoveAll ();
638
637
0 commit comments