Hide old widgets on MC start

This commit is contained in:
Steffen Schröder 2013-12-31 14:50:45 +01:00
parent 98f70cb70b
commit fe3ca728bc

View File

@ -2,7 +2,6 @@
namespace ManiaControl; namespace ManiaControl;
use IXR_Client_Gbx;
use ManiaControl\Admin\ActionsMenu; use ManiaControl\Admin\ActionsMenu;
use ManiaControl\Admin\AuthenticationManager; use ManiaControl\Admin\AuthenticationManager;
use ManiaControl\Callbacks\CallbackManager; use ManiaControl\Callbacks\CallbackManager;
@ -74,7 +73,8 @@ class ManiaControl implements CommandListener {
public $chat = null; public $chat = null;
public $configurator = null; public $configurator = null;
/** /**
* @var IXR_Client_Gbx *
* @var \IXR_ClientMulticall_Gbx
*/ */
public $client = null; public $client = null;
public $commandManager = null; public $commandManager = null;
@ -96,7 +96,7 @@ class ManiaControl implements CommandListener {
* Construct ManiaControl * Construct ManiaControl
*/ */
public function __construct() { public function __construct() {
logMessage('Loading ManiaControl v' . self::VERSION . '...'); $this->log('Loading ManiaControl v' . self::VERSION . '...');
// Load ManiaControl Modules // Load ManiaControl Modules
$this->database = new Database($this); $this->database = new Database($this);
@ -171,7 +171,7 @@ class ManiaControl implements CommandListener {
// Log quit reason // Log quit reason
if ($message) { if ($message) {
logMessage($message); $this->log($message);
} }
// Shutdown // Shutdown
@ -199,7 +199,7 @@ class ManiaControl implements CommandListener {
register_shutdown_function(array($this, 'quit')); register_shutdown_function(array($this, 'quit'));
// Loading finished // Loading finished
logMessage('Loading completed!'); $this->log('Loading completed!');
// Announce ManiaControl // Announce ManiaControl
$this->chat->sendInformation('ManiaControl v' . self::VERSION . ' successfully started!'); $this->chat->sendInformation('ManiaControl v' . self::VERSION . ' successfully started!');
@ -243,7 +243,7 @@ class ManiaControl implements CommandListener {
if (!$host) trigger_error("Invalid server configuration (port).", E_USER_ERROR); if (!$host) trigger_error("Invalid server configuration (port).", E_USER_ERROR);
$port = (string) $port[0]; $port = (string) $port[0];
logMessage("Connecting to server at {$host}:{$port}..."); $this->log("Connecting to server at {$host}:{$port}...");
// Connect // Connect
if (!$this->client->InitWithIp($host, $port, 20)) { if (!$this->client->InitWithIp($host, $port, 20)) {
@ -279,7 +279,10 @@ class ManiaControl implements CommandListener {
} }
// Connect finished // Connect finished
logMessage("Server connection successfully established!"); $this->log("Server Connection successfully established!");
// Hide old widgets
$this->client->query('SendHideManialinkPage');
// Enable script callbacks if needed // Enable script callbacks if needed
if ($this->server->getGameMode() != 0) return; if ($this->server->getGameMode() != 0) return;
@ -294,6 +297,6 @@ class ManiaControl implements CommandListener {
trigger_error("Couldn't set mode script settings to enable script callbacks. " . $this->getClientErrorText()); trigger_error("Couldn't set mode script settings to enable script callbacks. " . $this->getClientErrorText());
return; return;
} }
logMessage('Script callbacks successfully enabled.'); $this->log('Script Callbacks successfully enabled!');
} }
} }