Refactoring of Code, Comments and Spelling
This commit is contained in:
@ -28,7 +28,7 @@ class ChatlogPlugin implements CallbackListener, Plugin {
|
||||
private $logServerMessages = true;
|
||||
|
||||
/**
|
||||
* Constuct chatlog plugin
|
||||
* Construct chatlog plugin
|
||||
*
|
||||
* @param ManiaControl $maniaControl
|
||||
*/
|
||||
@ -129,7 +129,7 @@ class ChatlogPlugin implements CallbackListener, Plugin {
|
||||
/**
|
||||
* Log the given message
|
||||
*
|
||||
* @param string $message
|
||||
* @param string $text
|
||||
* @param string $login
|
||||
*/
|
||||
private function logText($text, $login = null) {
|
||||
|
@ -168,7 +168,7 @@ class DonationPlugin implements CallbackListener, CommandListener, Plugin {
|
||||
/**
|
||||
* Handle //getplanets command
|
||||
*
|
||||
* @param array $chat
|
||||
* @param array $chatCallback
|
||||
* @param Player $player
|
||||
* @return bool
|
||||
*/
|
||||
|
@ -3,12 +3,10 @@ use ManiaControl\ColorUtil;
|
||||
use ManiaControl\ManiaControl;
|
||||
use ManiaControl\Callbacks\CallbackListener;
|
||||
use ManiaControl\Callbacks\CallbackManager;
|
||||
use ManiaControl\Manialinks\ManialinkUtil;
|
||||
use ManiaControl\Maps\Map;
|
||||
use ManiaControl\Players\Player;
|
||||
use ManiaControl\Plugins\Plugin;
|
||||
use FML\ManiaLink;
|
||||
use FML\Controls\Control;
|
||||
use FML\Controls\Frame;
|
||||
use FML\Controls\Label;
|
||||
use FML\Controls\Quad;
|
||||
@ -226,7 +224,7 @@ class KarmaPlugin implements CallbackListener, Plugin {
|
||||
$vote -= substr_count($message, '-');
|
||||
$success = $this->handleVote($player, $vote);
|
||||
if (!$success) {
|
||||
$this->maniaControl->chat->sendError('Error occured.', $player->login);
|
||||
$this->maniaControl->chat->sendError('Error occurred.', $player->login);
|
||||
return;
|
||||
}
|
||||
$this->maniaControl->chat->sendSuccess('Vote updated!', $player->login);
|
||||
@ -296,7 +294,7 @@ class KarmaPlugin implements CallbackListener, Plugin {
|
||||
PRIMARY KEY (`index`),
|
||||
UNIQUE KEY `player_map_vote` (`mapIndex`, `playerIndex`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Save players map votes' AUTO_INCREMENT=1;";
|
||||
$result = $mysqli->query($query);
|
||||
$mysqli->query($query);
|
||||
if ($mysqli->error) {
|
||||
trigger_error($mysqli->error, E_USER_ERROR);
|
||||
}
|
||||
@ -361,7 +359,8 @@ class KarmaPlugin implements CallbackListener, Plugin {
|
||||
/**
|
||||
* Get the current karma of the map
|
||||
*
|
||||
* @param Map $map
|
||||
* @param Map $map
|
||||
* @return float | bool
|
||||
*/
|
||||
private function getMapKarma(Map $map) {
|
||||
$mysqli = $this->maniaControl->database->mysqli;
|
||||
@ -387,9 +386,10 @@ class KarmaPlugin implements CallbackListener, Plugin {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current votings for the map
|
||||
* Get the current Votes for the Map
|
||||
*
|
||||
* @param Map $map
|
||||
* @param Map $map
|
||||
* @return array
|
||||
*/
|
||||
private function getMapVotes(Map $map) {
|
||||
$mysqli = $this->maniaControl->database->mysqli;
|
||||
|
@ -1,5 +1,4 @@
|
||||
<?php
|
||||
use ManiaControl\Database;
|
||||
use ManiaControl\Formatter;
|
||||
use ManiaControl\ManiaControl;
|
||||
use ManiaControl\Callbacks\CallbackListener;
|
||||
@ -13,7 +12,6 @@ use FML\Controls\Control;
|
||||
use FML\Controls\Frame;
|
||||
use FML\Controls\Label;
|
||||
use FML\Controls\Quad;
|
||||
use FML\Controls\Labels\Label_Text;
|
||||
|
||||
/**
|
||||
* ManiaControl Local Records Plugin
|
||||
@ -214,7 +212,7 @@ class LocalRecordsPlugin implements CallbackListener, Plugin {
|
||||
{$time}
|
||||
) ON DUPLICATE KEY UPDATE
|
||||
`time` = VALUES(`time`);";
|
||||
$result = $mysqli->query($query);
|
||||
$mysqli->query($query);
|
||||
if ($mysqli->error) {
|
||||
trigger_error($mysqli->error);
|
||||
return;
|
||||
@ -222,8 +220,8 @@ class LocalRecordsPlugin implements CallbackListener, Plugin {
|
||||
$this->updateManialink = true;
|
||||
|
||||
// Announce record
|
||||
// TODO: setting für nur-zum-spieler senden
|
||||
// TODO: setting für nur-besten-x-announcen
|
||||
// TODO: setting to send notification only to the player
|
||||
// TODO: setting to send notifications only for x best records
|
||||
$newRecord = $this->getLocalRecord($map, $player);
|
||||
if (!$oldRecord || $newRecord->rank < $oldRecord->rank) {
|
||||
$improvement = 'gained the';
|
||||
@ -257,7 +255,7 @@ class LocalRecordsPlugin implements CallbackListener, Plugin {
|
||||
/**
|
||||
* Handle ClientUpdated callback
|
||||
*
|
||||
* @param array $data
|
||||
* @param array $callback
|
||||
*/
|
||||
public function handleClientUpdated(array $callback) {
|
||||
$this->updateManialink = true;
|
||||
|
@ -84,7 +84,8 @@ class ObstaclePlugin implements CallbackListener, CommandListener, Plugin {
|
||||
/**
|
||||
* Handle JumpTo command
|
||||
*
|
||||
* @param array $chatCallback
|
||||
* @param array $chatCallback
|
||||
* @param Player $player
|
||||
* @return bool
|
||||
*/
|
||||
public function command_JumpTo(array $chatCallback, Player $player) {
|
||||
@ -133,7 +134,7 @@ class ObstaclePlugin implements CallbackListener, CommandListener, Plugin {
|
||||
return;
|
||||
}
|
||||
$time = $data->Run->Time;
|
||||
// Trigger trackmania player finish callback
|
||||
// Trigger Trackmania player finish callback
|
||||
$finishCallback = array($player->pid, $player->login, $time);
|
||||
$finishCallback = array(CallbackManager::CB_TM_PLAYERCHECKPOINT, $finishCallback);
|
||||
$this->maniaControl->callbackManager->triggerCallback(CallbackManager::CB_TM_PLAYERCHECKPOINT, $finishCallback);
|
||||
|
Reference in New Issue
Block a user