format test

This commit is contained in:
kremsy 2014-01-27 17:29:48 +01:00 committed by Steffen Schröder
parent 6850804d61
commit 4c6a8862d8

View File

@ -14,10 +14,10 @@ use ManiaControl\Players\Player;
use ManiaControl\Players\PlayerManager;
use ManiaControl\Plugins\PluginManager;
use ManiaControl\Server\Server;
use ManiaControl\Settings\SettingManager;
use ManiaControl\Statistics\StatisticManager;
use Maniaplanet\DedicatedServer\Connection;
use Maniaplanet\DedicatedServer\Xmlrpc\Exception;
use ManiaControl\Settings\SettingManager;
require_once __DIR__ . '/Maniaplanet/DedicatedServer/Connection.php';
require_once __DIR__ . '/GbxDataFetcher/gbxdatafetcher.inc.php';
@ -50,9 +50,7 @@ class ManiaControl implements CommandListener {
public $chat = null;
public $config = null;
public $configurator = null;
/**
* @var Connection $client
*/
/** @var Connection $client */
public $client = null;
public $commandManager = null;
public $database = null;
@ -232,8 +230,7 @@ class ManiaControl implements CommandListener {
if($this->getOS(self::OS_UNIX)) {
$command = 'sh ' . escapeshellarg(ManiaControlDir . '/ManiaControl.sh') . ' > /dev/null &';
exec($command);
}
else {
} else {
$command = escapeshellarg(ManiaControlDir . "\ManiaControl.bat");
system($command); // TODO, windows stucks here as long controller is running
}
@ -317,16 +314,14 @@ class ManiaControl implements CommandListener {
try {
$this->client = Connection::factory($host, $port, self::CONNECT_TIMEOUT, $login, $pass);
}
catch (Exception $e) {
} catch(Exception $e) {
trigger_error("Couldn't authenticate on server with user '{$login}'! " . $e->getMessage(), E_USER_ERROR);
}
// Enable callback system
try {
$this->client->enableCallbacks(true);
}
catch (Exception $e) {
} catch(Exception $e) {
trigger_error("Couldn't enable callbacks! " . $e->getMessage(), E_USER_ERROR);
}
@ -354,8 +349,7 @@ class ManiaControl implements CommandListener {
try {
$scriptSettings = $this->client->getModeScriptSettings();
}
catch (Exception $e) {
} catch(Exception $e) {
trigger_error("Couldn't get mode script settings. " . $e->getMessage());
return;
}
@ -367,8 +361,7 @@ class ManiaControl implements CommandListener {
$scriptSettings['S_UseScriptCallbacks'] = true;
try {
$this->client->setModeScriptSettings($scriptSettings);
}
catch (Exception $e) {
} catch(Exception $e) {
trigger_error("Couldn't set mode script settings to enable script callbacks. " . $e->getMessage());
return;
}