- changed "xsuperadmin" to "masteradmin"

- added tm2 server config data
- various server admin commands
- minor other improvements
This commit is contained in:
Steffen Schröder
2013-11-24 23:55:54 +01:00
parent a9b1842a6f
commit 33001ef573
6 changed files with 172 additions and 41 deletions

View File

@ -4,9 +4,11 @@ namespace ManiaControl;
use ManiaControl\Admin\AuthenticationManager;
use ManiaControl\Callbacks\CallbackManager;
use ManiaControl\Commands\CommandListener;
use ManiaControl\Commands\CommandManager;
use ManiaControl\Manialinks\ManialinkIdHandler;
use ManiaControl\Maps\MapManager;
use ManiaControl\Players\Player;
use ManiaControl\Players\PlayerManager;
use ManiaControl\Plugins\PluginManager;
use ManiaControl\Server\Server;
@ -42,7 +44,7 @@ else {
*
* @author steeffeen & kremsy
*/
class ManiaControl {
class ManiaControl implements CommandListener {
/**
* Constants
*/
@ -86,6 +88,8 @@ class ManiaControl {
$this->playerManager = new PlayerManager($this);
$this->mapManager = new MapManager($this);
$this->pluginManager = new PluginManager($this);
$this->commandManager->registerCommandListener('version', $this, 'command_Version');
}
/**
@ -101,6 +105,17 @@ class ManiaControl {
return $this->client->getErrorMessage() . ' (' . $this->client->getErrorCode() . ')';
}
/**
* Send ManiaControl version
*
* @param array $chat
* @return bool
*/
public function command_Version(array $chat, Player $player) {
$message = 'This server is using ManiaControl v' . ManiaControl::VERSION . '!';
return $this->chat->sendInformation($message, $player->login);
}
/**
* Quit ManiaControl and log the given message
*
@ -211,7 +226,7 @@ class ManiaControl {
}
// Wait for server to be ready
if (!$this->server->waitForStatus($this->client, 4)) {
if (!$this->server->waitForStatus(4)) {
trigger_error("Server couldn't get ready!", E_USER_ERROR);
}