diff --git a/core/Callbacks/Callbacks.php b/core/Callbacks/Callbacks.php index 79e4e999..c5be521f 100644 --- a/core/Callbacks/Callbacks.php +++ b/core/Callbacks/Callbacks.php @@ -73,7 +73,10 @@ interface Callbacks { const MP_WARMUP_END = 'Maniaplanet.WarmUp.End'; const MP_WARMUP_STATUS = 'Maniaplanet.WarmUp.Status'; - const SM_UIPROPERTIES = 'Shootmania.UIProperties'; + const MP_USES_TEAMMODE = 'Maniaplanet.Mode.UseTeams'; + const MP_PAUSE_STATUS = 'Maniaplanet.Pause.Status'; + + const SM_UIPROPERTIES = 'Shootmania.UI.Properties'; const SM_SCORES = "Shootmania.Scores"; const SM_ONEVENTDEFAULT = "Shootmania.Event.Default"; @@ -95,7 +98,6 @@ interface Callbacks { const SM_ONPLAYERREQUESTACTIONCHANGE = "Shootmania.Event.OnPlayerRequestActionChange"; //SM GameMode Callbacks - const SM_COMBO_PAUSESTATUS = 'Shootmania.Combo.Pause'; const SM_ELITE_STARTTURN = 'Shootmania.Elite.StartTurn'; const SM_ELITE_ENDTURN = 'Shootmania.Elite.EndTurn'; const SM_JOUST_ONRELOAD = 'Shootmania.Joust.OnReload'; @@ -122,7 +124,7 @@ interface Callbacks { const TM_WARMUPENDROUND = "Trackmania.WarmUp.EndRound"; const TM_WARMUPEND = "Trackmania.WarmUp.End"; - const TM_UIPROPERTIES = 'Trackmania.UIProperties'; + const TM_UIPROPERTIES = 'Trackmania.UI.Properties'; const TM_POINTSREPARTITION = 'Trackmania.PointsRepartition'; @@ -312,7 +314,7 @@ interface Callbacks { * @deprecated */ const ONPLAYERREQUESTRESPAWN = 'Callbacks.OnPlayerRequestRespawn'; - + /* * TrackMania Callbacks */ diff --git a/core/Callbacks/LibXmlRpcCallbacks.php b/core/Callbacks/LibXmlRpcCallbacks.php index 919cd7d3..48367551 100644 --- a/core/Callbacks/LibXmlRpcCallbacks.php +++ b/core/Callbacks/LibXmlRpcCallbacks.php @@ -4,11 +4,14 @@ namespace ManiaControl\Callbacks; use ManiaControl\Callbacks\Structures\ArmorEmptyStructure; use ManiaControl\Callbacks\Structures\CaptureStructure; +use ManiaControl\Callbacks\Structures\Common\BaseTimeStructure; +use ManiaControl\Callbacks\Structures\Common\StatusCallbackStructure; +use ManiaControl\Callbacks\Structures\ManiaPlanet\LoadingUnloadingMapStructure; +use ManiaControl\Callbacks\Structures\ManiaPlanet\ModeUseTeamsStructure; use ManiaControl\Callbacks\Structures\ManiaPlanet\StartEndStructure; use ManiaControl\Callbacks\Structures\ManiaPlanet\StartServerStructure; use ManiaControl\Callbacks\Structures\NearMissStructure; use ManiaControl\Callbacks\Structures\PlayerHitStructure; -use ManiaControl\Callbacks\Structures\ShootMania\StatusCallbackStructure; use ManiaControl\Callbacks\Structures\XmlRpc\AllApiVersionsStructure; use ManiaControl\Callbacks\Structures\XmlRpc\ApiVersionStructure; use ManiaControl\Callbacks\Structures\XmlRpc\CallbackHelpStructure; @@ -100,7 +103,7 @@ class LibXmlRpcCallbacks implements CallbackListener { break; case 'Maniaplanet.StartMap_End': //Use the MapManager Callback $jsonData = json_decode($data[0]); - $this->maniaControl->getMapManager()->handleScriptBeginMap($jsonData->map->uid, 'False'); + $this->maniaControl->getMapManager()->handleScriptBeginMap($jsonData->map->uid, $jsonData->restarted); //TODO Test if json is correctly parsed break; case 'Maniaplanet.EndMap_Start': @@ -117,21 +120,25 @@ class LibXmlRpcCallbacks implements CallbackListener { break; case Callbacks::MP_LOADINGMAPEND: case Callbacks::MP_UNLOADINGMAPSTART: - $jsonData = json_decode($data[0]); - $map = $this->maniaControl->getMapManager()->getMapByUid($jsonData->map->uid); //Verify Json - $this->maniaControl->getCallbackManager()->triggerCallback($name, $map); + $this->maniaControl->getCallbackManager()->triggerCallback($name, new LoadingUnloadingMapStructure($this->maniaControl, $data)); break; case Callbacks::MP_LOADINGMAPSTART: case Callbacks::MP_UNLOADINGMAPEND: case Callbacks::MP_PODIUMSTART: case Callbacks::MP_PODIUMEND: + $this->maniaControl->getCallbackManager()->triggerCallback($name, new BaseTimeStructure($this->maniaControl, $data)); + break; case Callbacks::MP_WARMUP_START: case Callbacks::MP_WARMUP_END: $this->maniaControl->getCallbackManager()->triggerCallback($name); break; case Callbacks::MP_WARMUP_STATUS: + case Callbacks::MP_PAUSE_STATUS: $this->maniaControl->getCallbackManager()->triggerCallback($name, new StatusCallbackStructure($this->maniaControl, $data)); break; + case Callbacks::MP_USES_TEAMMODE: + $this->maniaControl->getCallbackManager()->triggerCallback($name, new ModeUseTeamsStructure($this->maniaControl, $data)); + break; //OLD Callbacks case 'LibXmlRpc_BeginMatch': diff --git a/core/Callbacks/ShootManiaCallbacks.php b/core/Callbacks/ShootManiaCallbacks.php index 5f683724..7ffd62b9 100644 --- a/core/Callbacks/ShootManiaCallbacks.php +++ b/core/Callbacks/ShootManiaCallbacks.php @@ -81,7 +81,8 @@ class ShootManiaCallbacks implements CallbackListener { $this->maniaControl->getCallbackManager()->triggerCallback($name, new OnScoresStructure($this->maniaControl, $data)); break; case Callbacks::SM_UIPROPERTIES: - //TODO + //TODO structure, but wait for further update + $this->maniaControl->getCallbackManager()->triggerCallback($name, $data); break; case Callbacks::SM_ONEVENTDEFAULT: $this->maniaControl->getCallbackManager()->triggerCallback($name, new OnDefaultEventStructure($this->maniaControl, $data)); @@ -128,9 +129,6 @@ class ShootManiaCallbacks implements CallbackListener { case Callbacks::SM_ONPLAYERREQUESTACTIONCHANGE: $this->maniaControl->getCallbackManager()->triggerCallback($name, new OnPlayerRequestActionChange($this->maniaControl, $data)); break; - case Callbacks::SM_COMBO_PAUSESTATUS: - $this->maniaControl->getCallbackManager()->triggerCallback($name, new StatusCallbackStructure($this->maniaControl, $data)); - break; case Callbacks::SM_ELITE_STARTTURN: $this->maniaControl->getCallbackManager()->triggerCallback($name, new OnEliteStartTurnStructure($this->maniaControl, $data)); break; diff --git a/core/Callbacks/Structures/Common/BaseTimeStructure.php b/core/Callbacks/Structures/Common/BaseTimeStructure.php new file mode 100644 index 00000000..e36d7139 --- /dev/null +++ b/core/Callbacks/Structures/Common/BaseTimeStructure.php @@ -0,0 +1,39 @@ + + * @copyright 2014-2017 ManiaControl Team + * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 + */ +class BaseTimeStructure extends BaseStructure { + protected $time; + + /** + * BaseResponseStructure constructor. + * + * @param \ManiaControl\ManiaControl $maniaControl + * @param $data + */ + public function __construct(ManiaControl $maniaControl, $data) { + parent::__construct($maniaControl, $data); + + $this->time = $this->getPlainJsonObject()->time; + } + + /** + * Gets the Server Time the Callback was sent + * + * @api + * @return int Time since Serverstart + */ + public function getTime() { + return $this->time; + } +} \ No newline at end of file diff --git a/core/Callbacks/Structures/Common/Models/CommonPlayerScore.php b/core/Callbacks/Structures/Common/Models/CommonPlayerScore.php index b3f87510..2905f03d 100644 --- a/core/Callbacks/Structures/Common/Models/CommonPlayerScore.php +++ b/core/Callbacks/Structures/Common/Models/CommonPlayerScore.php @@ -24,6 +24,7 @@ class CommonPlayerScore implements UsageInformationAble, JsonSerializable { protected $rank; protected $roundPoints; protected $mapPoints; + protected $matchPoints; /** * Returns the Player @@ -105,4 +106,24 @@ class CommonPlayerScore implements UsageInformationAble, JsonSerializable { $this->mapPoints = $mapPoints; } + /** + * Gets the Match Points + * + * @api + * @return mixed + */ + public function getMatchPoints() { + return $this->matchPoints; + } + + /** + * Sets the Match Points + * + * @api + * @param mixed $matchPoints + */ + public function setMatchPoints($matchPoints) { + $this->matchPoints = $matchPoints; + } + } \ No newline at end of file diff --git a/core/Callbacks/Structures/Common/StatusCallbackStructure.php b/core/Callbacks/Structures/Common/StatusCallbackStructure.php index 5b46f194..9ac42689 100644 --- a/core/Callbacks/Structures/Common/StatusCallbackStructure.php +++ b/core/Callbacks/Structures/Common/StatusCallbackStructure.php @@ -3,7 +3,6 @@ namespace ManiaControl\Callbacks\Structures\Common; -use ManiaControl\Callbacks\Structures\Common\BaseResponseStructure; use ManiaControl\ManiaControl; /** @@ -16,6 +15,7 @@ use ManiaControl\ManiaControl; */ class StatusCallbackStructure extends BaseResponseStructure { protected $active; + protected $available; /** * Construct a new On Hit Structure @@ -26,7 +26,8 @@ class StatusCallbackStructure extends BaseResponseStructure { public function __construct(ManiaControl $maniaControl, $data) { parent::__construct($maniaControl, $data); - $this->active = $this->getPlainJsonObject()->active; + $this->active = $this->getPlainJsonObject()->active; + $this->available = $this->getPlainJsonObject()->available; } /** @@ -39,4 +40,14 @@ class StatusCallbackStructure extends BaseResponseStructure { return $this->active; } + /** + * Checks if the Mode uses Warmup or not + * + * @api + * @return boolean + */ + public function isAvailable() { + return $this->available; + } + } \ No newline at end of file diff --git a/core/Callbacks/Structures/ManiaPlanet/LoadingUnloadingMapStructure.php b/core/Callbacks/Structures/ManiaPlanet/LoadingUnloadingMapStructure.php new file mode 100644 index 00000000..46f6b1ff --- /dev/null +++ b/core/Callbacks/Structures/ManiaPlanet/LoadingUnloadingMapStructure.php @@ -0,0 +1,50 @@ + + * @copyright 2014-2017 ManiaControl Team + * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 + */ +class LoadingUnloadingMapStructure extends BaseTimeStructure { + private $restarted; + + /** + * StartServerStructure constructor. + * + * @param \ManiaControl\ManiaControl $maniaControl + * @param $data + */ + public function __construct(ManiaControl $maniaControl, $data) { + parent::__construct($maniaControl, $data); + } + + /** + * Flag if the Server got Restarted + * + * @api + * @return mixed + */ + public function getRestarted() { + return $this->restarted; + } + + /** + * Gets the Map + * + * @api + * @return \ManiaControl\Maps\Map + */ + public function getMap() { + return $this->maniaControl->getMapManager()->getMapByUid($this->getPlainJsonObject()->map->uid); + } + +} \ No newline at end of file diff --git a/core/Callbacks/Structures/ManiaPlanet/ModeUseTeamsStructure.php b/core/Callbacks/Structures/ManiaPlanet/ModeUseTeamsStructure.php new file mode 100644 index 00000000..094b716a --- /dev/null +++ b/core/Callbacks/Structures/ManiaPlanet/ModeUseTeamsStructure.php @@ -0,0 +1,41 @@ + + * @copyright 2014-2017 ManiaControl Team + * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 + */ +class ModeUseTeamsStructure extends BaseResponseStructure { + private $teams; + + /** + * StartServerStructure constructor. + * + * @param \ManiaControl\ManiaControl $maniaControl + * @param $data + */ + public function __construct(ManiaControl $maniaControl, $data) { + parent::__construct($maniaControl, $data); + + $this->teams = $this->getPlainJsonObject()->teams; + } + + /** + * Returns if the Mode is using Teams + * + * @api + * @return boolean < true if the game mode uses teams, false otherwise + */ + public function modeIsUsingTeams() { + return $this->teams; + } +} \ No newline at end of file diff --git a/core/Callbacks/Structures/ManiaPlanet/StartEndStructure.php b/core/Callbacks/Structures/ManiaPlanet/StartEndStructure.php index 967b8502..b141cf42 100644 --- a/core/Callbacks/Structures/ManiaPlanet/StartEndStructure.php +++ b/core/Callbacks/Structures/ManiaPlanet/StartEndStructure.php @@ -4,6 +4,7 @@ namespace ManiaControl\Callbacks\Structures\ManiaPlanet; use ManiaControl\Callbacks\Structures\Common\BaseStructure; +use ManiaControl\Callbacks\Structures\Common\BaseTimeStructure; use ManiaControl\ManiaControl; /** @@ -14,7 +15,7 @@ use ManiaControl\ManiaControl; * @copyright 2014-2017 ManiaControl Team * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 */ -class StartEndStructure extends BaseStructure { +class StartEndStructure extends BaseTimeStructure { private $count; /** diff --git a/core/Callbacks/Structures/ShootMania/OnArmorEmptyStructure.php b/core/Callbacks/Structures/ShootMania/OnArmorEmptyStructure.php index 23224f47..1aa9fa5b 100644 --- a/core/Callbacks/Structures/ShootMania/OnArmorEmptyStructure.php +++ b/core/Callbacks/Structures/ShootMania/OnArmorEmptyStructure.php @@ -2,6 +2,8 @@ namespace ManiaControl\Callbacks\Structures\ShootMania; +use ManiaControl\ManiaControl; + /** * Structure Class for the OnArmorEmpty Structure Callback * @@ -11,5 +13,4 @@ namespace ManiaControl\Callbacks\Structures\ShootMania; * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 */ class OnArmorEmptyStructure extends OnHitNearMissArmorEmptyBaseStructure { - } \ No newline at end of file diff --git a/core/Callbacks/Structures/ShootMania/OnHitNearMissArmorEmptyBaseStructure.php b/core/Callbacks/Structures/ShootMania/OnHitNearMissArmorEmptyBaseStructure.php index 9f92a180..f58799fe 100644 --- a/core/Callbacks/Structures/ShootMania/OnHitNearMissArmorEmptyBaseStructure.php +++ b/core/Callbacks/Structures/ShootMania/OnHitNearMissArmorEmptyBaseStructure.php @@ -26,9 +26,7 @@ class OnHitNearMissArmorEmptyBaseStructure extends BaseStructure { private $shooter; private $victim; - //private $shooterPoints; (was in mp3) - //private $hitDistance; (was in mp3) - + private $distance; /** * Construct a new On Hit Structure @@ -39,9 +37,10 @@ class OnHitNearMissArmorEmptyBaseStructure extends BaseStructure { public function __construct(ManiaControl $maniaControl, $data) { parent::__construct($maniaControl, $data); - $jsonObj = $this->getPlainJsonObject(); - $this->time = $jsonObj->time; - $this->weapon = $jsonObj->weapon; + $jsonObj = $this->getPlainJsonObject(); + $this->time = $jsonObj->time; + $this->weapon = $jsonObj->weapon; + $this->distance = $jsonObj->distance; $this->shooterPosition = new Position(); $this->shooterPosition->setX($jsonObj->shooterposition->x); @@ -117,4 +116,14 @@ class OnHitNearMissArmorEmptyBaseStructure extends BaseStructure { public function getVictim() { return $this->victim; } + + /** + * Distance Between Shooter and Victim at the time of the Event + * + * @api + * @return float + */ + public function getDistance() { + return $this->distance; + } } \ No newline at end of file diff --git a/core/Callbacks/Structures/ShootMania/OnHitStructure.php b/core/Callbacks/Structures/ShootMania/OnHitStructure.php index c4583528..3d5b3af4 100644 --- a/core/Callbacks/Structures/ShootMania/OnHitStructure.php +++ b/core/Callbacks/Structures/ShootMania/OnHitStructure.php @@ -15,7 +15,7 @@ use ManiaControl\ManiaControl; */ class OnHitStructure extends OnHitNearMissArmorEmptyBaseStructure { private $damage; - + private $shooterPoints; /** * OnHitStructure constructor. @@ -26,7 +26,8 @@ class OnHitStructure extends OnHitNearMissArmorEmptyBaseStructure { public function __construct(ManiaControl $maniaControl, array $data) { parent::__construct($maniaControl, $data); - $this->damage = $this->getPlainJsonObject()->damage; + $this->damage = $this->getPlainJsonObject()->damage; + $this->shooterPoints = $this->getPlainJsonObject()->points; } /** @@ -38,4 +39,15 @@ class OnHitStructure extends OnHitNearMissArmorEmptyBaseStructure { public function getDamage() { return $this->damage; } + + /** + * Amount of points scored by the shooter + * + * @api + * @return int + */ + public function getShooterPoints() { + return $this->shooterPoints; + } + } \ No newline at end of file diff --git a/core/Callbacks/Structures/ShootMania/OnNearMissStructure.php b/core/Callbacks/Structures/ShootMania/OnNearMissStructure.php index 48fe75c8..7eec2bf7 100644 --- a/core/Callbacks/Structures/ShootMania/OnNearMissStructure.php +++ b/core/Callbacks/Structures/ShootMania/OnNearMissStructure.php @@ -14,22 +14,4 @@ use ManiaControl\ManiaControl; * @license http://www.gnu.org/licenses/ GNU General Public License, Version 3 */ class OnNearMissStructure extends OnHitNearMissArmorEmptyBaseStructure { - private $distance; - - public function __construct(ManiaControl $maniaControl, array $data) { - parent::__construct($maniaControl, $data); - - $this->distance = $this->getPlainJsonObject()->distance; - } - - /** - * Returns the distance - * - * - * @api - * @return float - */ - public function getDistance() { - return $this->distance; - } } \ No newline at end of file diff --git a/core/Callbacks/Structures/ShootMania/OnScoresStructure.php b/core/Callbacks/Structures/ShootMania/OnScoresStructure.php index 21c60a6b..f7a27492 100644 --- a/core/Callbacks/Structures/ShootMania/OnScoresStructure.php +++ b/core/Callbacks/Structures/ShootMania/OnScoresStructure.php @@ -35,6 +35,7 @@ class OnScoresStructure extends CommonScoresStructure { $playerScore->setRank($jsonPlayer->rank); $playerScore->setRoundPoints($jsonPlayer->roundpoints); $playerScore->setMapPoints($jsonPlayer->mappoints); + $playerScore->setMatchPoints($jsonPlayer->matchpoints); $this->playerScores[$jsonPlayer->login] = $playerScore; } diff --git a/core/Callbacks/TrackManiaCallbacks.php b/core/Callbacks/TrackManiaCallbacks.php index e83cff75..b6175229 100644 --- a/core/Callbacks/TrackManiaCallbacks.php +++ b/core/Callbacks/TrackManiaCallbacks.php @@ -86,6 +86,10 @@ class TrackManiaCallbacks implements CallbackListener { break; case Callbacks::TM_WARMUPEND: break; + case Callbacks::TM_UIPROPERTIES: + //TODO structure, but wait for further update + $this->maniaControl->getCallbackManager()->triggerCallback($name, $data); + break; } } diff --git a/core/Maps/MapManager.php b/core/Maps/MapManager.php index 2dbb54d7..69a3193f 100644 --- a/core/Maps/MapManager.php +++ b/core/Maps/MapManager.php @@ -798,6 +798,7 @@ class MapManager implements CallbackListener, CommunicationListener, UsageInform * @param string $restart */ public function handleScriptBeginMap($mapUid, $restart) { + //TODO remove parseBoolean as soon the mp3 callbacks get removed $this->beginMap($mapUid, Formatter::parseBoolean($restart)); } @@ -987,8 +988,8 @@ class MapManager implements CallbackListener, CommunicationListener, UsageInform * @param $searchString * @return array */ - public function searchMapsByAuthor($searchString){ - return $this->searchMaps($searchString,self::SEARCH_BY_AUTHOR); + public function searchMapsByAuthor($searchString) { + return $this->searchMaps($searchString, self::SEARCH_BY_AUTHOR); } @@ -998,8 +999,8 @@ class MapManager implements CallbackListener, CommunicationListener, UsageInform * @param $searchString * @return array */ - public function searchMapsByMapName($searchString){ - return $this->searchMaps($searchString,self::SEARCH_BY_MAP_NAME); + public function searchMapsByMapName($searchString) { + return $this->searchMaps($searchString, self::SEARCH_BY_MAP_NAME); } /** @@ -1010,7 +1011,7 @@ class MapManager implements CallbackListener, CommunicationListener, UsageInform * @return array */ private function searchMaps($searchString, $searchBy = self::SEARCH_BY_MAP_NAME) { - $result = array(); + $result = array(); $searchString = strtolower($searchString); foreach ($this->maps as $map) { switch ($searchBy) { diff --git a/core/Script/ModeScriptEventManager.php b/core/Script/ModeScriptEventManager.php index 1c7cd59d..b1216477 100644 --- a/core/Script/ModeScriptEventManager.php +++ b/core/Script/ModeScriptEventManager.php @@ -3,7 +3,6 @@ namespace ManiaControl\Script; use ManiaControl\Callbacks\Callbacks; -use ManiaControl\Callbacks\Structures\XmlRpc\DocumentationStructure; use ManiaControl\General\UsageInformationAble; use ManiaControl\General\UsageInformationTrait; use ManiaControl\ManiaControl; @@ -228,6 +227,24 @@ class ModeScriptEventManager implements UsageInformationAble { $this->maniaControl->getClient()->triggerModeScriptEvent('Maniaplanet.WarmUp.Stop'); } + /** + * Blocks the End of the Warmup, + * + * @param int $time Timer before the end of the warmup when all players are ready. Use a negative value to prevent the warmup from ending even if all players are ready. + */ + public function blockEndWarmUp($time = -1) { + $this->maniaControl->getClient()->triggerModeScriptEvent('Maniaplanet.WarmUp.BlockEndWarmUp', array(true, $time)); + } + + /** + * Blocks the End of the Warmup, + * + * @param int $time Timer before the end of the warmup when all players are ready. Use a negative value to prevent the warmup from ending even if all players are ready. + */ + public function unBlockEndWarmUp($time = -1) { + $this->maniaControl->getClient()->triggerModeScriptEvent('Maniaplanet.WarmUp.BlockEndWarmUp', array(false, $time)); + } + /** * Get the status of the warmup. * @@ -246,34 +263,46 @@ class ModeScriptEventManager implements UsageInformationAble { * @api * @return \ManiaControl\Script\InvokeScriptCallback You can directly set a callable on it via setCallable() */ - public function getComboPauseStatus() { + public function getPauseStatus() { $responseId = $this->generateResponseId(); - $this->maniaControl->getClient()->triggerModeScriptEvent('Shootmania.Combo.GetPause', array($responseId)); - return new InvokeScriptCallback($this->maniaControl, Callbacks::SM_COMBO_PAUSESTATUS, $responseId); + $this->maniaControl->getClient()->triggerModeScriptEvent('Maniaplanet.Pause.GetStatus', array($responseId)); + return new InvokeScriptCallback($this->maniaControl, Callbacks::MP_PAUSE_STATUS, $responseId); } /** - * Start a Pause in Combo and triggers a Callback for the Pause Status + * Start a Pause and triggers a Callback for the Pause Status * * @api * @return \ManiaControl\Script\InvokeScriptCallback To get The Pause Status You can directly set a callable on it via setCallable() */ - public function startComboPause() { + public function startPause() { $responseId = $this->generateResponseId(); - $this->maniaControl->getClient()->triggerModeScriptEvent('Shootmania.Combo.SetPause', array(true, $responseId)); - return new InvokeScriptCallback($this->maniaControl, Callbacks::SM_COMBO_PAUSESTATUS, $responseId); + $this->maniaControl->getClient()->triggerModeScriptEvent('Maniaplanet.Pause.SetActive', array(true, $responseId)); + return new InvokeScriptCallback($this->maniaControl, Callbacks::MP_PAUSE_STATUS, $responseId); } /** - * End a Pause in Combo and triggers a Callback for the Pause Status + * End a Pause and triggers a Callback for the Pause Status * * @api * @return \ManiaControl\Script\InvokeScriptCallback To get The Pause Status You can directly set a callable on it via setCallable() */ - public function endComboPause() { + public function endPause() { $responseId = $this->generateResponseId(); - $this->maniaControl->getClient()->triggerModeScriptEvent('Shootmania.Combo.SetPause', array(false, $responseId)); - return new InvokeScriptCallback($this->maniaControl, Callbacks::SM_COMBO_PAUSESTATUS, $responseId); + $this->maniaControl->getClient()->triggerModeScriptEvent('Maniaplanet.Pause.SetActive', array(false, $responseId)); + return new InvokeScriptCallback($this->maniaControl, Callbacks::MP_PAUSE_STATUS, $responseId); + } + + /** + * Returns if the GameMode is a TeamMode or not + * + * @api + * @return \ManiaControl\Script\InvokeScriptCallback To get The TeamMode Status You can directly set a callable on it via setCallable() + */ + public function isTeamMode() { + $responseId = $this->generateResponseId(); + $this->maniaControl->getClient()->triggerModeScriptEvent('Maniaplanet.Mode.GetUseTeams', array($responseId)); + return new InvokeScriptCallback($this->maniaControl, Callbacks::MP_USES_TEAMMODE, $responseId); } /** @@ -321,7 +350,7 @@ class ModeScriptEventManager implements UsageInformationAble { */ public function getShootmaniaUIProperties() { $responseId = $this->generateResponseId(); - $this->maniaControl->getClient()->triggerModeScriptEvent('Shootmania.GetUIProperties', array($responseId)); + $this->maniaControl->getClient()->triggerModeScriptEvent('Shootmania.UI.GetProperties', array($responseId)); return new InvokeScriptCallback($this->maniaControl, Callbacks::SM_UIPROPERTIES, $responseId); } @@ -332,7 +361,7 @@ class ModeScriptEventManager implements UsageInformationAble { * @param string Json-Encoded Xml UI Property String */ public function setShootmaniaUIProperties($properties) { - $this->maniaControl->getClient()->triggerModeScriptEvent('Shootmania.GetUIProperties', array($properties)); + $this->maniaControl->getClient()->triggerModeScriptEvent(' Shootmania.UI.SetProperties', array($properties)); } /** @@ -377,7 +406,7 @@ class ModeScriptEventManager implements UsageInformationAble { */ public function getTrackmaniaUIProperties() { $responseId = $this->generateResponseId(); - $this->maniaControl->getClient()->triggerModeScriptEvent('Trackmania.GetUIProperties', array($responseId)); + $this->maniaControl->getClient()->triggerModeScriptEvent('Trackmania.UI.SetProperties', array($responseId)); return new InvokeScriptCallback($this->maniaControl, Callbacks::TM_SCORES, $responseId); } @@ -388,7 +417,7 @@ class ModeScriptEventManager implements UsageInformationAble { * @param string Json-Encoded Xml UI Property String */ public function setTrackmaniaUIProperties($properties) { - $this->maniaControl->getClient()->triggerModeScriptEvent('Shootmania.GetUIProperties', array($properties)); + $this->maniaControl->getClient()->triggerModeScriptEvent('Trackmania.UI.GetProperties', array($properties)); } /**