| 210 | } |
| 211 | |
| 212 | void SourceModBase::StartSourceMod(bool late) |
| 213 | { |
| 214 | SH_ADD_HOOK(IServerGameDLL, LevelShutdown, gamedll, SH_MEMBER(this, &SourceModBase::LevelShutdown), false); |
| 215 | SH_ADD_HOOK(IServerGameDLL, GameFrame, gamedll, SH_MEMBER(&g_Timers, &TimerSystem::GameFrame), false); |
| 216 | |
| 217 | enginePatch = SH_GET_CALLCLASS(engine); |
| 218 | gamedllPatch = SH_GET_CALLCLASS(gamedll); |
| 219 | |
| 220 | /* Initialize CoreConfig to get the SourceMod base path properly - this parses core.cfg */ |
| 221 | g_CoreConfig.Initialize(); |
| 222 | |
| 223 | /* Notify! */ |
| 224 | SMGlobalClass *pBase = SMGlobalClass::head; |
| 225 | while (pBase) |
| 226 | { |
| 227 | pBase->OnSourceModStartup(false); |
| 228 | pBase = pBase->m_pGlobalClassNext; |
| 229 | } |
| 230 | g_pGameConf = logicore.GetCoreGameConfig(); |
| 231 | |
| 232 | sCoreProviderImpl.InitializeHooks(); |
| 233 | |
| 234 | /* Notify! */ |
| 235 | pBase = SMGlobalClass::head; |
| 236 | while (pBase) |
| 237 | { |
| 238 | pBase->OnSourceModAllInitialized(); |
| 239 | pBase = pBase->m_pGlobalClassNext; |
| 240 | } |
| 241 | |
| 242 | /* Notify! */ |
| 243 | pBase = SMGlobalClass::head; |
| 244 | while (pBase) |
| 245 | { |
| 246 | pBase->OnSourceModAllInitialized_Post(); |
| 247 | pBase = pBase->m_pGlobalClassNext; |
| 248 | } |
| 249 | |
| 250 | /* Add us now... */ |
| 251 | sharesys->AddInterface(NULL, this); |
| 252 | |
| 253 | /* We're loaded! */ |
| 254 | g_Loaded = true; |
| 255 | |
| 256 | /* Initialize VSP stuff */ |
| 257 | if (vsp_interface != NULL) |
| 258 | { |
| 259 | g_SourceMod_Core.OnVSPListening(vsp_interface); |
| 260 | } |
| 261 | |
| 262 | if (late) |
| 263 | { |
| 264 | /* We missed doing anythin gin this if we late-loaded. Sneak it in now. */ |
| 265 | AllPluginsLoaded(); |
| 266 | } |
| 267 | |
| 268 | /* If we want to autoload, do that now */ |
| 269 | const char *disabled = GetCoreConfigValue("DisableAutoUpdate"); |
nothing calls this directly
no test coverage detected