callbacks update https://github.com/maniaplanet/script-xmlrpc/releases
to have this mc version working you need to update the dedicated server scripts
This commit is contained in:
		@@ -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
 | 
			
		||||
	 */
 | 
			
		||||
 
 | 
			
		||||
@@ -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':
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										39
									
								
								core/Callbacks/Structures/Common/BaseTimeStructure.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								core/Callbacks/Structures/Common/BaseTimeStructure.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,39 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace ManiaControl\Callbacks\Structures\Common;
 | 
			
		||||
 | 
			
		||||
use ManiaControl\ManiaControl;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Base Structure Class for all Callbacks using a Timestamp
 | 
			
		||||
 *
 | 
			
		||||
 * @api
 | 
			
		||||
 * @author    ManiaControl Team <mail@maniacontrol.com>
 | 
			
		||||
 * @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;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@@ -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;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -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;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,50 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace ManiaControl\Callbacks\Structures\ManiaPlanet;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
use ManiaControl\Callbacks\Structures\Common\BaseTimeStructure;
 | 
			
		||||
use ManiaControl\ManiaControl;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Structure Class for the Loading Map End and UnloadingMap Begin Callbacks
 | 
			
		||||
 *
 | 
			
		||||
 * @api
 | 
			
		||||
 * @author    ManiaControl Team <mail@maniacontrol.com>
 | 
			
		||||
 * @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);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,41 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace ManiaControl\Callbacks\Structures\ManiaPlanet;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
use ManiaControl\Callbacks\Structures\Common\BaseResponseStructure;
 | 
			
		||||
use ManiaControl\ManiaControl;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Structure Class for the Mode use  Teams Callback
 | 
			
		||||
 *
 | 
			
		||||
 * @api
 | 
			
		||||
 * @author    ManiaControl Team <mail@maniacontrol.com>
 | 
			
		||||
 * @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;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@@ -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;
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
 
 | 
			
		||||
@@ -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 {
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -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;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@@ -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;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -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;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@@ -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;
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user