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; namespace ManiaControl\Callbacks\Structures\Common;
use ManiaControl\Callbacks\Structures\Common\BaseStructure;
use ManiaControl\Callbacks\Structures\Common\BaseTimeStructure;
use ManiaControl\ManiaControl; use ManiaControl\ManiaControl;
/** /**

View File

@ -3,7 +3,6 @@
namespace ManiaControl\Callbacks\Structures\ShootMania; namespace ManiaControl\Callbacks\Structures\ShootMania;
use ManiaControl\Callbacks\Structures\Common\BaseStructure;
use ManiaControl\Callbacks\Structures\Common\BaseTimeStructure; use ManiaControl\Callbacks\Structures\Common\BaseTimeStructure;
use ManiaControl\ManiaControl; 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\Common\Models\CommonPlayerScore;
use ManiaControl\Callbacks\Structures\ShootMania\Models\TeamScore; use ManiaControl\Callbacks\Structures\ShootMania\Models\TeamScore;
use ManiaControl\General\JsonSerializable;
use ManiaControl\General\JsonSerializeTrait;
use ManiaControl\ManiaControl; use ManiaControl\ManiaControl;
/** /**

View File

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

View File

@ -2,7 +2,7 @@
namespace ManiaControl\Callbacks\Structures\ShootMania; namespace ManiaControl\Callbacks\Structures\ShootMania;
use ManiaControl\ManiaControl;
/** /**
* Structure Class for the OnArmorEmpty Structure Callback * 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\Common\BaseStructure;
use ManiaControl\Callbacks\Structures\ShootMania\Models\Landmark;
use ManiaControl\Callbacks\Structures\ShootMania\Models\Position;
use ManiaControl\ManiaControl; use ManiaControl\ManiaControl;
use ManiaControl\Players\Player; use ManiaControl\Players\Player;

View File

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

View File

@ -3,7 +3,7 @@
namespace ManiaControl\Callbacks\Structures\ShootMania; namespace ManiaControl\Callbacks\Structures\ShootMania;
use ManiaControl\ManiaControl;
/** /**
* Structure Class for the OnNearMiss Structure Callback * 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\BasePlayerTimeStructure;
use ManiaControl\Callbacks\Structures\Common\BaseStructure;
use ManiaControl\ManiaControl;
use ManiaControl\Players\Player;
/** /**
* Structure Class for the OnPlayerRequestRespawnStructure Structure Callback * 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\Common\CommonScoresStructure;
use ManiaControl\Callbacks\Structures\ShootMania\Models\PlayerScore; use ManiaControl\Callbacks\Structures\ShootMania\Models\PlayerScore;
use ManiaControl\Callbacks\Structures\ShootMania\Models\TeamScore;
use ManiaControl\ManiaControl; use ManiaControl\ManiaControl;

View File

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

View File

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

View File

@ -3,10 +3,10 @@
namespace ManiaControl\Callbacks\Structures\TrackMania; 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\Callbacks\Structures\ShootMania\CommonDefaultEventStructure;
use ManiaControl\ManiaControl;
/** /**
* Structure Class for the Default Event Structure Callback * 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\Models\RecordCallback;
use ManiaControl\Callbacks\Structures\Common\BasePlayerTimeStructure; use ManiaControl\Callbacks\Structures\Common\BasePlayerTimeStructure;
use ManiaControl\ManiaControl; use ManiaControl\ManiaControl;
use ManiaControl\Utils\Formatter;
/** /**
* Structure Class for the On Respawn Structure Callback * Structure Class for the On Respawn Structure Callback

View File

@ -28,7 +28,7 @@ class MXMapInfo {
* *
* @param String $prefix MX URL prefix * @param String $prefix MX URL prefix
* @param $mx * @param $mx
* @return MXMapInfo * @return \ManiaControl\ManiaExchange\MXMapInfo|void
*/ */
public function __construct($prefix, $mx) { public function __construct($prefix, $mx) {
$this->prefix = $prefix; $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_Bgs1InRace;
use FML\Controls\Quads\Quad_BgsPlayerCard; use FML\Controls\Quads\Quad_BgsPlayerCard;
use FML\Controls\Quads\Quad_Icons64x64_1; use FML\Controls\Quads\Quad_Icons64x64_1;
use FML\Controls\Quads\Quad_UIConstruction_Buttons;
use FML\Script\Features\Paging; use FML\Script\Features\Paging;
use FML\Script\Script; use FML\Script\Script;
use ManiaControl\General\UsageInformationAble; use ManiaControl\General\UsageInformationAble;

View File

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

View File

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

View File

@ -9,14 +9,12 @@ use ManiaControl\Admin\AuthenticationManager;
use ManiaControl\Callbacks\CallbackListener; use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\Callbacks; use ManiaControl\Callbacks\Callbacks;
use ManiaControl\Callbacks\Structures\Common\StatusCallbackStructure; use ManiaControl\Callbacks\Structures\Common\StatusCallbackStructure;
use ManiaControl\Callbacks\Structures\TrackMania\OnPointsRepartitionStructure;
use ManiaControl\Callbacks\TimerListener; use ManiaControl\Callbacks\TimerListener;
use ManiaControl\Commands\CommandListener; use ManiaControl\Commands\CommandListener;
use ManiaControl\Logger; use ManiaControl\Logger;
use ManiaControl\ManiaControl; use ManiaControl\ManiaControl;
use ManiaControl\Manialinks\ManialinkPageAnswerListener; use ManiaControl\Manialinks\ManialinkPageAnswerListener;
use ManiaControl\Players\Player; use ManiaControl\Players\Player;
use Maniaplanet\DedicatedServer\Xmlrpc\FaultException;
use Maniaplanet\DedicatedServer\Xmlrpc\GameModeException; use Maniaplanet\DedicatedServer\Xmlrpc\GameModeException;
/** /**
@ -30,17 +28,17 @@ class Commands implements CallbackListener, CommandListener, ManialinkPageAnswer
/* /*
* Constants * Constants
*/ */
const ACTION_SET_PAUSE = 'ServerCommands.SetPause'; const ACTION_SET_PAUSE = 'ServerCommands.SetPause';
const ACTION_EXTEND_WARMUP = 'ServerCommands.ExtendWarmup'; const ACTION_EXTEND_WARMUP = 'ServerCommands.ExtendWarmup';
const ACTION_END_WARMUP = 'ServerCommands.EndWarmup'; const ACTION_END_WARMUP = 'ServerCommands.EndWarmup';
const ACTION_CANCEL_VOTE = 'ServerCommands.CancelVote'; const ACTION_CANCEL_VOTE = 'ServerCommands.CancelVote';
const CB_VOTE_CANCELLED = 'ServerCommands.VoteCancelled'; const CB_VOTE_CANCELLED = 'ServerCommands.VoteCancelled';
const SETTING_PERMISSION_CANCEL_VOTE = 'Cancel Vote'; const SETTING_PERMISSION_CANCEL_VOTE = 'Cancel Vote';
const SETTING_PERMISSION_SET_PAUSE = 'Set Pause'; const SETTING_PERMISSION_SET_PAUSE = 'Set Pause';
const SETTING_PERMISSION_HANDLE_WARMUP = 'Handle Warmup'; const SETTING_PERMISSION_HANDLE_WARMUP = 'Handle Warmup';
const SETTING_PERMISSION_SHOW_SYSTEMINFO = 'Show SystemInfo'; const SETTING_PERMISSION_SHOW_SYSTEMINFO = 'Show SystemInfo';
const SETTING_PERMISSION_SHUTDOWN_SERVER = 'Shutdown Server'; const SETTING_PERMISSION_SHUTDOWN_SERVER = 'Shutdown Server';
const SETTING_PERMISSION_CHANGE_SERVERSETTINGS = 'Change ServerSettings'; const SETTING_PERMISSION_CHANGE_SERVERSETTINGS = 'Change ServerSettings';
/* /*
* Private properties * Private properties

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -4,7 +4,6 @@ namespace FML\Controls;
use FML\Script\Features\GraphCurve; use FML\Script\Features\GraphCurve;
use FML\Script\Features\GraphSettings; use FML\Script\Features\GraphSettings;
use FML\Script\Features\ScriptFeature;
/** /**
* Graph Control * Graph Control
@ -14,100 +13,92 @@ use FML\Script\Features\ScriptFeature;
* @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder * @copyright FancyManiaLinks Copyright © 2017 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 * @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 * @var GraphSettings $graphSettings Graph settings
*/ */
protected $graphSettings = null; protected $graphSettings = null;
/** /**
* @var GraphCurve[] $curves Curves * @var GraphCurve[] $curves Curves
*/ */
protected $curves = array(); protected $curves = array();
/** /**
* Get the graph settings * Get the graph settings
* *
* @api * @api
* @return GraphSettings * @return GraphSettings
*/ */
public function getSettings() public function getSettings() {
{ if (!$this->graphSettings) {
if (!$this->graphSettings) { $this->createSettings();
$this->createSettings(); }
} return $this->graphSettings;
return $this->graphSettings; }
}
/** /**
* Create new graph settings * Create new graph settings
* *
* @return GraphSettings * @return GraphSettings
*/ */
protected function createSettings() protected function createSettings() {
{ $this->graphSettings = new GraphSettings($this);
$this->graphSettings = new GraphSettings($this); $this->addScriptFeature($this->graphSettings);
$this->addScriptFeature($this->graphSettings); return $this->graphSettings;
return $this->graphSettings; }
}
/** /**
* Get curves * Get curves
* *
* @api * @api
* @return GraphCurve[] * @return GraphCurve[]
*/ */
public function getCurves() public function getCurves() {
{ return $this->curves;
return $this->curves; }
}
/** /**
* Add curve * Add curve
* *
* @api * @api
* @param GraphCurve $curve Curve * @param GraphCurve $curve Curve
* @return static * @return static
*/ */
public function addCurve(GraphCurve $curve) public function addCurve(GraphCurve $curve) {
{ $curve->setGraph($this);
$curve->setGraph($this); $this->addScriptFeature($curve);
$this->addScriptFeature($curve); array_push($this->curves, $curve);
array_push($this->curves, $curve); return $this;
return $this; }
}
/** /**
* Add curves * Add curves
* *
* @api * @api
* @param GraphCurve[] $curves Curves * @param GraphCurve[] $curves Curves
* @return static * @return static
*/ */
public function addCurves(array $curves) public function addCurves(array $curves) {
{ foreach ($curves as $curve) {
foreach ($curves as $curve) { $this->addCurve($curve);
$this->addCurve($curve); }
} return $this;
return $this; }
}
/** /**
* @see Control::getTagName() * @see Control::getTagName()
*/ */
public function getTagName() public function getTagName() {
{ return "graph";
return "graph"; }
}
/** /**
* @see Control::getManiaScriptClass() * @see Control::getManiaScriptClass()
*/ */
public function getManiaScriptClass() public function getManiaScriptClass() {
{ return "CMlGraph";
return "CMlGraph"; }
}
} }

View File

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

View File

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

View File

@ -1,7 +1,5 @@
<?php <?php
use ManiaControl\ManiaControl;
/** /**
* PHP Unit Test for Custom UI Manager * 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\Controls\Quads\Quad_UIConstruction_Buttons;
use FML\ManiaLink; use FML\ManiaLink;
use FML\Script\Features\KeyAction; use FML\Script\Features\KeyAction;
use ManiaControl\Admin\ActionsMenu;
use ManiaControl\Callbacks\CallbackListener; use ManiaControl\Callbacks\CallbackListener;
use ManiaControl\Callbacks\CallbackManager; use ManiaControl\Callbacks\CallbackManager;
use ManiaControl\Callbacks\Callbacks; use ManiaControl\Callbacks\Callbacks;
@ -37,7 +36,6 @@ use ManiaControl\Settings\SettingManager;
use ManiaControl\Utils\ColorUtil; use ManiaControl\Utils\ColorUtil;
use Maniaplanet\DedicatedServer\Structures\VoteRatio; use Maniaplanet\DedicatedServer\Structures\VoteRatio;
use Maniaplanet\DedicatedServer\Xmlrpc\ChangeInProgressException; use Maniaplanet\DedicatedServer\Xmlrpc\ChangeInProgressException;
use Maniaplanet\DedicatedServer\Xmlrpc\FaultException;
use Maniaplanet\DedicatedServer\Xmlrpc\GameModeException; 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_SPECTATOR_ALLOW_START_VOTE, true);
$this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_VOTE_TIME, 40); $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 //Define Votes
$this->defineVote("teambalance", "Vote for Team Balance"); $this->defineVote("teambalance", "Vote for Team Balance");
$this->defineVote("skipmap", "Vote for Skip Map")->setStopCallback(Callbacks::ENDMAP); $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\Controls\Quads\Quad_BgsPlayerCard;
use FML\ManiaLink; use FML\ManiaLink;
use FML\Script\Features\Paging; use FML\Script\Features\Paging;
use ManiaControl\Admin\ActionsMenu;
use ManiaControl\Admin\AuthenticationManager; use ManiaControl\Admin\AuthenticationManager;
use ManiaControl\Bills\BillManager; use ManiaControl\Bills\BillManager;
use ManiaControl\Callbacks\CallbackListener; use ManiaControl\Callbacks\CallbackListener;
@ -120,7 +119,7 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin, Sideb
// Define player stats // Define player stats
$this->maniaControl->getStatisticManager()->defineStatMetaData(self::STAT_PLAYER_DONATIONS); $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_DONATE_WIDGET_ACTIVATED, true);
$this->maniaControl->getSettingManager()->initSetting($this, self::SETTING_DONATION_VALUES, "20,50,100,500,1000,2000"); $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 * Get all players votes
* *
* @param Map $map * @param Map $map
* @return array * @return array|bool
*/ */
public function getMapPlayerVotes(Map $map) { public function getMapPlayerVotes(Map $map) {
$mysqli = $this->maniaControl->getDatabase()->getMysqli(); $mysqli = $this->maniaControl->getDatabase()->getMysqli();
@ -893,7 +893,7 @@ class KarmaPlugin implements CallbackListener, TimerListener, Plugin {
* Get the current Votes for the Map * Get the current Votes for the Map
* *
* @param Map $map * @param Map $map
* @return array * @return array|bool
*/ */
public function getMapVotes(Map $map) { public function getMapVotes(Map $map) {
$mysqli = $this->maniaControl->getDatabase()->getMysqli(); $mysqli = $this->maniaControl->getDatabase()->getMysqli();