TrackManiaControl/core/Callbacks/Callbacks.php

352 lines
10 KiB
PHP
Raw Normal View History

2014-04-24 17:41:05 +02:00
<?php
2014-05-13 18:26:38 +02:00
2014-06-14 17:10:19 +02:00
// TODO: method class for all the libxmlrpc get Methods, to fetch the callback asnyc
2014-12-21 23:21:59 +01:00
// TODO implement all STOP callbacks
// 22-3-2017 Added/Fixed TM Callback for WayPoint // Need to Add better checks eventually
2014-06-14 17:10:19 +02:00
namespace ManiaControl\Callbacks;
2014-05-13 18:26:38 +02:00
2014-04-24 17:41:05 +02:00
/**
* Callbacks Interface
*
2014-05-02 17:50:30 +02:00
* @author ManiaControl Team <mail@maniacontrol.com>
2017-02-04 11:49:23 +01:00
* @copyright 2014-2017 ManiaControl Team
2014-04-24 17:41:05 +02:00
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
interface Callbacks {
/*
* ManiaControl Callbacks
*/
const ONINIT = 'Callbacks.OnInit';
const AFTERINIT = 'Callbacks.AfterInit';
const ONSHUTDOWN = 'Callbacks.OnShutdown';
2015-06-26 16:53:41 +02:00
const ONRESTART = 'Callbacks.OnRestart';
2014-05-13 18:26:38 +02:00
/** Script Callback: CallbackName, CallbackData */
2014-04-24 21:55:47 +02:00
const SCRIPTCALLBACK = 'Callbacks.ScriptCallback';
2014-05-13 18:26:38 +02:00
/*
* Common Callbacks
*/
//NEW Callbacks
const XMLRPC_CALLBACKSLIST = 'XmlRpc.CallbacksList';
const XMLRPC_ENABLEDCALLBACKS = 'XmlRpc.CallbacksList_Enabled';
const XMLRPC_DISABLEDCALLBACKS = 'XmlRpc.CallbacksList_Disabled';
const XMLRPC_CALLBACKHELP = 'XmlRpc.CallbackHelp';
const XMLRPC_METHODSLIST = 'XmlRpc.MethodsList';
const XMLRPC_METHODHELP = 'XmlRpc.MethodHelp';
const XMLRPC_DOCUMENTATION = 'XmlRpc.Documentation';
const XMLRPC_APIVERSION = 'XmlRpc.ApiVersion';
const XMLRPC_ALLAPIVERSIONS = 'XmlRpc.AllApiVersions';
2017-03-25 13:57:42 +01:00
const MP_STARTSERVERSTART = 'Maniaplanet.StartServer_Start';
const MP_STARTSERVEREND = 'Maniaplanet.StartServer_End';
const MP_STARTMATCHSTART = 'Maniaplanet.StartMatch_Start';
const MP_STARTMATCHEND = 'Maniaplanet.StartMatch_End';
//const MP_STARTMAPSTART = 'Maniaplanet.StartMap_Start';
//const MP_STARTMAPEND = 'Maniaplanet.StartMap_End';
const MP_STARTROUNDSTART = 'Maniaplanet.StartRound_Start';
const MP_STARTROUNDEND = 'Maniaplanet.StartRound_End';
const MP_STARTTURNSTART = 'Maniaplanet.StartTurn_Start';
const MP_STARTTURNEND = 'Maniaplanet.StartTurn_End';
const MP_STARTPLAYLOOP = 'Maniaplanet.StartPlayLoop';
const MP_ENDPLAYLOOP = 'Maniaplanet.EndPlayLoop';
const MP_ENDTURNSTART = 'Maniaplanet.EndTurn_Start';
const MP_ENDTURNEND = 'Maniaplanet.EndTurn_End';
const MP_ENDROUNDSTART = 'Maniaplanet.EndRound_Start';
const MP_ENDROUNDEND = 'Maniaplanet.EndRound_End';
//const MP_ENDMAPSTART = 'Maniaplanet.EndMap_Start';
//const MP_ENDMAPEND = 'Maniaplanet.EndMap_End';
const MP_ENDMATCHSTART = 'Maniaplanet.EndMatch_Start';
const MP_ENDMATCHEND = 'Maniaplanet.EndMatch_End';
const MP_ENDSERVERSTART = 'Maniaplanet.EndServer_Start';
const MP_ENDSERVEREND = 'Maniaplanet.EndServer_End';
const MP_LOADINGMAPSTART = 'Maniaplanet.LoadingMap_Start';
const MP_LOADINGMAPEND = 'Maniaplanet.LoadingMap_End';
const MP_UNLOADINGMAPSTART = 'Maniaplanet.UnloadingMap_Start';
const MP_UNLOADINGMAPEND = 'Maniaplanet.UnloadingMap_End';
const MP_PODIUMSTART = 'Maniaplanet.Podium_Start';
const MP_PODIUMEND = 'Maniaplanet.Podium_End';
2017-03-24 22:49:43 +01:00
const MP_WARMUP_START = 'Maniaplanet.WarmUp.Start';
const MP_WARMUP_END = 'Maniaplanet.WarmUp.End';
2017-04-07 17:28:04 +02:00
const MP_WARMUP_STATUS = 'Maniaplanet.WarmUp.Status';
const SM_UIPROPERTIES = 'Shootmania.UIProperties';
const SM_SCORES = "Shootmania.Scores";
2017-03-25 11:53:55 +01:00
2017-03-25 20:19:45 +01:00
const SM_ONEVENTDEFAULT = "Shootmania.Event.Default";
const SM_ONSHOOT = "Shootmania.Event.OnShoot";
const SM_ONHIT = "Shootmania.Event.OnHit";
const SM_ONNEARMISS = "Shootmania.Event.OnNearMiss";
const SM_ONARMOREMPTY = "Shootmania.Event.OnArmorEmpty";
const SM_ONCAPTURE = "Shootmania.Event.OnCapture";
const SM_ONSHOTDENY = "Shootmania.Event.OnShotDeny";
const SM_ONFALLDAMAGE = "Shootmania.Event.OnFallDamage";
const SM_ONCOMMAND = "Shootmania.Event.OnCommand";
2017-03-24 22:49:43 +01:00
//Shootmania.Event.OnPlayerRemoved Shootmania.Event.OnPlayerAdded not needed yet
2017-03-25 20:19:45 +01:00
const SM_ONPLAYERREQUESTRESPAWN = "Shootmania.Event.OnPlayerRequestRespawn";
2017-03-24 22:49:43 +01:00
const SM_ONACTIONCUSTOMEVENT = "Shootmania.Event.OnActionCustomEvent";
const SM_ONACTIONEVENT = "Shootmania.Event.OnActionEvent";
const SM_ONPLAYERTOUCHESOBJECT = "Shootmania.Event.OnPlayerTouchesObject";
const SM_ONPLAYERTRIGGERSSECTOR = "Shootmania.Event.OnPlayerTriggersSector";
const SM_ONPLAYERTHROWSOBJECT = "Shootmania.Event.OnPlayerThrowsObject";
const SM_ONPLAYERREQUESTACTIONCHANGE = "Shootmania.Event.OnPlayerRequestActionChange";
2017-04-07 17:28:04 +02:00
//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';
2017-04-07 17:28:04 +02:00
const SM_JOUST_SELECTEDPLAYERS = 'Shootmania.Joust.SelectedPlayers';
const SM_JOUST_ROUNDRESULT = 'Shootmania.Joust.RoundResult';
const SM_ROYAL_POINTS = 'Shootmania.Royal.Points';
const SM_ROYAL_PLAYERSPAWN = 'Shootmania.Royal.PlayerSpawn';
const SM_ROYAL_ROUNDWINNER = 'Shootmania.Royal.RoundWinner';
2017-04-01 10:30:18 +02:00
2017-04-07 17:28:04 +02:00
// New TM Callbacks
2017-04-01 10:30:18 +02:00
const TM_ONEVENTDEFAULT = "Trackmania.Event.Default";
const TM_ONEVENTSTARTLINE = "Trackmania.Event.StartLine";
const TM_ONCOMMAND = "Trackmania.Event.OnCommand";
const TM_ONPLAYERADDED = "Trackmania.Event.OnPlayerAdded";
const TM_ONPLAYERREMOVED = "Trackmania.Event.OnPlayerRemoved";
const TM_ONWAYPOINT = "Trackmania.Event.WayPoint";
const TM_ONGIVEUP = "Trackmania.Event.GiveUp";
const TM_ONRESPAWN = "Trackmania.Event.Respawn";
const TM_ONSTUNT = "Trackmania.Event.Stunt";
const TM_ONSTARTCOUNTDOWN = "Trackmania.Event.StartCountdown";
const TM_SCORES = "Trackmania.Scores";
const TM_WARMUPSTART = "Trackmania.WarmUp.Start";
const TM_WARMUPSTARTROUND = "Trackmania.WarmUp.StartRound";
const TM_WARMUPENDROUND = "Trackmania.WarmUp.EndRound";
const TM_WARMUPEND = "Trackmania.WarmUp.End";
const TM_UIPROPERTIES = 'Trackmania.UIProperties';
const TM_POINTSREPARTITION = 'Trackmania.PointsRepartition';
//ManiaControl Callbacks
/** BeginMap Callback: Map */
const BEGINMAP = 'Callbacks.BeginMap';
2017-04-01 11:12:06 +02:00
/** EndMap Callback: Map*/
const ENDMAP = 'Callbacks.EndMap';
//OLD Callbacks
2017-04-01 10:30:18 +02:00
/** BeginMatch Callback: MatchNumber
*
* @deprecated
*/
2014-05-13 18:26:38 +02:00
const BEGINMATCH = 'Callbacks.BeginMatch';
2017-04-01 10:30:18 +02:00
/** LoadingMap Callback: MapNumber
*
* @deprecated
*/
2014-05-13 18:26:38 +02:00
const LOADINGMAP = 'Callbacks.LoadingMap';
2017-04-01 10:30:18 +02:00
/** BeginSubMatch Callback: SubmatchNumber
*
* @deprecated
*/
2014-05-13 18:26:38 +02:00
const BEGINSUBMATCH = 'Callbacks.BeginSubmatch';
2017-04-01 10:30:18 +02:00
/** BeginRound Callback: RoundNumber
*
* @deprecated
*/
2014-05-13 18:26:38 +02:00
const BEGINROUND = 'Callbacks.BeginRound';
2017-04-01 10:30:18 +02:00
/** BeginTurn Callback: TurnNumber
*
* @deprecated
*/
2014-05-13 18:26:38 +02:00
const BEGINTURN = 'Callbacks.BeginTurn';
2017-04-01 10:30:18 +02:00
/** BeginTurnStop Callback: TurnNumber
*
* @deprecated
*/
2014-12-21 23:21:59 +01:00
const BEGINTURNSTOP = 'Callbacks.BeginTurnStop';
2017-04-01 10:30:18 +02:00
/** BeginPlaying Callback
*
* @deprecated
*/
2014-05-24 16:11:35 +02:00
const BEGINPLAYING = 'Callbacks.BeginPlaying';
2017-04-01 10:30:18 +02:00
/** EndPlaying Callback
*
* @deprecated
*/
2014-05-24 16:11:35 +02:00
const ENDPLAYING = 'Callbacks.EndPlaying';
2017-04-01 10:30:18 +02:00
/** EndTurn Callback: TurnNumber
*
* @deprecated
*/
2014-05-13 18:26:38 +02:00
const ENDTURN = 'Callbacks.EndTurn';
2017-04-01 10:30:18 +02:00
/** EndTurnStop Callback: TurnNumber
*
* @deprecated
*/
2014-12-21 23:21:59 +01:00
const ENDTURNSTOP = 'Callbacks.EndTurnStop';
2017-04-01 10:30:18 +02:00
/** EndRound Callback: RoundNumber
*
* @deprecated
*/
2014-05-13 18:26:38 +02:00
const ENDROUND = 'Callbacks.EndRound';
2017-04-01 10:30:18 +02:00
/** EndRound Callback: RoundNumber
*
* @deprecated
*/
2015-01-23 19:05:07 +01:00
const ENDROUNDSTOP = 'Callbacks.EndRoundStop';
2017-04-01 10:30:18 +02:00
/** EndSubmatch Callback: SubmatchNumber
*
* @deprecated
*/
2014-05-13 18:26:38 +02:00
const ENDSUBMATCH = 'Callbacks.EndSubmatch';
2017-04-01 11:12:06 +02:00
2017-04-01 10:30:18 +02:00
/** BeginPodium Callback
*
* @deprecated
*/
2014-05-24 16:11:35 +02:00
const BEGINPODIUM = 'Callbacks.BeginPodium';
2017-04-01 10:30:18 +02:00
/** EndPodium Callback
*
* @deprecated
*/
2014-05-24 16:11:35 +02:00
const ENDPODIUM = 'Callbacks.EndPodium';
2017-04-01 10:30:18 +02:00
/** UnloadingMap Callback
*
* @deprecated
*/
2014-05-24 16:11:35 +02:00
const UNLOADINGMAP = 'Callbacks.UnloadingMap';
2017-04-01 10:30:18 +02:00
/** EndMatch Callback: MatchNumber
*
* @deprecated
*/
const ENDMATCH = 'Callbacks.EndMatch';
2014-05-13 18:26:38 +02:00
2017-04-01 10:30:18 +02:00
/** BeginWarmup Callback
*
* @deprecated
*/
2014-05-13 18:26:38 +02:00
const BEGINWARMUP = 'Callbacks.BeginWarmUp';
2017-04-01 10:30:18 +02:00
/** EndWarmup Callback
*
* @deprecated
*/
2014-05-13 18:26:38 +02:00
const ENDWARMUP = 'Callbacks.EndWarmUp';
2017-04-01 10:30:18 +02:00
/** Scores Callback (returned after LibXmlRpc_PlayerRanking): Scores
*
* @deprecated
*/
2015-08-20 18:48:14 +02:00
const SCORESREADY = 'Callbacks.ScoresReady';
2017-04-01 10:30:18 +02:00
/** Scores Callback (returned after LibXmlRpc_PlayerRanking in SM, or LibXmlRpc_TeamsScores in Trackmania): Scores
*
* @deprecated
*/
2015-08-20 18:48:14 +02:00
const SCORES = 'Callbacks.Scores';
2017-04-01 10:30:18 +02:00
/** Rankings Callback
*
* @deprecated
*/
2017-02-04 11:41:31 +01:00
const RANKINGS = 'Callbacks.Rankings';
2014-05-13 18:26:38 +02:00
/** PlayerRanking Callback, returned after LibXmlRpc_PlayerRanking
2014-04-24 23:11:09 +02:00
* try to avoid to use this, just use the Get function of the RankingsManager instead
* param1 Player $player
* param2 int $rank
* param3 int $currentPoints
2017-04-01 10:30:18 +02:00
* param4 int AFKStatus
*
* @deprecated
*/
2014-04-24 23:11:09 +02:00
const PLAYERRANKING = 'Callbacks.PlayerRanking';
2014-05-13 18:26:38 +02:00
/*
* ShootMania Callbacks
*/
2017-04-01 10:30:18 +02:00
/** RankingsUpdated Callback: SortedRankings
*
* @deprecated
*/
2014-04-24 23:11:09 +02:00
const RANKINGSUPDATED = 'Callbacks.RankingsUpdated';
2014-05-13 18:26:38 +02:00
2017-04-01 10:30:18 +02:00
/** Returns the AFKStatus of an Player, returned after param1 Scores
*
* @deprecated
*/
2014-04-24 23:11:09 +02:00
const AFKSTATUS = 'Callbacks.AfkStatus';
2017-04-01 10:30:18 +02:00
/** Returns if the GameMode has Warmup activated, returned after param1 Scores
*
* @deprecated
*/
2014-04-24 23:11:09 +02:00
const WARMUPSTATUS = 'Callbacks.WarmupStatus';
2014-05-24 16:11:35 +02:00
2017-04-01 10:30:18 +02:00
/** OnShoot Callback: Player, WeaponNumber (see Weapons Structure)
*
* @deprecated
*/
2014-10-10 14:40:00 +02:00
const ONSHOOT = 'Callbacks.OnShoot';
2017-04-01 10:30:18 +02:00
/** OnHit Callback: PlayerHitStructure
*
* @deprecated
*/
2014-10-10 14:40:00 +02:00
const ONHIT = 'Callbacks.OnHit';
2017-04-01 10:30:18 +02:00
/** OnNearMiss Callback: NearMissStructure
*
* @deprecated
*/
2014-10-10 14:40:00 +02:00
const ONNEARMISS = 'Callbacks.OnNearMiss';
2017-04-01 10:30:18 +02:00
/** OnArmorEmpty Callback: ArmorEmptyStructure
*
* @deprecated
*/
const ONARMOREMPTY = 'Callbacks.OnArmorEmpty';
2017-04-01 10:30:18 +02:00
/** OnCapture Callback: CaptureStructure
*
* @deprecated
*/
const ONCAPTURE = 'Callbacks.OnCapture';
2017-04-01 10:30:18 +02:00
/** OnPlayerRequestRespawn Callback: Player
*
* @deprecated
*/
const ONPLAYERREQUESTRESPAWN = 'Callbacks.OnPlayerRequestRespawn';
2014-10-10 14:40:00 +02:00
2017-04-01 10:30:18 +02:00
/** Joust Selected Players
*
* @deprecated
*/
2017-02-04 11:41:31 +01:00
const JOUST_SELECTEDPLAYERS = "Callbacks.JoustSelectedPlayers";
2014-05-24 16:11:35 +02:00
/*
* TrackMania Callbacks
*/
2017-04-01 10:30:18 +02:00
/** OnStartLine Callback
*
* @deprecated
*/
const ONSTARTLINE = 'Callbacks.StartLine';
2017-04-01 10:30:18 +02:00
/** OnWayPoint Callback
*
* @deprecated
*/
const ONWAYPOINT = 'Callbacks.WayPoint';
2017-04-01 10:30:18 +02:00
/** OnGiveUp Callback
*
* @deprecated
*/
const ONGIVEUP = 'Callbacks.GiveUp';
2017-04-01 10:30:18 +02:00
/** OnRespawn Callback
*
* @deprecated
*/
const ONRESPAWN = 'Callbacks.Respawn';
2017-04-01 10:30:18 +02:00
/** OnStunt Callback
*
* @deprecated
*/
const ONSTUNT = 'Callbacks.Stunt';
2014-12-20 18:43:51 +01:00
2014-05-13 18:26:38 +02:00
}