fixed changeinprogress exception

This commit is contained in:
kremsy 2014-07-04 10:06:07 +02:00
parent d80480a681
commit 5ce1878ce3

View File

@ -28,6 +28,7 @@ use ManiaControl\Server\Server;
use ManiaControl\Server\ServerCommands; use ManiaControl\Server\ServerCommands;
use ManiaControl\Utils\ColorUtil; use ManiaControl\Utils\ColorUtil;
use Maniaplanet\DedicatedServer\Structures\VoteRatio; use Maniaplanet\DedicatedServer\Structures\VoteRatio;
use Maniaplanet\DedicatedServer\Xmlrpc\ChangeInProgressException;
use Maniaplanet\DedicatedServer\Xmlrpc\GameModeException; use Maniaplanet\DedicatedServer\Xmlrpc\GameModeException;
@ -286,7 +287,9 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
$itemMarginFactorY = 1.2; $itemMarginFactorY = 1.2;
//If game is shootmania lower the icons position by 20 //If game is shootmania lower the icons position by 20
if ($this->maniaControl->mapManager->getCurrentMap()->getGame() === 'sm') { if ($this->maniaControl->mapManager->getCurrentMap()
->getGame() === 'sm'
) {
$posY -= $shootManiaOffset; $posY -= $shootManiaOffset;
} }
@ -499,11 +502,17 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
case 'skipmap': case 'skipmap':
case 'skip': case 'skip':
case 'nextmap': case 'nextmap':
try {
$this->maniaControl->mapManager->mapActions->skipMap(); $this->maniaControl->mapManager->mapActions->skipMap();
} catch (ChangeInProgressException $e) {
}
$this->maniaControl->chat->sendInformation('$f8fVote to $fffskip the Map$f8f has been successful!'); $this->maniaControl->chat->sendInformation('$f8fVote to $fffskip the Map$f8f has been successful!');
break; break;
case 'restartmap': case 'restartmap':
try {
$this->maniaControl->client->restartMap(); $this->maniaControl->client->restartMap();
} catch (ChangeInProgressException $e) {
}
$this->maniaControl->chat->sendInformation('$f8fVote to $fffrestart the Map$f8f has been successful!'); $this->maniaControl->chat->sendInformation('$f8fVote to $fffrestart the Map$f8f has been successful!');
break; break;
case 'pausegame': case 'pausegame':