diff --git a/application/core/ManiaControl.php b/application/core/ManiaControl.php index ec6c378d..a7d9f195 100644 --- a/application/core/ManiaControl.php +++ b/application/core/ManiaControl.php @@ -84,8 +84,8 @@ class ManiaControl implements CommandListener { $this->chat = new Chat($this); $this->commandManager = new CommandManager($this); $this->server = new Server($this); - $this->authenticationManager = new AuthenticationManager($this); $this->playerManager = new PlayerManager($this); + $this->authenticationManager = new AuthenticationManager($this); $this->mapManager = new MapManager($this); $this->pluginManager = new PluginManager($this); diff --git a/application/core/Maps/MapManager.php b/application/core/Maps/MapManager.php index 13438184..a352a25e 100644 --- a/application/core/Maps/MapManager.php +++ b/application/core/Maps/MapManager.php @@ -44,6 +44,7 @@ class MapManager implements CallbackListener { $this->mapCommands = new MapCommands($maniaControl); // Register for callbacks + $this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MC_ONINIT, $this, 'handleOnInit'); $this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_MC_BEGINMAP, $this, 'handleBeginMap'); } @@ -138,6 +139,19 @@ class MapManager implements CallbackListener { return $map; } + /** + * Handle OnInit callback + * + * @param array $callback + */ + public function handleOnInit(array $callback) { + $map = $this->getCurrentMap(); + if (!$map) { + return; + } + $this->addMap($map); + } + /** * Handle BeginMap callback * diff --git a/application/plugins/Endurance.php b/application/plugins/Endurance.php index 835c082e..f9cf75a8 100644 --- a/application/plugins/Endurance.php +++ b/application/plugins/Endurance.php @@ -9,7 +9,7 @@ use ManiaControl\Plugins\Plugin; * * @author steeffeen */ -class Endurance_Plugin extends Plugin implements CallbackListener { +class EndurancePlugin extends Plugin implements CallbackListener { /** * Constants */