php 5.3 compatibility

This commit is contained in:
kremsy 2014-03-13 18:51:58 +01:00 committed by Steffen Schröder
parent 79a771583e
commit 7dd88a2e18
2 changed files with 5 additions and 3 deletions

View File

@ -75,10 +75,10 @@ class UsageReporter implements TimerListener {
$activePlugins = array();
if(is_array($this->maniaControl->pluginManager->getActivePlugins())) {
if (is_array($this->maniaControl->pluginManager->getActivePlugins())) {
foreach($this->maniaControl->pluginManager->getActivePlugins() as $plugin) {
/** @var Plugin $plugin */
if(!is_null($plugin::getId()) && is_numeric($plugin::getId())) {
if (!is_null($plugin::getId()) && is_numeric($plugin::getId())) {
$activePlugins[] = $plugin::getId();
}
}

View File

@ -65,10 +65,12 @@ class ServerRankingPlugin implements Plugin, CallbackListener, CommandListener {
$maniaControl->settingManager->initSetting($this, self::SETTING_MIN_REQUIRED_RECORDS, 3);
$maniaControl->settingManager->initSetting($this, self::SETTING_MAX_STORED_RECORDS, 50);
$script = $this->maniaControl->client->getScriptName();
if ($this->maniaControl->mapManager->getCurrentMap()->getGame() == 'tm') {
//TODO also add obstacle here as default
$maniaControl->settingManager->initSetting($this, self::SETTING_MIN_RANKING_TYPE, self::RANKING_TYPE_RECORDS);
} else if ($this->maniaControl->client->getScriptName()["CurrentValue"] == "InstaDM.Script.txt") {
} else if ($script["CurrentValue"] == "InstaDM.Script.txt") {
$maniaControl->settingManager->initSetting($this, self::SETTING_MIN_RANKING_TYPE, self::RANKING_TYPE_RATIOS);
} else {
$maniaControl->settingManager->initSetting($this, self::SETTING_MIN_RANKING_TYPE, self::RANKING_TYPE_POINTS);