updated teammode recognization with the new cb
This commit is contained in:
parent
89bc297b98
commit
65f179e7a2
@ -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
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user