updated teammode recognization with the new cb

This commit is contained in:
kremsy 2017-04-13 19:48:37 +02:00
parent 89bc297b98
commit 65f179e7a2

View File

@ -2,6 +2,7 @@
namespace ManiaControl\Script;
use ManiaControl\Callbacks\Structures\ManiaPlanet\ModeUseTeamsStructure;
use ManiaControl\General\UsageInformationAble;
use ManiaControl\General\UsageInformationTrait;
use ManiaControl\Logger;
@ -60,9 +61,18 @@ class ScriptManager implements UsageInformationAble {
$this->maniaControl->getModeScriptEventManager()->enableCallbacks();
Logger::logInfo("Script Callbacks successfully enabled!");
//Checks if the Server is currently in TeamMode and sets it
$this->maniaControl->getModeScriptEventManager()->isTeamMode()->setCallable(function (ModeUseTeamsStructure $structure) {
if ($structure->modeIsUsingTeams()) {
$this->maniaControl->getServer()->setTeamMode(true);
}
});
return true;
}
/**
* Check whether the Server is running in Script Mode
*