Disabled //restart , restored backwards compatibility for the backend on restart

This commit is contained in:
Alexander Nell
2020-04-26 09:47:33 +02:00
parent c04f39a056
commit 9dc455774f
4 changed files with 39 additions and 12 deletions

View File

@ -228,6 +228,7 @@ class ManiaControl implements CallbackListener, CommandListener, TimerListener,
// Commands
$this->getCommandManager()->registerCommandListener('version', $this, 'commandVersion', false, 'Shows ManiaControl version.');
$this->getCommandManager()->registerCommandListener('reboot', $this, 'commandReboot', true, 'Reboots ManiaControl.');
$this->getCommandManager()->registerCommandListener('restart', $this, 'commandRestart', true, 'Restarts ManiaControl.');
$this->getCommandManager()->registerCommandListener('shutdown', $this, 'commandShutdown', true, 'Shuts ManiaControl down.');
// Check connection every 30 seconds
@ -549,6 +550,30 @@ class ManiaControl implements CallbackListener, CommandListener, TimerListener,
$this->reboot("ManiaControl Reboot requested by '{$player->login}'!");
}
/**
* Handle Restart AdminCommand
*
* @param array $chatCallback
* @param Player $player
*/
public function commandRestart(array $chatCallback, Player $player) {
if (!$this->getAuthenticationManager()->checkPermission($player, self::SETTING_PERMISSION_REBOOT)) {
$this->getAuthenticationManager()->sendNotAllowed($player);
return;
}
$this->getChat->sendError('The command //restart got disabled, reboot ManiaControl with //reboot instead', $player);
}
/**
* @deprecated
* Restart ManiaControl
*
* @param string $message
*/
public function restart($message = null) {
$this->reboot($message);
}
/**
* Reboot ManiaControl
*