changes for new structure

This commit is contained in:
kremsy
2014-01-16 19:07:00 +01:00
committed by Steffen Schröder
parent 027af49bc9
commit 0c6d8c010c
9 changed files with 49 additions and 52 deletions

View File

@ -105,8 +105,7 @@ class MapCommands implements CommandListener, ManialinkPageAnswerListener, Callb
$map = $nextQueued[1];
$this->maniaControl->chat->sendInformation("Next map is $<" . $map->name . "$> from $<" . $map->authorNick . "$> requested by $<" . $requester->nickname . "$>.", $player->login);
} else {
$this->maniaControl->client->query('GetNextMapIndex');
$mapIndex = $this->maniaControl->client->getResponse();
$mapIndex = $this->maniaControl->client->getNextMapIndex();
$maps = $this->maniaControl->mapManager->getMaps();
$map = $maps[$mapIndex];
$this->maniaControl->chat->sendInformation("Next map is $<" . $map->name . "$> from $<" . $map->authorNick . "$>.", $player->login);
@ -186,7 +185,7 @@ class MapCommands implements CommandListener, ManialinkPageAnswerListener, Callb
$message = '$<' . $player->nickname . '$> skipped the current Map!';
$this->maniaControl->chat->sendSuccess($message);
$this->maniaControl->log($message, true);
$this->maniaControl->client->query('NextMap');
$this->maniaControl->client->nextMap();
}
/**
@ -203,7 +202,7 @@ class MapCommands implements CommandListener, ManialinkPageAnswerListener, Callb
$message = '$<' . $player->nickname . '$> restarted the current Map!';
$this->maniaControl->chat->sendSuccess($message);
$this->maniaControl->log($message, true);
$this->maniaControl->client->query('RestartMap');
$this->maniaControl->client->restartMap();
}
/**

View File

@ -727,7 +727,7 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener {
$this->showMapList($player);
break;
case self::ACTION_SWITCH_MAP:
$this->maniaControl->client->query('JumpToMapIndex', $mapId);
$this->maniaControl->client->jumpToMapIndex($mapId);
$mapList = $this->maniaControl->mapManager->getMaps();
$map = $mapList[$mapId];

View File

@ -153,9 +153,9 @@ class MapQueue implements CallbackListener, CommandListener {
$map = $this->nextMap[1];
$success = $this->maniaControl->client->query('ChooseNextMap', $map->fileName);
if(!$success) {
trigger_error('[' . $this->maniaControl->client->getErrorCode() . '] ChooseNextMap - ' . $this->maniaControl->client->getErrorCode(), E_USER_WARNING);
$success = $this->maniaControl->client->chooseNextMap($map->fileName);
if(!$success) { //TODO error code?
//trigger_error('[' . $this->maniaControl->client->getErrorCode() . '] ChooseNextMap - ' . $this->maniaControl->client->getErrorCode(), E_USER_WARNING);
return;
}
}