improved TheM plugins unload methods
This commit is contained in:
parent
50697bfb4f
commit
8ea0646064
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace TheM;
|
||||
|
||||
use ManiaControl\Callbacks\CallbackListener;
|
||||
use ManiaControl\Commands\CommandListener;
|
||||
use ManiaControl\ManiaControl;
|
||||
@ -70,9 +72,6 @@ class DynamicPointlimitPlugin implements CallbackListener, CommandListener, Plug
|
||||
* Unload the plugin and its resources
|
||||
*/
|
||||
public function unload() {
|
||||
$this->maniaControl->callbackManager->unregisterCallbackListener($this);
|
||||
|
||||
unset($this->maniaControl);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace TheM;
|
||||
|
||||
use FML\Controls\Frame;
|
||||
@ -103,23 +104,16 @@ class QueuePlugin implements CallbackListener, CommandListener, ManialinkPageAns
|
||||
* Unload the plugin and its resources
|
||||
*/
|
||||
public function unload() {
|
||||
$this->maniaControl->manialinkManager->unregisterManialinkPageAnswerListener($this);
|
||||
$this->maniaControl->callbackManager->unregisterCallbackListener($this);
|
||||
$this->maniaControl->timerManager->unregisterTimerListenings($this);
|
||||
|
||||
foreach($this->spectators as $spectator) {
|
||||
$this->maniaControl->client->forceSpectator($spectator, 3);
|
||||
$this->maniaControl->client->forceSpectator($spectator, 0);
|
||||
}
|
||||
|
||||
foreach($this->maniaControl->playerManager->getPlayers() as $player) {
|
||||
$this->hideQueueWidget($player);
|
||||
}
|
||||
$this->maniaControl->manialinkManager->hideManialink(self::ML_ID);
|
||||
|
||||
$this->queue = array();
|
||||
$this->spectators = array();
|
||||
$this->showPlay = array();
|
||||
unset($this->maniaControl);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -566,7 +560,6 @@ class QueuePlugin implements CallbackListener, CommandListener, ManialinkPageAns
|
||||
* @param Player $player
|
||||
*/
|
||||
private function hideQueueWidget(Player $player) {
|
||||
$maniaLink = new ManiaLink(self::ML_ID);
|
||||
$this->maniaControl->manialinkManager->sendManialink($maniaLink, $player->login);
|
||||
$this->maniaControl->manialinkManager->hideManialink(self::ML_ID, $player);
|
||||
}
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace TheM;
|
||||
|
||||
use FML\Controls\Frame;
|
||||
@ -126,11 +127,6 @@ class TeamSpeakPlugin implements CallbackListener, CommandListener, ManialinkPag
|
||||
$this->serverData = array();
|
||||
|
||||
$this->maniaControl->actionsMenu->removeMenuItem(1, true);
|
||||
$this->maniaControl->manialinkManager->unregisterManialinkPageAnswerListener($this);
|
||||
$this->maniaControl->callbackManager->unregisterCallbackListener($this);
|
||||
$this->maniaControl->commandManager->unregisterCommandListener($this);
|
||||
$this->maniaControl->timerManager->unregisterTimerListenings($this);
|
||||
unset($this->maniaControl);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user