Merge remote-tracking branch 'origin/master'

This commit is contained in:
Max Klaversma 2014-05-02 16:02:50 +02:00
commit 7469d97712
18 changed files with 39 additions and 24 deletions

View File

@ -179,7 +179,6 @@ class ActionsMenu implements CallbackListener, ManialinkPageAnswerListener {
}
$manialink = new ManiaLink(self::MLID_MENU);
$script = $manialink->getScript();
/*
* Admin Menu

View File

@ -39,7 +39,7 @@ class TimerManager {
}
/**
* Unregisters a Timer Listening
* Unregister a Timer Listening
* @param TimerListener $listener
* @param $method
* @return bool
@ -55,7 +55,7 @@ class TimerManager {
}
/**
* Registers a Timing Listening, note < 10ms it can get inaccurate
* Register a Timing Listening, note < 10ms it can get inaccurate
*
* @param TimerListener $listener
* @param $method

View File

@ -136,7 +136,7 @@ class Chat {
* @return bool
*/
public function sendException(\Exception $exception, $login = null) {
$message = "Exception occured: '{$exception->getMessage()}' ({$exception->getCode()})";
$message = "Exception occurred: '{$exception->getMessage()}' ({$exception->getCode()})";
$this->maniaControl->errorHandler->triggerDebugNotice($message);
$this->sendError($message, $login);
}

View File

@ -3,6 +3,7 @@
namespace ManiaControl\Commands;
use FML\Controls\Frame;
use FML\Controls\Label;
use FML\Controls\Quads\Quad_BgsPlayerCard;
use FML\ManiaLink;
use FML\Script\Features\Paging;
@ -228,7 +229,10 @@ class HelpManager implements CommandListener, CallbackListener {
$array = array($command['Name'] => $x + 5, $command['Description'] => $x + 50);
$labels = $this->maniaControl->manialinkManager->labelLine($playerFrame, $array);
$labels[0]->setWidth(40);
/** @var Label $label */
$label = $labels[0];
$label->setWidth(40);
$y -= 4;
$i++;

View File

@ -234,6 +234,7 @@ class ManiaControlSettings implements ConfiguratorMenu, CallbackListener {
$pageFrame = null;
$index = 0;
$y = 0;
foreach ($settings as $setting) {
if (!$pageFrame) {
$pageFrame = new Frame();

View File

@ -148,7 +148,7 @@ class ScriptSettings implements ConfiguratorMenu, CallbackListener {
try {
$this->maniaControl->client->setModeScriptSettings($loadedSettings);
} catch(Exception $e) {
trigger_error('Error occured: ' . $e->getMessage());
trigger_error('Error occurred: ' . $e->getMessage());
return false;
}
return true;

View File

@ -181,7 +181,7 @@ class ServerSettings implements ConfiguratorMenu, CallbackListener {
$id = 0;
foreach($serverSettings as $name => $value) {
// Continue on CurrentMaxPlayers...
$pos = strpos($name, "Current"); // TODO maybe current irgentwo anzeigen
$pos = strpos($name, "Current"); // TODO maybe display current somewhere
if ($pos !== false) {
continue;
}

View File

@ -36,10 +36,18 @@ class Database implements TimerListener {
$user = $this->maniaControl->config->database->xpath('user');
$pass = $this->maniaControl->config->database->xpath('pass');
if (!$host) trigger_error("Invalid database configuration (host).", E_USER_ERROR);
if (!$port) trigger_error("Invalid database configuration (port).", E_USER_ERROR);
if (!$user) trigger_error("Invalid database configuration (user).", E_USER_ERROR);
if (!$pass) trigger_error("Invalid database configuration (pass).", E_USER_ERROR);
if (!$host) {
trigger_error("Invalid database configuration (host).", E_USER_ERROR);
}
if (!$port) {
trigger_error("Invalid database configuration (port).", E_USER_ERROR);
}
if (!$user) {
trigger_error("Invalid database configuration (user).", E_USER_ERROR);
}
if (!$pass) {
trigger_error("Invalid database configuration (pass).", E_USER_ERROR);
}
$host = (string) $host[0];
$port = (int) $port[0];

View File

@ -71,7 +71,7 @@ class ErrorHandler {
if ($this->maniaControl->settingManager && $this->maniaControl->updateManager) {
$error['UpdateChannel'] = $this->maniaControl->settingManager->getSetting($this->maniaControl->updateManager, UpdateManager::SETTING_UPDATECHECK_CHANNEL);
$error['ManiaControlVersion'] = $this->maniaControl->updateManager->getCurrentBuildDate();
$error['ManiaControlVersion'] = $this->maniaControl->updateManager->getNightlyBuildDate();
}
else {
$error['UpdateChannel'] = '';

View File

@ -1,6 +1,7 @@
<?php
namespace ManiaControl\Files;
use ManiaControl\ManiaControl;
/**
* Backup Utility Class

View File

@ -35,7 +35,7 @@ abstract class Formatter {
}
/**
* Formats a Time to H:M:S
* Format a Time to H:M:S
*
* @param int $seconds
* @return string
@ -54,9 +54,9 @@ abstract class Formatter {
}
/**
* Formatts a Elapset time String (2 days ago...) by a given timestamp
* Format an elapsed time String (2 days ago...) by a given timestamp
*
* @param $ptime
* @param int $ptime
* @return string
*/
public static function time_elapsed_string($ptime) {
@ -79,7 +79,7 @@ abstract class Formatter {
}
/**
* Formats the given Time (Seconds) to hh:mm:ss
* Format the given Time (Seconds) to hh:mm:ss
*
* @param int $seconds
* @return string

View File

@ -79,6 +79,7 @@ class ManiaControl implements CommandListener, TimerListener {
public $server = null;
public $settingManager = null;
public $statisticManager = null;
/** @var UpdateManager $updateManager */
public $updateManager = null;
public $errorHandler = null;
public $timerManager = null;

View File

@ -133,8 +133,6 @@ class ManiaExchangeList implements CallbackListener, ManialinkPageAnswerListener
$paging = new Paging();
$script->addFeature($paging);
$pagesId = 'MxListPages';
// Main frame
$frame = $this->maniaControl->manialinkManager->styleManager->getDefaultListFrame($script, $paging);
$maniaLink->add($frame);
@ -153,7 +151,7 @@ class ManiaExchangeList implements CallbackListener, ManialinkPageAnswerListener
$i = 0;
$y = $height / 2 - 16;
$pageFrames = array();
foreach($maps as $map) { //TODO order possabilities
foreach($maps as $map) { //TODO order possibilities
/** @var MxMapInfo $map */
if (!isset($pageFrame)) {
$pageFrame = new Frame();

View File

@ -84,7 +84,7 @@ class ManiaExchangeManager {
trigger_error($saveMapStatement->error);
}
//Take the uid out of the vektor
//Take the uid out of the vector
if (isset($this->mxIdUidVector[$mxMapInfo->id])) {
$uid = $this->mxIdUidVector[$mxMapInfo->id];
} else {
@ -118,7 +118,7 @@ class ManiaExchangeManager {
*/
public function fetchManiaExchangeMapInformations($map = null) {
if (!$map) {
//Fetch Informations for whole Maplist
//Fetch Information for whole MapList
$maps = $this->maniaControl->mapManager->getMaps();
} else {
//Fetch Information for a single map

View File

@ -121,7 +121,7 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
$queueBuffer = $this->maniaControl->mapManager->mapQueue->getQueueBuffer();
// Get Maps
$mapList = array();
$mapList = null;
$pageCount = null;
if (is_array($maps)) {
$mapList = array_slice($maps, $chunk, self::MAX_PAGES_PER_CHUNK * self::MAX_MAPS_PER_PAGE);

View File

@ -220,7 +220,8 @@ class PluginManager {
continue;
}
array_push($newPluginClasses, $className);
/** @var Plugin $className */
$className::prepare($this->maniaControl);
if ($this->getSavedPluginStatus($className)) {

View File

@ -166,6 +166,7 @@ class PluginUpdateManager implements CallbackListener, CommandListener, TimerLis
if (!isset($pluginsData[$pluginId])) {
continue;
}
/** @var PluginUpdateData $pluginData */
$pluginData = $pluginsData[$pluginId];
$pluginVersion = $pluginClass::getVersion();
if ($pluginData->isNewerThan($pluginVersion)) {
@ -301,6 +302,7 @@ class PluginUpdateManager implements CallbackListener, CommandListener, TimerLis
*/
$pluginId = $pluginClass::getId();
if (isset($pluginsUpdates[$pluginId])) {
/** @var PluginUpdateData $pluginUpdateData */
$pluginUpdateData = $pluginsUpdates[$pluginId];
$pluginVersion = $pluginClass::getVersion();
if ($pluginUpdateData->isNewerThan($pluginVersion)) {

View File

@ -405,7 +405,7 @@ class UpdateManager implements CallbackListener, CommandListener, TimerListener
}
$self = $this;
$this->maniaControl->fileReader->loadFile($updateData->url, function ($updateFileContent, $error) use(&$self, &$updateData, &$player) {
$this->maniaControl->fileReader->loadFile($this->coreUpdateData->url, function ($updateFileContent, $error) use(&$self, &$updateData, &$player) {
$tempDir = FileUtil::getTempFolder();
$updateFileName = $tempDir . basename($updateData->url);