Compare commits

...

2 Commits

3 changed files with 35 additions and 4 deletions

View File

@ -38,7 +38,7 @@ use ManiaControl\Callbacks\TimerListener; // for pause
class MatchManagerCore implements CallbackListener, CommandListener, TimerListener, CommunicationListener, Plugin {
const PLUGIN_ID = 152;
const PLUGIN_VERSION = 5.1;
const PLUGIN_VERSION = 5.2;
const PLUGIN_NAME = 'MatchManager Core';
const PLUGIN_AUTHOR = 'Beu';
@ -1059,6 +1059,9 @@ class MatchManagerCore implements CallbackListener, CommandListener, TimerListen
*/
public function MatchEnd() {
try {
// Since now, we conside the match not started
$this->matchStarted = false;
// Load TimeAttack gamemode if possible
$maplist = 'MatchSettings' . DIRECTORY_SEPARATOR . $this->maniaControl->getSettingManager()->getSettingValue($this, self::SETTING_MATCH_POST_MATCH_MAPLIST);
if (is_file($this->maniaControl->getServer()->getDirectory()->getMapsFolder() . $maplist)) {
@ -1114,6 +1117,9 @@ class MatchManagerCore implements CallbackListener, CommandListener, TimerListen
}
try {
// Since now, we conside the match not started
$this->matchStarted = false;
// Trigger Callback
$this->maniaControl->getCallbackManager()->triggerCallback(self::CB_MATCHMANAGER_STOPMATCH, $this->matchid, $this->currentscore, $this->currentteamsscore);

View File

@ -38,7 +38,7 @@ class MatchManagerPlayersPause implements ManialinkPageAnswerListener, CommandLi
* Constants
*/
const PLUGIN_ID = 159;
const PLUGIN_VERSION = 1.3;
const PLUGIN_VERSION = 1.4;
const PLUGIN_NAME = 'MatchManager Players Pause';
const PLUGIN_AUTHOR = 'Beu';
@ -138,6 +138,10 @@ class MatchManagerPlayersPause implements ManialinkPageAnswerListener, CommandLi
$this->maniaControl->getCallbackManager()->registerCallbackListener(PlayerManager::CB_PLAYERDISCONNECT, $this, 'handlePlayerDisconnect');
$this->maniaControl->getCallbackManager()->registerCallbackListener(PlayerManager::CB_PLAYERINFOCHANGED, $this, 'displayPauseWidgetIfNeeded');
$this->maniaControl->getCallbackManager()->registerCallbackListener(MatchManagerCore::CB_MATCHMANAGER_STARTMATCH, $this, 'handleMatchManagerCoreCallback');
$this->maniaControl->getCallbackManager()->registerCallbackListener(MatchManagerCore::CB_MATCHMANAGER_ENDMATCH, $this, 'handleMatchManagerCoreCallback');
$this->maniaControl->getCallbackManager()->registerCallbackListener(MatchManagerCore::CB_MATCHMANAGER_STOPMATCH, $this, 'handleMatchManagerCoreCallback');
$this->maniaControl->getCallbackManager()->registerCallbackListener(Callbacks::MP_STARTROUNDSTART, $this, 'handleBeginRoundCallback');
@ -328,6 +332,15 @@ class MatchManagerPlayersPause implements ManialinkPageAnswerListener, CommandLi
}
}
/**
* handleMatchManagerCoreCallback
*
* @return void
*/
public function handleMatchManagerCoreCallback() {
$this->displayPauseWidgetIfNeeded();
}
/**
* Generate Manialinks variables
*/

View File

@ -17,7 +17,7 @@ use ManiaControl\Plugins\PluginManager;
use ManiaControl\Settings\Setting;
use ManiaControl\Settings\SettingManager;
use ManiaControl\Commands\CommandListener;
use Maniaplanet\DedicatedServer\InvalidArgumentException;
if (!class_exists('MatchManagerSuite\MatchManagerCore')) {
$this->maniaControl->getChat()->sendErrorToAdmins('MatchManager Core is required to use one of MatchManager plugin. Install it and restart Maniacontrol');
@ -37,7 +37,7 @@ class MatchManagerReadyButton implements ManialinkPageAnswerListener, CommandLis
* Constants
*/
const PLUGIN_ID = 158;
const PLUGIN_VERSION = 1.3;
const PLUGIN_VERSION = 1.4;
const PLUGIN_NAME = 'MatchManager Ready Button';
const PLUGIN_AUTHOR = 'Beu';
@ -135,6 +135,10 @@ class MatchManagerReadyButton implements ManialinkPageAnswerListener, CommandLis
$this->maniaControl->getCallbackManager()->registerCallbackListener(PlayerManager::CB_PLAYERDISCONNECT, $this, 'handlePlayerDisconnect');
$this->maniaControl->getCallbackManager()->registerCallbackListener(PlayerManager::CB_PLAYERINFOCHANGED, $this, 'displayReadyWidgetIfNeeded');
$this->maniaControl->getCallbackManager()->registerCallbackListener(MatchManagerCore::CB_MATCHMANAGER_STARTMATCH, $this, 'handleMatchManagerCoreCallback');
$this->maniaControl->getCallbackManager()->registerCallbackListener(MatchManagerCore::CB_MATCHMANAGER_ENDMATCH, $this, 'handleMatchManagerCoreCallback');
$this->maniaControl->getCallbackManager()->registerCallbackListener(MatchManagerCore::CB_MATCHMANAGER_STOPMATCH, $this, 'handleMatchManagerCoreCallback');
// Register ManiaLink Pages
$this->maniaControl->getManialinkManager()->registerManialinkPageAnswerListener(self::ACTION_READY, $this, 'handleReady');
@ -300,6 +304,14 @@ class MatchManagerReadyButton implements ManialinkPageAnswerListener, CommandLis
}
}
/**
* handleMatchManagerCoreCallback
*
* @return void
*/
public function handleMatchManagerCoreCallback() {
$this->displayReadyWidgetIfNeeded();
}
/**
* Generate Manialinks variables