changes too new structure
This commit is contained in:
committed by
Steffen Schröder
parent
af16f2ac8d
commit
027af49bc9
@ -191,11 +191,10 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
|
||||
$this->addVoteMenuItem($itemQuad, 5, 'Vote for Restart-Map');
|
||||
|
||||
//Check if Pause exists in current gamemode
|
||||
$this->maniaControl->client->query('GetModeScriptInfo');
|
||||
$scriptInfos = $this->maniaControl->client->getResponse();
|
||||
$scriptInfos = (array)$this->maniaControl->client->getModeScriptInfo();
|
||||
|
||||
$pauseExists = false;
|
||||
foreach($scriptInfos["CommandDescs"] as $param) {
|
||||
foreach($scriptInfos["commandDescs"] as $param) {
|
||||
if($param['Name'] == "Command_ForceWarmUp") {
|
||||
$pauseExists = true;
|
||||
break;
|
||||
@ -248,20 +247,20 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
|
||||
if($voteResult >= $this->currentNeededRatio) {
|
||||
switch($voteName) {
|
||||
case 'teambalance':
|
||||
$this->maniaControl->client->query('AutoTeamBalance');
|
||||
$this->maniaControl->client->autoTeamBalance();
|
||||
$this->maniaControl->chat->sendInformation('$sVote Successfully -> Teams got Balanced!');
|
||||
break;
|
||||
case 'skipmap':
|
||||
case 'nextmap':
|
||||
$this->maniaControl->client->query('NextMap');
|
||||
$this->maniaControl->client->nextMap();
|
||||
$this->maniaControl->chat->sendInformation('$sVote Successfully -> Map skipped!');
|
||||
break;
|
||||
case 'restartmap':
|
||||
$this->maniaControl->client->query('RestartMap');
|
||||
$this->maniaControl->client->restartMap();
|
||||
$this->maniaControl->chat->sendInformation('$sVote Successfully -> Map restarted!');
|
||||
break;
|
||||
case 'pausegame':
|
||||
$this->maniaControl->client->query('SendModeScriptCommands', array('Command_ForceWarmUp' => True));
|
||||
$this->maniaControl->client->sendModeScriptCommands(array('Command_ForceWarmUp' => True));
|
||||
$this->maniaControl->chat->sendInformation('$sVote Successfully -> Current Game paused!');
|
||||
break;
|
||||
}
|
||||
|
@ -286,11 +286,9 @@ class WidgetPlugin implements CallbackListener, Plugin {
|
||||
$backgroundQuad->setSize($width, $height);
|
||||
$backgroundQuad->setStyles($quadStyle, $quadSubstyle);
|
||||
|
||||
$this->maniaControl->client->query('GetMaxPlayers');
|
||||
$maxPlayers = $this->maniaControl->client->getResponse();
|
||||
$maxPlayers = $this->maniaControl->client->getMaxPlayers();
|
||||
|
||||
$this->maniaControl->client->query('GetMaxSpectators');
|
||||
$maxSpectators = $this->maniaControl->client->getResponse();
|
||||
$maxSpectators = $this->maniaControl->client->getMaxSpectators();
|
||||
|
||||
$serverName = $this->maniaControl->server->getName();
|
||||
|
||||
@ -440,10 +438,9 @@ class WidgetPlugin implements CallbackListener, Plugin {
|
||||
$requester = null;
|
||||
// if the nextmap is not a queued map, get it from map info
|
||||
if($queuedMap == null) {
|
||||
$this->maniaControl->client->query("GetNextMapInfo");
|
||||
$map = $this->maniaControl->client->getResponse();
|
||||
$name = $map['Name'];
|
||||
$author = $map['Author'];
|
||||
$map = $this->maniaControl->client->getNextMapInfo();
|
||||
$name = $map->name;
|
||||
$author = $map->author;
|
||||
} else {
|
||||
$requester = $queuedMap[0];
|
||||
$map = $queuedMap[1];
|
||||
|
Reference in New Issue
Block a user