implemented new setting method
This commit is contained in:
@ -56,7 +56,7 @@ class ScriptManager {
|
||||
} catch (Exception $e) {
|
||||
// TODO temp added 19.04.2014
|
||||
$this->maniaControl->errorHandler->handleException($e, false);
|
||||
trigger_error("Couldn't set Mode Script Settings to {$actionName}able Script Sallbacks. " . $e->getMessage());
|
||||
trigger_error("Couldn't set Mode Script Settings to {$actionName}able Script Callbacks. " . $e->getMessage());
|
||||
return false;
|
||||
}
|
||||
$this->maniaControl->log("Script Callbacks successfully {$actionName}abled!");
|
||||
|
@ -58,11 +58,11 @@ class ServerCommands implements CallbackListener, CommandListener, ManialinkPage
|
||||
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_ONINIT, $this, 'handleOnInit');
|
||||
|
||||
// Register for commands
|
||||
$this->maniaControl->commandManager->registerCommandListener('setpwd', $this, 'command_SetPwd', true, 'Sets play password.');
|
||||
$this->maniaControl->commandManager->registerCommandListener('setservername', $this, 'command_SetServerName', true, 'Sets the servername.');
|
||||
$this->maniaControl->commandManager->registerCommandListener('setpwd', $this, 'command_SetPwd', true, 'Sets play password.');
|
||||
$this->maniaControl->commandManager->registerCommandListener('setspecpwd', $this, 'command_SetSpecPwd', true, 'Sets spectator password.');
|
||||
$this->maniaControl->commandManager->registerCommandListener('setmaxplayers', $this, 'command_SetMaxPlayers', true, 'Sets the maximum number of players.');
|
||||
$this->maniaControl->commandManager->registerCommandListener('setmaxspectators', $this, 'command_SetMaxSpectators', true, 'Sets the maximum number of spectators.');
|
||||
$this->maniaControl->commandManager->registerCommandListener('setspecpwd', $this, 'command_SetSpecPwd', true, 'Sets spectator password.');
|
||||
$this->maniaControl->commandManager->registerCommandListener('shutdownserver', $this, 'command_ShutdownServer', true, 'Shuts down the ManiaPlanet server.');
|
||||
$this->maniaControl->commandManager->registerCommandListener('systeminfo', $this, 'command_SystemInfo', true, 'Shows system information.');
|
||||
|
||||
|
@ -3,10 +3,10 @@
|
||||
namespace ManiaControl\Server;
|
||||
|
||||
use ManiaControl\Callbacks\TimerListener;
|
||||
use ManiaControl\Utils\Formatter;
|
||||
use ManiaControl\ManiaControl;
|
||||
use ManiaControl\Plugins\Plugin;
|
||||
use Maniaplanet\DedicatedServer\Xmlrpc\Exception;
|
||||
use ManiaControl\Utils\Formatter;
|
||||
use Maniaplanet\DedicatedServer\Xmlrpc\NotInScriptModeException;
|
||||
|
||||
/**
|
||||
* Class reporting ManiaControl Usage for the Server
|
||||
@ -46,7 +46,7 @@ class UsageReporter implements TimerListener {
|
||||
* @param float $time
|
||||
*/
|
||||
public function reportUsage($time) {
|
||||
if (!$this->maniaControl->settingManager->getSetting($this, self::SETTING_REPORT_USAGE)) {
|
||||
if (!$this->maniaControl->settingManager->getSettingValue($this, self::SETTING_REPORT_USAGE)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -69,12 +69,8 @@ class UsageReporter implements TimerListener {
|
||||
try {
|
||||
$scriptName = $this->maniaControl->client->getScriptName();
|
||||
$properties['ScriptName'] = $scriptName['CurrentValue'];
|
||||
} catch (Exception $e) {
|
||||
if ($e->getMessage() == 'Not in script mode.') {
|
||||
$properties['ScriptName'] = '';
|
||||
} else {
|
||||
throw $e;
|
||||
}
|
||||
} catch (NotInScriptModeException $e) {
|
||||
$properties['ScriptName'] = '';
|
||||
}
|
||||
|
||||
$activePlugins = array();
|
||||
|
Reference in New Issue
Block a user