MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / OnServerActivate

Method OnServerActivate

core/PlayerManager.cpp:311–351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

309}
310
311void PlayerManager::OnServerActivate(edict_t *pEdictList, int edictCount, int clientMax)
312{
313 static ConVar *tv_enable = icvar->FindVar("tv_enable");
314#if SOURCE_ENGINE == SE_TF2
315 static ConVar *replay_enable = icvar->FindVar("replay_enable");
316#endif
317
318 ICommandLine *commandLine = g_HL2.GetValveCommandLine();
319 m_bIsSourceTVActive = (tv_enable && tv_enable->GetBool() && (!commandLine || commandLine->FindParm("-nohltv") == 0));
320 m_bIsReplayActive = false;
321#if SOURCE_ENGINE == SE_TF2
322 m_bIsReplayActive = (replay_enable && replay_enable->GetBool());
323#endif
324 m_PlayersSinceActive = 0;
325
326 g_OnMapStarted = true;
327 m_bServerActivated = true;
328
329 extsys->CallOnCoreMapStart(pEdictList, edictCount, m_maxClients);
330
331 m_onActivate->Execute(NULL);
332 m_onActivate2->Execute(NULL);
333
334 List<IClientListener *>::iterator iter;
335 for (iter = m_hooks.begin(); iter != m_hooks.end(); iter++)
336 {
337 if ((*iter)->GetClientListenerVersion() >= 5)
338 {
339 (*iter)->OnServerActivated(m_maxClients);
340 }
341 }
342
343 SMGlobalClass *cls = SMGlobalClass::head;
344 while (cls)
345 {
346 cls->OnSourceModLevelActivated();
347 cls = cls->m_pGlobalClassNext;
348 }
349
350 SM_ExecuteAllConfigs();
351}
352
353bool PlayerManager::IsServerActivated()
354{

Callers

nothing calls this directly

Calls 10

SM_ExecuteAllConfigsFunction · 0.85
GetValveCommandLineMethod · 0.80
GetBoolMethod · 0.80
CallOnCoreMapStartMethod · 0.80
ExecuteMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
OnServerActivatedMethod · 0.45

Tested by

no test coverage detected