minor spelling & phpdoc improvements

This commit is contained in:
Steffen Schröder 2014-05-13 18:26:38 +02:00
parent 16d2571485
commit 23c58b47ff
10 changed files with 60 additions and 49 deletions

View File

@ -56,7 +56,7 @@ class AdminLists implements ManialinkPageAnswerListener, CallbackListener {
$itemQuad = new Quad_UIConstruction_Buttons(); $itemQuad = new Quad_UIConstruction_Buttons();
$itemQuad->setSubStyle($itemQuad::SUBSTYLE_Author); $itemQuad->setSubStyle($itemQuad::SUBSTYLE_Author);
$itemQuad->setAction(self::ACTION_OPEN_ADMINLISTS); $itemQuad->setAction(self::ACTION_OPEN_ADMINLISTS);
$this->maniaControl->actionsMenu->addMenuItem($itemQuad, false, 50, 'Open Adminlist'); $this->maniaControl->actionsMenu->addMenuItem($itemQuad, false, 50, 'Open AdminList');
} }
/** /**

View File

@ -1,7 +1,9 @@
<?php <?php
namespace ManiaControl\Callbacks; namespace ManiaControl\Callbacks;
//TODO method class for all the libxmlrpc get Methods, to fetch the callback asnyc //TODO method class for all the libxmlrpc get Methods, to fetch the callback asnyc
/** /**
* Callbacks Interface * Callbacks Interface
* *
@ -10,35 +12,41 @@ namespace ManiaControl\Callbacks;
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/ */
interface Callbacks { interface Callbacks {
//Common Callbacks /** Script Callback: CallbackName, CallbackData */
const SCRIPTCALLBACK = 'Callbacks.ScriptCallback'; const SCRIPTCALLBACK = 'Callbacks.ScriptCallback';
/** BeginMatch Callback, param1 MatchNumber */
const BEGINMATCH = "Callbacks.BeginMatch"; /*
/** LoadingMap Callback, Number of Map */ * Common Callbacks
const LOADINGMAP = "Callbacks.LoadingMap"; */
/** BeginMap Callback, triggered by MapManager, param1 Map Object */ /** BeginMatch Callback: MatchNumber */
const BEGINMAP = "Callbacks.BeginMap"; const BEGINMATCH = 'Callbacks.BeginMatch';
/** BeginSubMatch Callback, param1 Number of Submatch */ /** LoadingMap Callback: MapNumber */
const BEGINSUBMATCH = "Callbacks.BeginSubmatch"; const LOADINGMAP = 'Callbacks.LoadingMap';
/** BeginRound Callback, param1 Number of Round */ /** BeginMap Callback: Map */
const BEGINROUND = "Callbacks.BeginRound"; const BEGINMAP = 'Callbacks.BeginMap';
/** BeginTurn Callback, param1 Number of Turn */ /** BeginSubMatch Callback: SubmatchNumber */
const BEGINTURN = "Callbacks.BeginTurn"; const BEGINSUBMATCH = 'Callbacks.BeginSubmatch';
/** EndTurn Callback, param1 Number of Turn */ /** BeginRound Callback: RoundNumber */
const ENDTURN = "Callbacks.EndTurn"; const BEGINROUND = 'Callbacks.BeginRound';
/** EndRound Callback, param1 Number of Round */ /** BeginTurn Callback: TurnNumber */
const ENDROUND = "Callbacks.EndRound"; const BEGINTURN = 'Callbacks.BeginTurn';
/** EndSubMatch Callback, param1 Number of Submatch */ /** EndTurn Callback: TurnNumber */
const ENDSUBMATCH = "Callbacks.EndSubmatch"; const ENDTURN = 'Callbacks.EndTurn';
/** BeginMap Callback, triggered by MapManager, param1 Map Object */ /** EndRound Callback: RoundNumber */
const ENDMAP = "Callbacks.EndMap"; const ENDROUND = 'Callbacks.EndRound';
/** EndMatch Callback, param1 MatchNumber */ /** EndSubmatch Callback: SubmatchNumber */
const ENDMATCH = "Callbacks.EndMatch"; const ENDSUBMATCH = 'Callbacks.EndSubmatch';
/** BeginWarmup Callback, no parameters */ /** EndMap Callback: Map */
const BEGINWARMUP = "Callbacks.BeginWarmUp"; const ENDMAP = 'Callbacks.EndMap';
/** EndWarmup Callback, no parameters */ /** EndMatch Callback: MatchNumber */
const ENDWARMUP = "Callbacks.EndWarmUp"; const ENDMATCH = 'Callbacks.EndMatch';
/** PlayerRanking callback, returned after LibXmlRpc_PlayerRanking
/** BeginWarmup Callback */
const BEGINWARMUP = 'Callbacks.BeginWarmUp';
/** EndWarmup Callback */
const ENDWARMUP = 'Callbacks.EndWarmUp';
/** PlayerRanking Callback, returned after LibXmlRpc_PlayerRanking
* try to avoid to use this, just use the Get function of the RankingsManager instead * try to avoid to use this, just use the Get function of the RankingsManager instead
* param1 Player $player * param1 Player $player
* param2 int $rank * param2 int $rank
@ -46,13 +54,16 @@ interface Callbacks {
* param4 int AFKStatus */ * param4 int AFKStatus */
const PLAYERRANKING = 'Callbacks.PlayerRanking'; const PLAYERRANKING = 'Callbacks.PlayerRanking';
//ShootMania Callbacks /*
/** RankingsUpdated Callback, param1 Sorted Rankings */ * ShootMania Callbacks
*/
/** RankingsUpdated Callback: SortedRankings */
const RANKINGSUPDATED = 'Callbacks.RankingsUpdated'; const RANKINGSUPDATED = 'Callbacks.RankingsUpdated';
/** RankingsUpdated Callback, returned after LibXmlRpc_PlayerRanking param1 Scores */ /** Scores Callback (returned after LibXmlRpc_PlayerRanking): Scores */
const SCORES = 'Callbacks.Scores'; const SCORES = 'Callbacks.Scores';
/** Returns the AFKStatus of an Player, returned after param1 Scores */ //returned after TODO /** Returns the AFKStatus of an Player, returned after param1 Scores */ //returned after TODO
const AFKSTATUS = 'Callbacks.AfkStatus'; const AFKSTATUS = 'Callbacks.AfkStatus';
/** Returns if the GameMode has Warmup activated, returned after param1 Scores */ //returned after TODO /** Returns if the GameMode has Warmup activated, returned after param1 Scores */ //returned after TODO
const WARMUPSTATUS = 'Callbacks.WarmupStatus'; const WARMUPSTATUS = 'Callbacks.WarmupStatus';
} }

View File

@ -754,7 +754,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer
// Set status to target player login // Set status to target player login
$this->playersListShown[$caller->login] = $login; $this->playersListShown[$caller->login] = $login;
// Reopen playerlist // Reopen PlayerList
$this->showPlayerList($caller); $this->showPlayerList($caller);
} }

View File

@ -58,7 +58,7 @@ class ServerCommands implements CallbackListener, CommandListener, ManialinkPage
$this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_ONINIT, $this, 'handleOnInit'); $this->maniaControl->callbackManager->registerCallbackListener(CallbackManager::CB_ONINIT, $this, 'handleOnInit');
// Register for commands // Register for commands
$this->maniaControl->commandManager->registerCommandListener('setservername', $this, 'command_SetServerName', true, 'Sets the servername.'); $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('setpwd', $this, 'command_SetPwd', true, 'Sets play password.');
$this->maniaControl->commandManager->registerCommandListener('setspecpwd', $this, 'command_SetSpecPwd', true, 'Sets spectator 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('setmaxplayers', $this, 'command_SetMaxPlayers', true, 'Sets the maximum number of players.');

View File

@ -20,8 +20,8 @@ class StatisticCollector implements CallbackListener {
* Constants * Constants
*/ */
const SETTING_COLLECT_STATS_ENABLED = 'Collect Stats Enabled'; const SETTING_COLLECT_STATS_ENABLED = 'Collect Stats Enabled';
const SETTING_COLLECT_STATS_MINPLAYERS = 'Minimum Playercount for Collecting Stats'; const SETTING_COLLECT_STATS_MINPLAYERS = 'Minimum Player Count for Collecting Stats';
const SETTING_ON_SHOOT_PRESTORE = 'Prestore Shoots before insert into Database'; const SETTING_ON_SHOOT_PRESTORE = 'Prestore Shots before Insert into Database';
/* /*
* Statistics * Statistics
*/ */

View File

@ -335,7 +335,9 @@ class DedimaniaPlugin implements CallbackListener, CommandListener, TimerListene
} }
/** /**
* Build map info struct for dedimania requests * Build Map Info Array for Dedimania Requests
*
* @return array
*/ */
private function getMapInfo() { private function getMapInfo() {
$map = $this->maniaControl->mapManager->getCurrentMap(); $map = $this->maniaControl->mapManager->getCurrentMap();

View File

@ -449,7 +449,7 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin {
} }
/** /**
* Provide an overview ManiaLink with donators * Provide an Overview ManiaLink with Donators
* *
* @param Player $player * @param Player $player
*/ */

View File

@ -364,11 +364,9 @@ class KarmaPlugin implements CallbackListener, TimerListener, Plugin {
if (!$player) { if (!$player) {
$properties['getvotesonly'] = false; $properties['getvotesonly'] = false;
$properties['playerlogins'] = array(); $properties['playerlogins'] = array();
foreach ($this->maniaControl->playerManager->getPlayers() as $plyr) { foreach ($this->maniaControl->playerManager->getPlayers() as $loopPlayer) {
/** /** @var Player $loopPlayer */
* @var Player $player $properties['playerlogins'][] = $loopPlayer->login;
*/
$properties['playerlogins'][] = $plyr->login;
} }
} else { } else {
$properties['getvotesonly'] = true; $properties['getvotesonly'] = true;
@ -1003,7 +1001,7 @@ class KarmaPlugin implements CallbackListener, TimerListener, Plugin {
} }
/** /**
* Save Mx Karma Votes at Mapend * Save Mx Karma Votes at MapEnd
*/ */
public function sendMxKarmaVotes(Map $map) { public function sendMxKarmaVotes(Map $map) {
if (!$this->maniaControl->settingManager->getSettingValue($this, self::SETTING_MX_KARMA_ACTIVATED)) { if (!$this->maniaControl->settingManager->getSettingValue($this, self::SETTING_MX_KARMA_ACTIVATED)) {

View File

@ -130,8 +130,8 @@ class ServerRankingPlugin implements Plugin, CallbackListener, CommandListener {
$this->maniaControl->callbackManager->registerCallbackListener(Callbacks::ENDMAP, $this, 'handleEndMap'); $this->maniaControl->callbackManager->registerCallbackListener(Callbacks::ENDMAP, $this, 'handleEndMap');
//Register CommandListener //Register CommandListener
$this->maniaControl->commandManager->registerCommandListener('rank', $this, 'command_showRank', false, 'Shows your current serverrank.'); $this->maniaControl->commandManager->registerCommandListener('rank', $this, 'command_showRank', false, 'Shows your current ServerRank.');
$this->maniaControl->commandManager->registerCommandListener('nextrank', $this, 'command_nextRank', false, 'Shows the person in front of you in the serverranking.'); $this->maniaControl->commandManager->registerCommandListener('nextrank', $this, 'command_nextRank', false, 'Shows the person in front of you in the ServerRanking.');
$this->maniaControl->commandManager->registerCommandListener(array('topranks', 'top100'), $this, 'command_topRanks', false, 'Shows an overview of the best-ranked 100 players.'); $this->maniaControl->commandManager->registerCommandListener(array('topranks', 'top100'), $this, 'command_topRanks', false, 'Shows an overview of the best-ranked 100 players.');
$this->resetRanks(); //TODO only update records count $this->resetRanks(); //TODO only update records count
@ -148,7 +148,7 @@ class ServerRankingPlugin implements Plugin, CallbackListener, CommandListener {
`Avg` float NOT NULL default 0, `Avg` float NOT NULL default 0,
KEY `PlayerIndex` (`PlayerIndex`), KEY `PlayerIndex` (`PlayerIndex`),
UNIQUE `Rank` (`Rank`) UNIQUE `Rank` (`Rank`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Mania Control Serverranking';"; ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Mania Control ServerRanking';";
$mysqli->query($query); $mysqli->query($query);
if ($mysqli->error) { if ($mysqli->error) {
trigger_error($mysqli->error, E_USER_ERROR); trigger_error($mysqli->error, E_USER_ERROR);

View File

@ -74,7 +74,7 @@ class ObstaclePlugin implements CallbackListener, CommandListener, Plugin {
* @see \ManiaControl\Plugins\Plugin::getDescription() * @see \ManiaControl\Plugins\Plugin::getDescription()
*/ */
public static function getDescription() { public static function getDescription() {
return "Plugin offering CP Jumping and Local Records Support for the ShootManie Gamemode 'Obstacle'."; return "Plugin offering CP Jumping and Local Records Support for the ShootMania GameMode 'Obstacle'.";
} }
/** /**