| 
						
					 | 
					 | 
					@@ -164,12 +164,16 @@ class Commands implements CallbackListener, CommandListener, ManialinkPageAnswer
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								return;
 | 
					 | 
					 | 
					 | 
								return;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							}
 | 
					 | 
					 | 
					 | 
							}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if ($this->maniaControl->getClient()->cancelVote()) {
 | 
					 | 
					 | 
					 | 
							if (!$this->maniaControl->getClient()->cancelVote()) {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								$this->maniaControl->getChat()->sendInformation($player->getEscapedNickname() . ' cancelled the Vote!');
 | 
					 | 
					 | 
					 | 
								$this->maniaControl->getChat()->sendError("There is no vote running currently!", $player);
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							} else {
 | 
					 | 
					 | 
					 | 
								return;
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								$this->maniaControl->getChat()->sendInformation("There's no vote running currently!", $player);
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							}
 | 
					 | 
					 | 
					 | 
							}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							$message = $this->maniaControl->getChat()->formatMessage(
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								'%s cancelled the Vote!',
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								$player
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							$this->maniaControl->getChat()->sendInformation($message);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$this->maniaControl->getCallbackManager()->triggerCallback(self::CB_VOTE_CANCELLED, $player);
 | 
					 | 
					 | 
					 | 
							$this->maniaControl->getCallbackManager()->triggerCallback(self::CB_VOTE_CANCELLED, $player);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						}
 | 
					 | 
					 | 
					 | 
						}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					
					| 
						
					 | 
					 | 
					@@ -186,10 +190,21 @@ class Commands implements CallbackListener, CommandListener, ManialinkPageAnswer
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								return;
 | 
					 | 
					 | 
					 | 
								return;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							}
 | 
					 | 
					 | 
					 | 
							}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							//TODO command paprameter for seconds
 | 
					 | 
					 | 
					 | 
							$extension = 10;
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$this->maniaControl->getModeScriptEventManager()->extendManiaPlanetWarmup(10);
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$this->maniaControl->getChat()->sendInformation($player->getEscapedNickname() . ' extended the WarmUp by 10 seconds!');
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							$params = explode(' ', $chat[1][2]);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							if (count($params) >= 2) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								$extension = $params[1];
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							$this->maniaControl->getModeScriptEventManager()->extendManiaPlanetWarmup($extension);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							$message = $this->maniaControl->getChat()->formatMessage(
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								'%s extended the WarmUp by %s seconds!',
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								$player,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								$extension
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							$this->maniaControl->getChat()->sendInformation($message);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						}
 | 
					 | 
					 | 
					 | 
						}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						/**
 | 
					 | 
					 | 
					 | 
						/**
 | 
				
			
			
		
	
	
		
		
			
				
					
					| 
						
					 | 
					 | 
					@@ -205,7 +220,11 @@ class Commands implements CallbackListener, CommandListener, ManialinkPageAnswer
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							}
 | 
					 | 
					 | 
					 | 
							}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$this->maniaControl->getModeScriptEventManager()->stopManiaPlanetWarmup();
 | 
					 | 
					 | 
					 | 
							$this->maniaControl->getModeScriptEventManager()->stopManiaPlanetWarmup();
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$this->maniaControl->getChat()->sendInformation($player->getEscapedNickname() . ' stopped the WarmUp!');
 | 
					 | 
					 | 
					 | 
							$message = $this->maniaControl->getChat()->formatMessage(
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								'%s stopped the WarmUp!',
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								$player
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							$this->maniaControl->getChat()->sendInformation($message);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						}
 | 
					 | 
					 | 
					 | 
						}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						/**
 | 
					 | 
					 | 
					 | 
						/**
 | 
				
			
			
		
	
	
		
		
			
				
					
					| 
						
					 | 
					 | 
					@@ -220,17 +239,22 @@ class Commands implements CallbackListener, CommandListener, ManialinkPageAnswer
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								return;
 | 
					 | 
					 | 
					 | 
								return;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							}
 | 
					 | 
					 | 
					 | 
							}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							$message = $this->maniaControl->getChat()->formatMessage(
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								'%s paused the Game!',
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								$player
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							//Normal Gamemodes
 | 
					 | 
					 | 
					 | 
							//Normal Gamemodes
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							try {
 | 
					 | 
					 | 
					 | 
							try {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								$this->maniaControl->getClient()->sendModeScriptCommands(array('Command_ForceWarmUp' => true));
 | 
					 | 
					 | 
					 | 
								$this->maniaControl->getClient()->sendModeScriptCommands(array('Command_ForceWarmUp' => true));
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								$this->maniaControl->getChat()->sendInformation($player->getEscapedNickname() . ' paused the Game!');
 | 
					 | 
					 | 
					 | 
								$this->maniaControl->getChat()->sendInformation($message);
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							} catch (GameModeException $e) {
 | 
					 | 
					 | 
					 | 
							} catch (GameModeException $e) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							}
 | 
					 | 
					 | 
					 | 
							}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							try {
 | 
					 | 
					 | 
					 | 
							try {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								//Chase and Combo?
 | 
					 | 
					 | 
					 | 
								//Chase and Combo?
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								$this->maniaControl->getClient()->sendModeScriptCommands(array('Command_SetPause' => true));
 | 
					 | 
					 | 
					 | 
								$this->maniaControl->getClient()->sendModeScriptCommands(array('Command_SetPause' => true));
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								$this->maniaControl->getChat()->sendInformation($player->getEscapedNickname() . ' paused the Game!');
 | 
					 | 
					 | 
					 | 
								$this->maniaControl->getChat()->sendInformation($message);
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								//Especially for chase, force end of the round to reach a draw
 | 
					 | 
					 | 
					 | 
								//Especially for chase, force end of the round to reach a draw
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								$this->maniaControl->getClient()->sendModeScriptCommands(array('Command_ForceEndRound' => true));
 | 
					 | 
					 | 
					 | 
								$this->maniaControl->getClient()->sendModeScriptCommands(array('Command_ForceEndRound' => true));
 | 
				
			
			
		
	
	
		
		
			
				
					
					| 
						
					 | 
					 | 
					@@ -239,7 +263,6 @@ class Commands implements CallbackListener, CommandListener, ManialinkPageAnswer
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							//TODO verify if not everything is replaced through the new pause
 | 
					 | 
					 | 
					 | 
							//TODO verify if not everything is replaced through the new pause
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$this->maniaControl->getModeScriptEventManager()->startPause();
 | 
					 | 
					 | 
					 | 
							$this->maniaControl->getModeScriptEventManager()->startPause();
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$this->maniaControl->getChat()->sendInformation('$f8fVote to $fffpause the current Game$f8f has been successful!');
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						}
 | 
					 | 
					 | 
					 | 
						}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						/**
 | 
					 | 
					 | 
					 | 
						/**
 | 
				
			
			
		
	
	
		
		
			
				
					
					| 
						
					 | 
					 | 
					@@ -283,9 +306,17 @@ class Commands implements CallbackListener, CommandListener, ManialinkPageAnswer
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								$this->maniaControl->getAuthenticationManager()->sendNotAllowed($player);
 | 
					 | 
					 | 
					 | 
								$this->maniaControl->getAuthenticationManager()->sendNotAllowed($player);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								return;
 | 
					 | 
					 | 
					 | 
								return;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							}
 | 
					 | 
					 | 
					 | 
							}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$systemInfo = $this->maniaControl->getClient()->getSystemInfo();
 | 
					 | 
					 | 
					 | 
							$systemInfo = $this->maniaControl->getClient()->getSystemInfo();
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$message    = 'SystemInfo: ip=' . $systemInfo->publishedIp . ', port=' . $systemInfo->port . ', p2pPort=' . $systemInfo->p2PPort . ', title=' . $systemInfo->titleId . ', login=' . $systemInfo->serverLogin . '.';
 | 
					 | 
					 | 
					 | 
							$message    = $this->maniaControl->getChat()->formatMessage(
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$this->maniaControl->getChat()->sendInformation($message, $player->login);
 | 
					 | 
					 | 
					 | 
								'SystemInfo: ip=%s, port=%s, p2pPort=%s, title=%s, login=%s',
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								$systemInfo->publishedIp,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								$systemInfo->port,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								$systemInfo->p2PPort,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								$systemInfo->titleId,
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								$systemInfo->serverLogin
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							$this->maniaControl->getChat()->sendInformation($message, $player);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						}
 | 
					 | 
					 | 
					 | 
						}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						/**
 | 
					 | 
					 | 
					 | 
						/**
 | 
				
			
			
		
	
	
		
		
			
				
					
					| 
						
					 | 
					 | 
					@@ -301,30 +332,38 @@ class Commands implements CallbackListener, CommandListener, ManialinkPageAnswer
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							}
 | 
					 | 
					 | 
					 | 
							}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							// Check for delayed shutdown
 | 
					 | 
					 | 
					 | 
							// Check for delayed shutdown
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$params = explode(' ', $chat[1][2]);
 | 
					 | 
					 | 
					 | 
							$params = explode(' ', $chat[1][2]);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if (count($params) >= 2) {
 | 
					 | 
					 | 
					 | 
							if (count($params) < 2) {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								$param = $params[1];
 | 
					 | 
					 | 
					 | 
								$this->shutdownServer($player->login);
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								if (strtolower($param) === 'empty') {
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									$this->serverShutdownEmpty = !$this->serverShutdownEmpty;
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									if ($this->serverShutdownEmpty) {
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										$this->maniaControl->getChat()->sendInformation("The server will shutdown as soon as it's empty!", $player);
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
										return;
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									}
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									$this->maniaControl->getChat()->sendInformation("Empty-shutdown cancelled!", $player);
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									return;
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								}
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								$delay = (int) $param;
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								if ($delay <= 0) {
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									// Cancel shutdown
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									$this->serverShutdownTime = -1;
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									$this->maniaControl->getChat()->sendInformation("Delayed shutdown cancelled!", $player);
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
									return;
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								}
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								// Trigger delayed shutdown
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								$this->serverShutdownTime = time() + $delay * 60.;
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								$this->maniaControl->getChat()->sendInformation("The server will shut down in {$delay} minutes!", $player);
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								return;
 | 
					 | 
					 | 
					 | 
								return;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							}
 | 
					 | 
					 | 
					 | 
							}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$this->shutdownServer($player->login);
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							$param = $params[1];
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							if (strtolower($param) === 'empty') {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								$this->serverShutdownEmpty = !$this->serverShutdownEmpty;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								if ($this->serverShutdownEmpty) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									$this->maniaControl->getChat()->sendInformation("The server will shutdown as soon as it's empty!", $player);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									return;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								$this->maniaControl->getChat()->sendInformation("Empty-shutdown cancelled!", $player);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								return;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							$delay = (int) $param;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							if ($delay <= 0) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								// Cancel shutdown
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								$this->serverShutdownTime = -1;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								$this->maniaControl->getChat()->sendInformation("Delayed shutdown cancelled!", $player);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								return;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							// Trigger delayed shutdown
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							$this->serverShutdownTime = time() + $delay * 60.;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							$message = $this->maniaControl->getChat()->formatMessage(
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								'The server will shut down in %s minutes!',
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								$delay
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							$this->maniaControl->getChat()->sendInformation($message, $player);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						}
 | 
					 | 
					 | 
					 | 
						}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						/**
 | 
					 | 
					 | 
					 | 
						/**
 | 
				
			
			
		
	
	
		
		
			
				
					
					| 
						
					 | 
					 | 
					@@ -338,14 +377,24 @@ class Commands implements CallbackListener, CommandListener, ManialinkPageAnswer
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								$this->maniaControl->getAuthenticationManager()->sendNotAllowed($player);
 | 
					 | 
					 | 
					 | 
								$this->maniaControl->getAuthenticationManager()->sendNotAllowed($player);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								return;
 | 
					 | 
					 | 
					 | 
								return;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							}
 | 
					 | 
					 | 
					 | 
							}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$params = explode(' ', $chat[1][2], 2);
 | 
					 | 
					 | 
					 | 
							$params = explode(' ', $chat[1][2], 2);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if (count($params) < 2) {
 | 
					 | 
					 | 
					 | 
							if (count($params) < 2) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								$this->maniaControl->getChat()->sendUsageInfo('Usage example: //setservername ManiaPlanet Server', $player);
 | 
					 | 
					 | 
					 | 
								$message = $this->maniaControl->getChat()->formatMessage(
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									'Usage example: %s',
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									'//setservername ManiaPlanet Server Name'
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								$this->maniaControl->getChat()->sendUsageInfo($message, $player);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								return;
 | 
					 | 
					 | 
					 | 
								return;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							}
 | 
					 | 
					 | 
					 | 
							}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$serverName = $params[1];
 | 
					 | 
					 | 
					 | 
							$serverName = $params[1];
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$this->maniaControl->getClient()->setServerName($serverName);
 | 
					 | 
					 | 
					 | 
							$this->maniaControl->getClient()->setServerName($serverName);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$this->maniaControl->getChat()->sendSuccess("Server name changed to: '{$serverName}'!", $player);
 | 
					 | 
					 | 
					 | 
							$message = $this->maniaControl->getChat()->formatMessage(
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								'Server name changed to %s!',
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								$serverName
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							$this->maniaControl->getChat()->sendSuccess($message, $player);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						}
 | 
					 | 
					 | 
					 | 
						}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						/**
 | 
					 | 
					 | 
					 | 
						/**
 | 
				
			
			
		
	
	
		
		
			
				
					
					| 
						
					 | 
					 | 
					@@ -359,15 +408,20 @@ class Commands implements CallbackListener, CommandListener, ManialinkPageAnswer
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								$this->maniaControl->getAuthenticationManager()->sendNotAllowed($player);
 | 
					 | 
					 | 
					 | 
								$this->maniaControl->getAuthenticationManager()->sendNotAllowed($player);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								return;
 | 
					 | 
					 | 
					 | 
								return;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							}
 | 
					 | 
					 | 
					 | 
							}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$messageParts   = explode(' ', $chatCallback[1][2], 2);
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$password       = '';
 | 
					 | 
					 | 
					 | 
							$messageParts = explode(' ', $chatCallback[1][2], 2);
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$successMessage = 'Password removed!';
 | 
					 | 
					 | 
					 | 
							$password     = '';
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							$message      = 'Password removed!';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if (isset($messageParts[1])) {
 | 
					 | 
					 | 
					 | 
							if (isset($messageParts[1])) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								$password       = $messageParts[1];
 | 
					 | 
					 | 
					 | 
								$password = $messageParts[1];
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								$successMessage = "Password changed to: '{$password}'!";
 | 
					 | 
					 | 
					 | 
								$message  = $this->maniaControl->getChat()->formatMessage(
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									'Password changed to %s!',
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									$password
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							}
 | 
					 | 
					 | 
					 | 
							}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$this->maniaControl->getClient()->setServerPassword($password);
 | 
					 | 
					 | 
					 | 
							$this->maniaControl->getClient()->setServerPassword($password);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$this->maniaControl->getChat()->sendSuccess($successMessage, $player);
 | 
					 | 
					 | 
					 | 
							$this->maniaControl->getChat()->sendSuccess($message, $player);
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						}
 | 
					 | 
					 | 
					 | 
						}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						/**
 | 
					 | 
					 | 
					 | 
						/**
 | 
				
			
			
		
	
	
		
		
			
				
					
					| 
						
					 | 
					 | 
					@@ -381,15 +435,20 @@ class Commands implements CallbackListener, CommandListener, ManialinkPageAnswer
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								$this->maniaControl->getAuthenticationManager()->sendNotAllowed($player);
 | 
					 | 
					 | 
					 | 
								$this->maniaControl->getAuthenticationManager()->sendNotAllowed($player);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								return;
 | 
					 | 
					 | 
					 | 
								return;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							}
 | 
					 | 
					 | 
					 | 
							}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$messageParts   = explode(' ', $chatCallback[1][2], 2);
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$password       = '';
 | 
					 | 
					 | 
					 | 
							$messageParts = explode(' ', $chatCallback[1][2], 2);
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$successMessage = 'Spectator password removed!';
 | 
					 | 
					 | 
					 | 
							$password     = '';
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							$message      = 'Spectator password removed!';
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if (isset($messageParts[1])) {
 | 
					 | 
					 | 
					 | 
							if (isset($messageParts[1])) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								$password       = $messageParts[1];
 | 
					 | 
					 | 
					 | 
								$password = $messageParts[1];
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								$successMessage = "Spectator password changed to: '{$password}'!";
 | 
					 | 
					 | 
					 | 
								$message  = $this->maniaControl->getChat()->formatMessage(
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									'Spectator password changed to %s!',
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									$password
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							}
 | 
					 | 
					 | 
					 | 
							}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$this->maniaControl->getClient()->setServerPasswordForSpectator($password);
 | 
					 | 
					 | 
					 | 
							$this->maniaControl->getClient()->setServerPasswordForSpectator($password);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$this->maniaControl->getChat()->sendSuccess($successMessage, $player);
 | 
					 | 
					 | 
					 | 
							$this->maniaControl->getChat()->sendSuccess($message, $player);
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						}
 | 
					 | 
					 | 
					 | 
						}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						/**
 | 
					 | 
					 | 
					 | 
						/**
 | 
				
			
			
		
	
	
		
		
			
				
					
					| 
						
					 | 
					 | 
					@@ -403,23 +462,28 @@ class Commands implements CallbackListener, CommandListener, ManialinkPageAnswer
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								$this->maniaControl->getAuthenticationManager()->sendNotAllowed($player);
 | 
					 | 
					 | 
					 | 
								$this->maniaControl->getAuthenticationManager()->sendNotAllowed($player);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								return;
 | 
					 | 
					 | 
					 | 
								return;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							}
 | 
					 | 
					 | 
					 | 
							}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$messageParts = explode(' ', $chatCallback[1][2], 2);
 | 
					 | 
					 | 
					 | 
							$messageParts = explode(' ', $chatCallback[1][2], 2);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if (!isset($messageParts[1])) {
 | 
					 | 
					 | 
					 | 
							if (!isset($messageParts[1]) || !is_numeric($messageParts[1])) {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								$this->maniaControl->getChat()->sendUsageInfo('Usage example: //setmaxplayers 16', $player);
 | 
					 | 
					 | 
					 | 
								$message = $this->maniaControl->getChat()->formatMessage(
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									'Usage example: %s',
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									'//setmaxplayers 16'
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								$this->maniaControl->getChat()->sendUsageInfo($message, $player);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								return;
 | 
					 | 
					 | 
					 | 
								return;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							}
 | 
					 | 
					 | 
					 | 
							}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$amount = $messageParts[1];
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if (!is_numeric($amount)) {
 | 
					 | 
					 | 
					 | 
							$amount = intval($messageParts[1]);
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								$this->maniaControl->getChat()->sendUsageInfo('Usage example: //setmaxplayers 16', $player);
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								return;
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							}
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$amount = (int) $amount;
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if ($amount < 0) {
 | 
					 | 
					 | 
					 | 
							if ($amount < 0) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								$amount = 0;
 | 
					 | 
					 | 
					 | 
								$amount = 0;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							}
 | 
					 | 
					 | 
					 | 
							}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$this->maniaControl->getClient()->setMaxPlayers($amount);
 | 
					 | 
					 | 
					 | 
							$this->maniaControl->getClient()->setMaxPlayers($amount);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$this->maniaControl->getChat()->sendSuccess("Changed max players to: {$amount}", $player);
 | 
					 | 
					 | 
					 | 
							$message = $this->maniaControl->getChat()->formatMessage(
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								'Changed max players to %s!',
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								$amount
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							$this->maniaControl->getChat()->sendSuccess($message, $player);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						}
 | 
					 | 
					 | 
					 | 
						}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						/**
 | 
					 | 
					 | 
					 | 
						/**
 | 
				
			
			
		
	
	
		
		
			
				
					
					| 
						
					 | 
					 | 
					@@ -433,22 +497,27 @@ class Commands implements CallbackListener, CommandListener, ManialinkPageAnswer
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								$this->maniaControl->getAuthenticationManager()->sendNotAllowed($player);
 | 
					 | 
					 | 
					 | 
								$this->maniaControl->getAuthenticationManager()->sendNotAllowed($player);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								return;
 | 
					 | 
					 | 
					 | 
								return;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							}
 | 
					 | 
					 | 
					 | 
							}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$messageParts = explode(' ', $chatCallback[1][2], 2);
 | 
					 | 
					 | 
					 | 
							$messageParts = explode(' ', $chatCallback[1][2], 2);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if (!isset($messageParts[1])) {
 | 
					 | 
					 | 
					 | 
							if (!isset($messageParts[1]) || !is_numeric($messageParts[1])) {
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								$this->maniaControl->getChat()->sendUsageInfo('Usage example: //setmaxspectators 16', $player);
 | 
					 | 
					 | 
					 | 
								$message = $this->maniaControl->getChat()->formatMessage(
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									'Usage example: %s',
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
									'//setmaxspectators 16'
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								$this->maniaControl->getChat()->sendUsageInfo($message, $player);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								return;
 | 
					 | 
					 | 
					 | 
								return;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							}
 | 
					 | 
					 | 
					 | 
							}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$amount = $messageParts[1];
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if (!is_numeric($amount)) {
 | 
					 | 
					 | 
					 | 
							$amount = intval($messageParts[1]);
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								$this->maniaControl->getChat()->sendUsageInfo('Usage example: //setmaxspectators 16', $player);
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								return;
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							}
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$amount = (int) $amount;
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							if ($amount < 0) {
 | 
					 | 
					 | 
					 | 
							if ($amount < 0) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
								$amount = 0;
 | 
					 | 
					 | 
					 | 
								$amount = 0;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							}
 | 
					 | 
					 | 
					 | 
							}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$this->maniaControl->getClient()->setMaxSpectators($amount);
 | 
					 | 
					 | 
					 | 
							$this->maniaControl->getClient()->setMaxSpectators($amount);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
							$this->maniaControl->getChat()->sendSuccess("Changed max spectators to: {$amount}", $player);
 | 
					 | 
					 | 
					 | 
							$message = $this->maniaControl->getChat()->formatMessage(
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								'Changed max spectators to %s!',
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
								$amount
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
							$this->maniaControl->getChat()->sendSuccess($message, $player);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						}
 | 
					 | 
					 | 
					 | 
						}
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					}
 | 
					 | 
					 | 
					 | 
					}
 | 
				
			
			
		
	
	
		
		
			
				
					
					| 
						 
						
						
						
						 
					 | 
					 | 
					 
 |