Added PHPDoc comment to checkPermissions (UpdateManager) and added chatmessages for the Queue
This commit is contained in:
		
				
					committed by
					
						
						Steffen Schröder
					
				
			
			
				
	
			
			
			
						parent
						
							1281ed72a6
						
					
				
				
					commit
					3c77d8a5a4
				
			@@ -374,6 +374,11 @@ class UpdateManager implements CallbackListener, CommandListener {
 | 
				
			|||||||
		return true;
 | 
							return true;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Function checks if ManiaControl has sufficient access to files to update them.
 | 
				
			||||||
 | 
					     * 
 | 
				
			||||||
 | 
					     * @return bool
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
    private function checkPermissions() {
 | 
					    private function checkPermissions() {
 | 
				
			||||||
        $writableDirectories = array('core/', 'plugins/');
 | 
					        $writableDirectories = array('core/', 'plugins/');
 | 
				
			||||||
        $path                = str_replace('core', '', realpath(dirname(__FILE__)));
 | 
					        $path                = str_replace('core', '', realpath(dirname(__FILE__)));
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -202,6 +202,7 @@ class QueuePlugin implements CallbackListener, CommandListener, ManialinkPageAns
 | 
				
			|||||||
    public function handleManiaLinkAnswerRemove(array $chatCallback, Player $player) {
 | 
					    public function handleManiaLinkAnswerRemove(array $chatCallback, Player $player) {
 | 
				
			||||||
        $this->removePlayerFromQueue($player);
 | 
					        $this->removePlayerFromQueue($player);
 | 
				
			||||||
        $this->showJoinQueueWidget($player);
 | 
					        $this->showJoinQueueWidget($player);
 | 
				
			||||||
 | 
					        $this->maniaControl->chat->sendChat('$090[Queue] $fff'.$player->nickname.'$z$s$090 has left the queue!');
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private function moveFirstPlayerToPlay() {
 | 
					    private function moveFirstPlayerToPlay() {
 | 
				
			||||||
@@ -218,12 +219,14 @@ class QueuePlugin implements CallbackListener, CommandListener, ManialinkPageAns
 | 
				
			|||||||
            if(isset($this->spectators[$player->login])) unset($this->spectators[$player->login]);
 | 
					            if(isset($this->spectators[$player->login])) unset($this->spectators[$player->login]);
 | 
				
			||||||
            $this->removePlayerFromQueue($player->login);
 | 
					            $this->removePlayerFromQueue($player->login);
 | 
				
			||||||
            $this->showPlayWidget($player);
 | 
					            $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) {
 | 
					    private function addPlayerToQueue(Player $player) {
 | 
				
			||||||
        if($this->maniaControl->settingManager->getSetting($this, self::QUEUE_MAX) > count($this->queue)) {
 | 
					        if($this->maniaControl->settingManager->getSetting($this, self::QUEUE_MAX) > count($this->queue)) {
 | 
				
			||||||
            $this->queue[count($this->queue)] = $player;
 | 
					            $this->queue[count($this->queue)] = $player;
 | 
				
			||||||
 | 
					            $this->maniaControl->chat->sendChat('$090[Queue] $fff'.$player->nickname.'$z$s$090 has joined the queue!');
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user