This commit is contained in:
Alexander Nell 2020-04-21 18:33:45 +02:00
commit eff33a0076
31 changed files with 125 additions and 153 deletions

View File

@ -3,8 +3,6 @@
namespace ManiaControl\Callbacks\Structures\Common;
use ManiaControl\Callbacks\Structures\Common\BaseStructure;
use ManiaControl\Callbacks\Structures\Common\BaseTimeStructure;
use ManiaControl\ManiaControl;
/**

View File

@ -3,7 +3,6 @@
namespace ManiaControl\Callbacks\Structures\ShootMania;
use ManiaControl\Callbacks\Structures\Common\BaseStructure;
use ManiaControl\Callbacks\Structures\Common\BaseTimeStructure;
use ManiaControl\ManiaControl;

View File

@ -5,8 +5,6 @@ namespace ManiaControl\Callbacks\Structures\Common;
use ManiaControl\Callbacks\Structures\Common\Models\CommonPlayerScore;
use ManiaControl\Callbacks\Structures\ShootMania\Models\TeamScore;
use ManiaControl\General\JsonSerializable;
use ManiaControl\General\JsonSerializeTrait;
use ManiaControl\ManiaControl;
/**

View File

@ -3,7 +3,7 @@
namespace ManiaControl\Callbacks\Structures\ManiaPlanet;
use ManiaControl\Callbacks\Structures\Common\BaseStructure;
use ManiaControl\Callbacks\Structures\Common\BaseTimeStructure;
use ManiaControl\ManiaControl;

View File

@ -2,7 +2,7 @@
namespace ManiaControl\Callbacks\Structures\ShootMania;
use ManiaControl\ManiaControl;
/**
* Structure Class for the OnArmorEmpty Structure Callback

View File

@ -4,8 +4,8 @@ namespace ManiaControl\Callbacks\Structures\ShootMania;
use ManiaControl\Callbacks\Structures\Common\BaseStructure;
use ManiaControl\Callbacks\Structures\ShootMania\Models\Landmark;
use ManiaControl\Callbacks\Structures\ShootMania\Models\Position;
use ManiaControl\ManiaControl;
use ManiaControl\Players\Player;

View File

@ -3,8 +3,8 @@
namespace ManiaControl\Callbacks\Structures\ShootMania;
use ManiaControl\Callbacks\Structures\Common\BaseStructure;
use ManiaControl\ManiaControl;
/**
* Structure Class for the Default Event Structure Callback

View File

@ -3,7 +3,7 @@
namespace ManiaControl\Callbacks\Structures\ShootMania;
use ManiaControl\ManiaControl;
/**
* Structure Class for the OnNearMiss Structure Callback

View File

@ -4,9 +4,7 @@ namespace ManiaControl\Callbacks\Structures\ShootMania;
use ManiaControl\Callbacks\Structures\Common\BasePlayerTimeStructure;
use ManiaControl\Callbacks\Structures\Common\BaseStructure;
use ManiaControl\ManiaControl;
use ManiaControl\Players\Player;
/**
* Structure Class for the OnPlayerRequestRespawnStructure Structure Callback

View File

@ -5,7 +5,7 @@ namespace ManiaControl\Callbacks\Structures\ShootMania;
use ManiaControl\Callbacks\Structures\Common\CommonScoresStructure;
use ManiaControl\Callbacks\Structures\ShootMania\Models\PlayerScore;
use ManiaControl\Callbacks\Structures\ShootMania\Models\TeamScore;
use ManiaControl\ManiaControl;

View File

@ -3,7 +3,7 @@
namespace ManiaControl\Callbacks\Structures\ShootMania;
use ManiaControl\Callbacks\Structures\Common\BaseStructure;
use ManiaControl\Callbacks\Structures\Common\BaseTimeStructure;
use ManiaControl\ManiaControl;
use ManiaControl\Players\Player;

View File

@ -3,7 +3,7 @@
namespace ManiaControl\Callbacks\Structures\ShootMania;
use ManiaControl\Callbacks\Structures\Common\BaseStructure;
use ManiaControl\Callbacks\Structures\Common\BaseTimeStructure;
use ManiaControl\ManiaControl;

View File

@ -3,10 +3,10 @@
namespace ManiaControl\Callbacks\Structures\TrackMania;
use ManiaControl\Callbacks\Structures\Common\BaseStructure;
use ManiaControl\Callbacks\Structures\Common\BaseTimeStructure;
use ManiaControl\Callbacks\Structures\ShootMania\CommonDefaultEventStructure;
use ManiaControl\ManiaControl;
/**
* Structure Class for the Default Event Structure Callback

View File

@ -6,7 +6,7 @@ namespace ManiaControl\Callbacks\Structures\TrackMania;
use ManiaControl\Callbacks\Models\RecordCallback;
use ManiaControl\Callbacks\Structures\Common\BasePlayerTimeStructure;
use ManiaControl\ManiaControl;
use ManiaControl\Utils\Formatter;
/**
* Structure Class for the On Respawn Structure Callback

View File

@ -28,7 +28,7 @@ class MXMapInfo {
*
* @param String $prefix MX URL prefix
* @param $mx
* @return MXMapInfo
* @return \ManiaControl\ManiaExchange\MXMapInfo|void
*/
public function __construct($prefix, $mx) {
$this->prefix = $prefix;

View File

@ -12,7 +12,7 @@ use FML\Controls\Quads\Quad_BgRaceScore2;
use FML\Controls\Quads\Quad_Bgs1InRace;
use FML\Controls\Quads\Quad_BgsPlayerCard;
use FML\Controls\Quads\Quad_Icons64x64_1;
use FML\Controls\Quads\Quad_UIConstruction_Buttons;
use FML\Script\Features\Paging;
use FML\Script\Script;
use ManiaControl\General\UsageInformationAble;

View File

@ -107,7 +107,7 @@ class MapActions implements CommunicationListener, UsageInformationAble {
//TODO message
// Force an EndMap on the MapQueue to set the next Map
$this->maniaControl->getMapManager()->getMapQueue()->endMap(null);
$this->maniaControl->getMapManager()->getMapQueue()->endMap();
// Ignore EndMap on MapQueue
$this->maniaControl->getMapManager()->getMapQueue()->dontQueueNextMapChange();

View File

@ -11,7 +11,6 @@ use FML\Script\Features\Paging;
use FML\Script\Script;
use ManiaControl\Admin\AuthenticationManager;
use ManiaControl\Configurator\ConfiguratorMenu;
use ManiaControl\Files\AsyncHttpRequest;
use ManiaControl\ManiaControl;
use ManiaControl\Manialinks\ManialinkPageAnswerListener;
use ManiaControl\Players\Player;

View File

@ -9,14 +9,12 @@ use ManiaControl\Admin\AuthenticationManager;
use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\Callbacks;
use ManiaControl\Callbacks\Structures\Common\StatusCallbackStructure;
use ManiaControl\Callbacks\Structures\TrackMania\OnPointsRepartitionStructure;
use ManiaControl\Callbacks\TimerListener;
use ManiaControl\Commands\CommandListener;
use ManiaControl\Logger;
use ManiaControl\ManiaControl;
use ManiaControl\Manialinks\ManialinkPageAnswerListener;
use ManiaControl\Players\Player;
use Maniaplanet\DedicatedServer\Xmlrpc\FaultException;
use Maniaplanet\DedicatedServer\Xmlrpc\GameModeException;
/**

View File

@ -11,6 +11,7 @@ use ManiaControl\ManiaControl;
use ManiaControl\Maps\Map;
use Maniaplanet\DedicatedServer\Xmlrpc\GameModeException;
//TODO delete this class
/**
* Class managing Rankings
*
@ -109,7 +110,7 @@ class RankingManager implements CallbackListener, UsageInformationAble {
array_multisort($this->rankings, SORT_DESC, SORT_NUMERIC);
//TODO if Local Records activated-> sort asc
$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::RANKINGSUPDATED, $this->getRankings());
//$this->maniaControl->getCallbackManager()->triggerCallback(Callbacks::RANKINGSUPDATED, $this->getRankings());
}
/**
@ -134,7 +135,7 @@ class RankingManager implements CallbackListener, UsageInformationAble {
return $leaders;
}
// FIXME: $leader doesn't exist
array_push($leaders, $leader);
//array_push($leaders, $leader);
$prev = $score;
}
return null;

View File

@ -5,19 +5,19 @@ namespace ManiaControl\Server;
use FML\Components\CheckBox;
use FML\Controls\Entry;
use FML\Controls\Frame;
use FML\Controls\Label;
use FML\Controls\Labels\Label_Text;
use FML\Controls\Quad;
use FML\Controls\Quads\Quad_Icons64x64_1;
use FML\Script\Features\Paging;
use FML\Script\Script;
use FML\XmlRpc\UIProperties;
use ManiaControl\Admin\AuthenticationManager;
use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\Callbacks;
use ManiaControl\Callbacks\TimerListener;
use ManiaControl\Callbacks\Structures\Common\UIPropertiesBaseStructure;
use ManiaControl\Configurator\Configurator;
use ManiaControl\Configurator\ConfiguratorMenu;
use ManiaControl\Logger;
use ManiaControl\ManiaControl;

View File

@ -3,7 +3,7 @@
namespace ManiaControl\Statistics;
use FML\Controls\Frame;
use FML\Controls\Label;
use FML\Controls\Labels\Label_Text;
use FML\Controls\Quad;
use FML\Controls\Quads\Quad_BgsPlayerCard;
@ -15,7 +15,7 @@ use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\CallbackManager;
use ManiaControl\Callbacks\Callbacks;
use ManiaControl\Commands\CommandListener;
use ManiaControl\Logger;
use ManiaControl\ManiaControl;
use ManiaControl\Manialinks\LabelLine;
use ManiaControl\Manialinks\ManialinkManager;

View File

@ -463,8 +463,7 @@ class UpdateManager implements CallbackListener, CommandListener, TimerListener,
return;
}
$updateInterval = $setting->value;
$this->maniaControl->getTimerManager()->updateTimerListening($this, 'hourlyUpdateCheck', 1000 * 60 * 60, $updateInterval);
$this->maniaControl->getTimerManager()->updateTimerListening($this, 'hourlyUpdateCheck', 1000 * 60 * 60);
}
/**

View File

@ -225,7 +225,7 @@ abstract class Formatter implements UsageInformationAble {
* Make sure the given Text is encoded in UTF-8
*
* @param string $text
* @return string
* @return array|string
*/
public static function utf8($text) {
if (is_array($text)) {

View File

@ -4,7 +4,6 @@ namespace FML\Controls;
use FML\Script\Features\GraphCurve;
use FML\Script\Features\GraphSettings;
use FML\Script\Features\ScriptFeature;
/**
* Graph Control
@ -14,8 +13,7 @@ use FML\Script\Features\ScriptFeature;
* @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
class Graph extends Control
{
class Graph extends Control {
/**
* @var GraphSettings $graphSettings Graph settings
@ -33,8 +31,7 @@ class Graph extends Control
* @api
* @return GraphSettings
*/
public function getSettings()
{
public function getSettings() {
if (!$this->graphSettings) {
$this->createSettings();
}
@ -46,8 +43,7 @@ class Graph extends Control
*
* @return GraphSettings
*/
protected function createSettings()
{
protected function createSettings() {
$this->graphSettings = new GraphSettings($this);
$this->addScriptFeature($this->graphSettings);
return $this->graphSettings;
@ -59,8 +55,7 @@ class Graph extends Control
* @api
* @return GraphCurve[]
*/
public function getCurves()
{
public function getCurves() {
return $this->curves;
}
@ -71,8 +66,7 @@ class Graph extends Control
* @param GraphCurve $curve Curve
* @return static
*/
public function addCurve(GraphCurve $curve)
{
public function addCurve(GraphCurve $curve) {
$curve->setGraph($this);
$this->addScriptFeature($curve);
array_push($this->curves, $curve);
@ -86,8 +80,7 @@ class Graph extends Control
* @param GraphCurve[] $curves Curves
* @return static
*/
public function addCurves(array $curves)
{
public function addCurves(array $curves) {
foreach ($curves as $curve) {
$this->addCurve($curve);
}
@ -97,16 +90,14 @@ class Graph extends Control
/**
* @see Control::getTagName()
*/
public function getTagName()
{
public function getTagName() {
return "graph";
}
/**
* @see Control::getManiaScriptClass()
*/
public function getManiaScriptClass()
{
public function getManiaScriptClass() {
return "CMlGraph";
}

View File

@ -388,8 +388,6 @@ class Paging extends ScriptFeature
$maxPageNumber = $maxPage->getPageNumber();
}
$pagingId = $maxPage->getControl()
->getId(true, true);
$pagingId = Builder::escapeText($maxPage->getControl()
->getId());
$pageLabelId = Builder::EMPTY_STRING;

View File

@ -2,11 +2,9 @@
namespace React\Socket;
use Evenement\EventEmitterInterface;
use React\Stream\ReadableStreamInterface;
use React\Stream\WritableStreamInterface;
interface ConnectionInterface extends ReadableStreamInterface, WritableStreamInterface
{
interface ConnectionInterface extends ReadableStreamInterface, WritableStreamInterface {
public function getRemoteAddress();
}

View File

@ -1,7 +1,5 @@
<?php
use ManiaControl\ManiaControl;
/**
* PHP Unit Test for Custom UI Manager
*

View File

@ -15,7 +15,6 @@ use FML\Controls\Quads\Quad_Icons64x64_1;
use FML\Controls\Quads\Quad_UIConstruction_Buttons;
use FML\ManiaLink;
use FML\Script\Features\KeyAction;
use ManiaControl\Admin\ActionsMenu;
use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\CallbackManager;
use ManiaControl\Callbacks\Callbacks;
@ -37,7 +36,6 @@ use ManiaControl\Settings\SettingManager;
use ManiaControl\Utils\ColorUtil;
use Maniaplanet\DedicatedServer\Structures\VoteRatio;
use Maniaplanet\DedicatedServer\Xmlrpc\ChangeInProgressException;
use Maniaplanet\DedicatedServer\Xmlrpc\FaultException;
use Maniaplanet\DedicatedServer\Xmlrpc\GameModeException;
@ -163,7 +161,7 @@ class CustomVotesPlugin implements SidebarMenuEntryListener, CommandListener, Ca
$this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_SPECTATOR_ALLOW_START_VOTE, true);
$this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_VOTE_TIME, 40);
$this->maniaControl->getManialinkManager()->getSidebarMenuManager()->addMenuEntry(SidebarMenuManager::ORDER_PLAYER_MENU + 5, self::CUSTOMVOTES_MENU_ID,$this,'showIcon');
$this->maniaControl->getManialinkManager()->getSidebarMenuManager()->addMenuEntry(SidebarMenuManager::ORDER_PLAYER_MENU + 5, self::CUSTOMVOTES_MENU_ID, $this, 'showIcon');
//Define Votes
$this->defineVote("teambalance", "Vote for Team Balance");
$this->defineVote("skipmap", "Vote for Skip Map")->setStopCallback(Callbacks::ENDMAP);

View File

@ -10,7 +10,6 @@ use FML\Controls\Quads\Quad_BgRaceScore2;
use FML\Controls\Quads\Quad_BgsPlayerCard;
use FML\ManiaLink;
use FML\Script\Features\Paging;
use ManiaControl\Admin\ActionsMenu;
use ManiaControl\Admin\AuthenticationManager;
use ManiaControl\Bills\BillManager;
use ManiaControl\Callbacks\CallbackListener;
@ -120,7 +119,7 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin, Sideb
// Define player stats
$this->maniaControl->getStatisticManager()->defineStatMetaData(self::STAT_PLAYER_DONATIONS);
$this->maniaControl->getManialinkManager()->getSidebarMenuManager()->addMenuEntry(SidebarMenuManager::ORDER_PLAYER_MENU + 5,self::DONATIONPLUGIN_MENU_ID,$this,'displayDonateWidget');
$this->maniaControl->getManialinkManager()->getSidebarMenuManager()->addMenuEntry(SidebarMenuManager::ORDER_PLAYER_MENU + 5, self::DONATIONPLUGIN_MENU_ID, $this, 'displayDonateWidget');
$this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_DONATE_WIDGET_ACTIVATED, true);
$this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_DONATION_VALUES, "20,50,100,500,1000,2000");

View File

@ -736,7 +736,7 @@ class KarmaPlugin implements CallbackListener, TimerListener, Plugin {
* Get all players votes
*
* @param Map $map
* @return array
* @return array|bool
*/
public function getMapPlayerVotes(Map $map) {
$mysqli = $this->maniaControl->getDatabase()->getMysqli();
@ -893,7 +893,7 @@ class KarmaPlugin implements CallbackListener, TimerListener, Plugin {
* Get the current Votes for the Map
*
* @param Map $map
* @return array
* @return array|bool
*/
public function getMapVotes(Map $map) {
$mysqli = $this->maniaControl->getDatabase()->getMysqli();