Added PHPDoc comment to checkPermissions (UpdateManager) and added chatmessages for the Queue

This commit is contained in:
Max Klaversma 2014-01-24 19:46:22 +01:00 committed by Steffen Schröder
parent 1281ed72a6
commit 3c77d8a5a4
2 changed files with 8 additions and 0 deletions

View File

@ -374,6 +374,11 @@ class UpdateManager implements CallbackListener, CommandListener {
return true;
}
/**
* Function checks if ManiaControl has sufficient access to files to update them.
*
* @return bool
*/
private function checkPermissions() {
$writableDirectories = array('core/', 'plugins/');
$path = str_replace('core', '', realpath(dirname(__FILE__)));

View File

@ -202,6 +202,7 @@ class QueuePlugin implements CallbackListener, CommandListener, ManialinkPageAns
public function handleManiaLinkAnswerRemove(array $chatCallback, Player $player) {
$this->removePlayerFromQueue($player);
$this->showJoinQueueWidget($player);
$this->maniaControl->chat->sendChat('$090[Queue] $fff'.$player->nickname.'$z$s$090 has left the queue!');
}
private function moveFirstPlayerToPlay() {
@ -218,12 +219,14 @@ class QueuePlugin implements CallbackListener, CommandListener, ManialinkPageAns
if(isset($this->spectators[$player->login])) unset($this->spectators[$player->login]);
$this->removePlayerFromQueue($player->login);
$this->showPlayWidget($player);
$this->maniaControl->chat->sendChat('$090[Queue] $fff'.$player->nickname.'$z$s$090 has a free spot and is now playing!');
}
}
private function addPlayerToQueue(Player $player) {
if($this->maniaControl->settingManager->getSetting($this, self::QUEUE_MAX) > count($this->queue)) {
$this->queue[count($this->queue)] = $player;
$this->maniaControl->chat->sendChat('$090[Queue] $fff'.$player->nickname.'$z$s$090 has joined the queue!');
}
}