This commit is contained in:
kremsy 2014-02-19 22:22:28 +01:00 committed by Steffen Schröder
parent 895d500ca6
commit b04eb30284
2 changed files with 21 additions and 8 deletions

View File

@ -189,11 +189,24 @@ class CallbackManager {
foreach($callbacks as $callback) { foreach($callbacks as $callback) {
$callbackName = $callback[0]; $callbackName = $callback[0];
switch($callbackName) { switch($callbackName) {
case 'ManiaPlanet.BeginMatch':
$titleId = $this->maniaControl->server->titleId;
$titlePrefix = strtolower(substr($titleId, 0, 2));
if ($titlePrefix != "sm") {
$this->triggerCallback($callbackName, $callback);
break;
}
case 'ManiaPlanet.BeginMap': case 'ManiaPlanet.BeginMap':
$this->maniaControl->mapManager->handleBeginMap($callback); $this->maniaControl->mapManager->handleBeginMap($callback);
$this->triggerCallback($callbackName, $callback); $this->triggerCallback($callbackName, $callback);
break; break;
case 'ManiaPlanet.EndMatch': //TODO temporary fix case 'ManiaPlanet.EndMatch': //TODO temporary fix
$titleId = $this->maniaControl->server->titleId;
$titlePrefix = strtolower(substr($titleId, 0, 2));
if ($titlePrefix != "sm") {
$this->triggerCallback($callbackName, $callback);
break;
}
case 'ManiaPlanet.EndMap': case 'ManiaPlanet.EndMap':
$this->maniaControl->mapManager->handleEndMap($callback); $this->maniaControl->mapManager->handleEndMap($callback);
$this->triggerCallback($callbackName, $callback); $this->triggerCallback($callbackName, $callback);

View File

@ -288,9 +288,9 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP
/** /**
* Destroy the Vote on Canceled Callback * Destroy the Vote on Canceled Callback
* *
* @param array $callback * @param Player $player
*/ */
public function handleVoteCanceled(array $callback) { public function handleVoteCanceled(Player $player) {
//reset vote //reset vote
$this->destroyVote(); $this->destroyVote();
} }