JavaScript required!
This site require to have JavaScript turned on, otherwise you are not able to navigate and can not see all the nice content!
Development
Events in XAseco1 and XAseco2
What are events?
XAseco signals with an event various signals that XAseco receive from
e.g. the dedicated server when a Player joins (onPlayerConnect
(main event) or onPlayerConnect2
(postfix event))
or from other Plugins to signal something.
With these events you are able to interact in your Plugin, e.g. when a Player cross the finish line
(onPlayerFinish
(main event) or onPlayerFinish1
(prefix event)), or
when the Player gained a new local record (onLocalRecord
), and many more.
How to use a event?
To use a event, you have to register a function in your Plugin which is called, if the event is fired from XAseco
or better the dedicated Server. The name of your function that should be called from XAseco should have a unique name to prevent
conflicts with other Plugins or XAseco himself.
My rule for such a name is simple: shortcut of my Plugin, then a underscore and then the name of the event, e.g. re_onSync
.
The shortcut re
stays for my Plugin Records-Eyepiece . With this naming convention you are able to see
quickly at which event the function is called from.
I use this rule for all the functions i use in my Plugin, so i never had problems with other Plugins or XAseco himself.
Register a event
Aseco::registerEvent('onSync', 're_onSync');
This should be placed before all your functions (see also my Hello World ).
Development
Events comparative table
There are differences between XAseco1 and XAseco2 at the name of some events, the meaning and the moment
they triggered are exact the same.
XAseco1/1.15+
Event
Parameter
onNewChallenge
yes
onNewChallenge2
yes
onEndRace
yes
onEndRace1
yes
onRestartChallenge
yes
onRestartChallenge2
yes
onTracklistChanged
yes
onChallengeListModified
yes
XAseco2/1.01+
Event
Parameter
onBeginMap
yes
onBeginMap2
yes
onEndMap
yes
onEndMap1
yes
onRestartMap
yes
onRestartMap2
yes
onMaplistChanged
yes
onMapListModified
yes
Development
All available events in XAseco1/1.15+
Ordered by logical meaning (click on the head to sort alphabetically).
Event
Parameter
Released from
onStartup
$aseco
aseco.php
onSync
$aseco
aseco.php
onMainLoop
$aseco
aseco.php
onEverySecond
$aseco
aseco.php
onStatusChangeTo1
$aseco, $call
aseco.php
onStatusChangeTo2
$aseco, $call
aseco.php
onStatusChangeTo3
$aseco, $call
aseco.php
onStatusChangeTo4
$aseco, $call
aseco.php
onStatusChangeTo5
$aseco, $call
aseco.php
onShutdown
$aseco
aseco.php
onPlayerConnect
$aseco, $player
aseco.php
onPlayerConnect2
$aseco, $player
aseco.php
onPlayerDisconnect
$aseco, $player
aseco.php
onPlayerManialinkPageAnswer
$aseco, $answer
aseco.php
onPlayerServerMessageAnswer
$aseco, $answer
aseco.php
onPlayerFinish1
$aseco, $finish
aseco.php
onPlayerFinish
$aseco, $finish
aseco.php
onPlayerWins
$aseco, $player
aseco.php
onPlayerInfoChanged
$aseco, $changes
aseco.php
onPlayerIncoherence
$aseco, $state
aseco.php
onNewChallenge
$aseco, $challenge
aseco.php
onNewChallenge2
$aseco, $challenge
aseco.php
onBeginRound
$aseco
aseco.php
onEndRound
$aseco
aseco.php
onRestartChallenge
$aseco, $challenge
aseco.php
onRestartChallenge2
$aseco, $challenge
aseco.php
onEndRace1
$aseco, $race
aseco.php
onEndRace
$aseco, $race
aseco.php
onCheckpoint
$aseco, $checkpoint
aseco.php
onDedimaniaRecord
$aseco, $record
plugin.dedimania.php
onDediRecsLoaded
$aseco, $recs_valid
plugin.dedimania.php
onLocalRecord
$aseco, $record
plugin.localdatabase.php
onKarmaChange
$aseco, $karma
plugin.rasp_karma.php
onChat
$aseco, $chat
aseco.php
onDonation
$aseco, $donation
plugin.donate.php
onBillUpdated
$aseco, $bill
aseco.php
onEcho
$aseco, $echo
aseco.php
onTunnelDataReceived
$aseco, $data
aseco.php
onManualFlowControlTransition
$aseco, $transition
aseco.php
onVoteUpdated
$aseco, $vote
aseco.php
onJukeboxChanged
$aseco, $command
chat.admin.php, plugin.rasp_jukebox.php
onTracklistChanged
$aseco, $command
chat.admin.php, plugin.rasp_jukebox.php
onChallengeListModified
$aseco, $data
aseco.php
onMusicboxReloaded
$aseco
plugin.musicserver.php
The event onStatusChangeTo[1-5]
has the following meaning:
ID
StatusName
1
Waiting
2
Launching
3
Running - Synchronization
4
Running - Play
5
Running - Finish
Available events in third-party Plugins i have found over the years or have build by myself in some of my Plugins.
Development
All available events in XAseco2/1.01+
Ordered by logical meaning (click on the head to sort alphabetically).
Event
Parameter
Released from
onStartup
$aseco
xaseco2.php
onSync
$aseco
xaseco2.php
onMainLoop
$aseco
xaseco2.php
onEverySecond
$aseco
xaseco2.php
onStatusChangeTo1
$aseco, $call
xaseco2.php
onStatusChangeTo2
$aseco, $call
xaseco2.php
onStatusChangeTo3
$aseco, $call
xaseco2.php
onStatusChangeTo4
$aseco, $call
xaseco2.php
onStatusChangeTo6
$aseco, $call
xaseco2.php
onShutdown
$aseco
xaseco2.php
onPlayerConnect
$aseco, $player
xaseco2.php
onPlayerConnect2
$aseco, $player
xaseco2.php
onPlayerDisconnect
$aseco, $player
xaseco2.php
onPlayerManialinkPageAnswer
$aseco, $answer
xaseco2.php
onPlayerFinish1
$aseco, $finish
xaseco2.php
onPlayerFinish
$aseco, $finish
xaseco2.php
onPlayerWins
$aseco, $player
xaseco2.php
onPlayerInfoChanged
$aseco, $changes
xaseco2.php
onPlayerIncoherence
$aseco, $state
xaseco2.php
onBeginMap
$aseco, $map
xaseco2.php
onBeginMap2
$aseco, $map
xaseco2.php
onBeginRound
$aseco
xaseco2.php
onEndRound
$aseco
xaseco2.php
onRestartMap
$aseco, $map
xaseco2.php
onRestartMap2
$aseco, $map
xaseco2.php
onEndMap1
$aseco, $race
xaseco2.php
onEndMap
$aseco, $race
xaseco2.php
onCheckpoint
$aseco, $checkpoint
xaseco2.php
onDedimaniaRecord
$aseco, $record
plugin.dedimania.php
onDediRecsLoaded
$aseco, $recs_valid
plugin.dedimania.php
onLocalRecord
$aseco, $record
plugin.localdatabase.php
onKarmaChange
$aseco, $karma
plugin.rasp_karma.php
onChat
$aseco, $chat
xaseco2.php
onDonation
$aseco, $donation
plugin.donate.php
onBillUpdated
$aseco, $bill
xaseco2.php
onEcho
$aseco, $echo
xaseco2.php
onTunnelDataReceived
$aseco, $data
xaseco2.php
onManualFlowControlTransition
$aseco, $transition
xaseco2.php
onVoteUpdated
$aseco, $vote
xaseco2.php
onJukeboxChanged
$aseco, $command
chat.admin.php, plugin.rasp_jukebox.php
onMaplistChanged
$aseco, $command
chat.admin.php, plugin.rasp_jukebox.php
onMapListModified
$aseco, $data
xaseco2.php
onMusicboxReloaded
$aseco
plugin.musicserver.php
onRulesScriptCallback
$aseco, $call
xaseco2.php
The event onStatusChangeTo[1-4,6]
has the following meaning:
ID
StatusName
1
Waiting
2
Launching
3
Running - Synchronization
4
Running - Play
6
Running - Exit
Available events in third-party Plugins i have found over the years or have build by myself in some of my Plugins.
Development
Description of each event in XAseco1
onStartup ($aseco)
Event triggered after loading plugins and getting the server version.
At this point XAseco does not have syncronized the status with server and does not have
the server name or the player count or players loaded yet. The event onSync
is the better place for loading your configuration or init your Plugin.
onSync ($aseco)
Event triggered after server status has been syncronized.
After this event $aseco->server->players->player_list
is still empty!
onMainLoop ($aseco)
Event triggered every loop after all callbacks and methodcalls have been sent to server.
onEverySecond ($aseco)
Event triggered every second.
The time between one triggering to the next can be longer then exact a second,
this is when XAseco or a Plugin is busy!
onStatusChangeTo1 ($aseco)
Event triggered when server goes to Waiting
state
onStatusChangeTo2 ($aseco)
Event triggered when server goes to Launching
state (ie. after podium ends and new map loading sequence starts)
onStatusChangeTo3 ($aseco)
Event triggered when server goes to Running - Syncronizing
state, you see the map and text waiting... then you see 3-2-1-Go!
onStatusChangeTo4 ($aseco)
Event triggered when server goes to Running - Play
state, after "GO!"
onStatusChangeTo5 ($aseco)
Event triggered when server goes to Running - Finish
state, you see the Scoretable.
onShutdown ($aseco)
Event triggered when Xaseco is shutting down, ie. with /admin shutdown
.
onPlayerConnect ($aseco, $player)
Main event, triggered when a Player connects to the server.
onPlayerConnect2 ($aseco, $player)
Postfix event, triggered when a Player connects to the server.
This event is meant for access control.
onPlayerDisconnect ($aseco, $player)
Event triggered when a Player leaves the Server.
onPlayerManialinkPageAnswer ($aseco, $answer)
Event triggered when a Player clicks a server-side manialink that has action="[number]",
returns a array with Player login and action id.
$answer[0] = PlayerUid (from dedicated server)
$answer[1] = Login
$answer[2] = Action Id
onPlayerServerMessageAnswer ($aseco, $answer)
Handles clicks on server messageboxes.
TMN only, in TMF replaced by onPlayerManialinkPageAnswer
.
onPlayerFinish1 ($aseco, $finish)
Postfix event, triggered when Player crosses the finishline or when Player is starting new race (giveup).
onPlayerFinish ($aseco, $finish)
Main event, triggered when Player crosses the finishline or when Player is starting new race (giveup).
onPlayerWins ($aseco, $player)
Event triggered before the Scoretable and only for that Player that wins this race.
onPlayerInfoChanged ($aseco, $changes)
Event triggered when the Playerinfo changes, this happens when the Player switch from Player to a Spectator or
changes the Team in Teammode.
onPlayerIncoherence ($aseco, $state)
Event triggered when the red text that says that the Player time is invalid.
onNewChallenge ($aseco, $challenge)
Main event, triggered when a new Track is loaded.
At this stage the check for a relay server is not done.
onNewChallenge2 ($aseco, $challenge)
Postfix event, triggered when a new Track is loaded.
Including the check for a relay server.
onBeginRound ($aseco)
Event triggered when the round begins.
This happens always in Gamemode TimeAttack and Rounds or Cup when a new round starts.
onEndRound ($aseco)
Event triggered when round end.
This happens always in Gamemode TimeAttack and Rounds or Cup when a new round ends.
onRestartChallenge ($aseco, $challenge)
Main event, triggered when a Track are restarted.
This is a instant restart and no Players has finished the Track yet,
in this case the Scoretable are skipped.
onRestartChallenge2 ($aseco, $challenge)
Postfix event, triggered when a Track are restarted.
This is a restart where the Scoretable was shown, because one of the Players has finished the Track.
onEndRace ($aseco, $race)
Main event, triggered when the server switch from Race to Score.
onEndRace1 ($aseco, $race)
Postfix event, triggered when the server switch from Race to Score.
onCheckpoint ($aseco, $checkpoint)
Event triggered every time a Player drive through a Checkpoint,
be carefully while using this event, this could slowdown XAseco!
TMN
$checkpoint[0] = PlayerUid
$checkpoint[1] = Login
$checkpoint[2] = Time
$checkpoint[3] = Score
$checkpoint[4] = CheckpointIndex
TMF
$checkpoint[0] = PlayerUid
$checkpoint[1] = Login
$checkpoint[2] = TimeScore
$checkpoint[3] = CurLap
$checkpoint[4] = CheckpointIndex
onDedimaniaRecord ($aseco, $record)
Event triggered when a Player received or driven a better time for his/her current Dedimania record.
onDediRecsLoaded ($aseco, $recs_valid)
Event triggered when the Dedimania-Records are loaded from the remote database.
onLocalRecord ($aseco, $record)
Event triggered when a Player received or driven a better time or score for his/her current local record.
In the Gamemode Stunts
the Player received a score
instead of getting a time
!
onKarmaChange ($aseco, $karma)
Event triggered when a Player vote a Track.
$karma['Karma']
$karma['Total']
$karma['Good']
$karma['Bad']
$karma['GoodPct']
$karma['BadPct']
onChat ($aseco, $chat)
Event triggerd every time a Player send a Message.
$chat[0] = PlayerUid (Id 0
is the decidated server, all others are the PlayerUids (from the dedicated server))
$chat[1] = Login who has start the Chat
$chat[2] = Message or chat command
$chat[3] = Boolean (true
or false
which indicates if this was a registred command)
onDonation ($aseco, $donation)
Event triggered when a Player donate some Coppers with /donate [N]
.
$donation = The amount of Coppers.
onBillUpdated ($aseco, $bill)
Event triggered when the server received a transaction from a Player to check the bill state.
$bill[0] = BillId
$bill[1] = State
$bill[2] = StateName
$bill[3] = TransactionId
onEcho ($aseco, $echo)
FIX ME
onTunnelDataReceived ($aseco, $data)
Can be use with the Method TunnelSendDataToLogin()
to communicate with the game server
from the relay or the other way around.
onManualFlowControlTransition ($aseco, $transition)
FIX ME
onVoteUpdated ($aseco, $vote)
FIX ME
onJukeboxChanged ($aseco, $command)
Event triggered when the Jukebox has been changed.
$command[0] = 'add', 'clear', 'drop', 'play', 'replay', 'restart', 'skip', 'previous', 'nextenv'
$command[1] = track data (or 'null' for the 'clear' action)
onTracklistChanged ($aseco, $command)
Event triggered when the Tracklist has been changed.
$command[0] = 'add', 'remove', 'rename', 'juke', 'unjuke', 'read', 'write'
$command[1] = filename of Track (or 'null' for the 'write' or 'read' action)
onChallengeListModified ($aseco, $data)
FIX ME
onMusicboxReloaded ($aseco)
Event triggered to alert that the music server config file (musicserver.xml) was reloaded via /music reload
.
Development
Description of each event in XAseco2
onStartup ($aseco)
Event triggered after loading plugins and getting the server version.
At this point XAseco does not have syncronized the status with server and does not have
the server name or the player count or players loaded yet. The event onSync
is the better place for loading your configuration or init your Plugin.
onSync ($aseco)
Event triggered after server status has been syncronized.
After this event $aseco->server->players->player_list
is still empty!
span
onMainLoop ($aseco)
Event triggered every loop after all callbacks and methodcalls have been sent to server.
onEverySecond ($aseco)
Event triggered every second.
The time between one triggering to the next can be longer then exact a second,
this is when XAseco or a Plugin is busy!
onStatusChangeTo1 ($aseco)
Event triggered when server goes to Waiting
state
onStatusChangeTo2 ($aseco)
Event triggered when server goes to Launching
state (ie. after podium ends and new map loading sequence starts)
onStatusChangeTo3 ($aseco)
Event triggered when server goes to Running - Syncronizing
state, you see the map and text waiting... then you see 3-2-1-Go!
onStatusChangeTo4 ($aseco)
Event triggered when server goes to Running - Play
state, after "GO!"
onStatusChangeTo6 ($aseco)
Event triggered when server goes to Running - Exit
state, you see the Scoretable.
onShutdown ($aseco)
Event triggered when Xaseco is shutting down, ie. with /admin shutdown
.
onPlayerConnect ($aseco, $player)
Main event, triggered when a Player connects to the server.
onPlayerConnect2 ($aseco, $player)
Postfix event, triggered when a Player connects to the server.
This event is meant for access control.
onPlayerDisconnect ($aseco, $player)
Event triggered when a Player leaves the Server.
onPlayerManialinkPageAnswer ($aseco, $answer)
Event triggered when a Player clicks a server-side manialink that has action="[number]",
returns a array with Player login and action id.
$answer[0] = PlayerUid (from dedicated server)
$answer[1] = Login
$answer[2] = Action Id
onPlayerServerMessageAnswer ($aseco, $answer)
Handles clicks on server messageboxes.
TMN only, in TMF replaced by onPlayerManialinkPageAnswer
.
onPlayerFinish1 ($aseco, $finish)
Postfix event, triggered when Player crosses the finishline or when Player is starting new race (giveup).
onPlayerFinish ($aseco, $finish)
Main event, triggered when Player crosses the finishline or when Player is starting new race (giveup).
onPlayerWins ($aseco, $player)
Event triggered before the Scoretable and only for that Player that wins this race.
onPlayerInfoChanged ($aseco, $changes)
Event triggered when the Playerinfo changes, this happens when the Player switch from Player to a Spectator or
changes the Team in Teammode.
onPlayerIncoherence ($aseco, $state)
Event triggered when the red text that says that the Player time is invalid.
onBeginMap ($aseco, $map)
Main event, triggered when a new Map is loaded.
At this stage the check for a relay server is not done.
onBeginMap2 ($aseco, $map)
Postfix event, triggered when a new Map is loaded.
Including the check for a relay server.
onBeginRound ($aseco)
Event triggered when the round begins.
This happens always in Gamemode TimeAttack and Rounds or Cup when a new round starts.
onEndRound ($aseco)
Event triggered when round end.
This happens always in Gamemode TimeAttack and Rounds or Cup when a new round ends.
onRestartMap ($aseco, $map)
Main event, triggered when a Map are restarted.
This is a instant restart and no Players has finished the Map yet,
in this case the Scoretable are skipped.
onRestartMap2 ($aseco, $map)
Postfix event, triggered when a Map are restarted.
This is a restart where the Scoretable was shown, because one of the Players has finished the Map.
onEndMap ($aseco, $race)
Main event, triggered when the server switch from Race to Score.
onEndMap1 ($aseco, $race)
Postfix event, triggered when the server switch from Race to Score.
onCheckpoint ($aseco, $checkpoint)
Event triggered every time a Player drive through a Checkpoint,
be carefully while using this event, this could slowdown XAseco!
$checkpoint[0] = PlayerUid
$checkpoint[1] = Login
$checkpoint[2] = TimeOrScore
$checkpoint[3] = CurLap
$checkpoint[4] = CheckpointIndex
onDedimaniaRecord ($aseco, $record)
Event triggered when a Player received or driven a better time for his/her current Dedimania record.
onDediRecsLoaded ($aseco, $recs_valid)
Event triggered when the Dedimania-Records are loaded from the remote database.
onLocalRecord ($aseco, $record)
Event triggered when a Player received or driven a better time or score for his/her current local record.
In the Gamemode Stunts
the Player received a score
instead of getting a time
!
onKarmaChange ($aseco, $karma)
Event triggered when a Player vote a Track.
$karma['Karma']
$karma['Total']
$karma['Good']
$karma['Bad']
$karma['GoodPct']
$karma['BadPct']
onChat ($aseco, $chat)
Event triggerd every time a Player send a Message.
$chat[0] = PlayerUid (Id 0
is the decidated server, all others are the PlayerUids (from the dedicated server))
$chat[1] = Login who has start the Chat
$chat[2] = Message or chat command
$chat[3] = Boolean (true
or false
which indicates if this was a registred command)
onDonation ($aseco, $donation)
Event triggered when a Player donate some Planets with /donate [N]
.
$donation = The amount of Planets.
onBillUpdated ($aseco, $bill)
Event triggered when the server received a transaction from a Player to check the bill state.
$bill[0] = BillId
$bill[1] = State
$bill[2] = StateName
$bill[3] = TransactionId
onEcho ($aseco, $echo)
FIX ME
onTunnelDataReceived ($aseco, $data)
Can be use with the Method TunnelSendDataToLogin()
to communicate with the game server
from the relay or the other way around.
onManualFlowControlTransition ($aseco, $transition)
FIX ME
onVoteUpdated ($aseco, $vote)
FIX ME
onJukeboxChanged ($aseco, $command)
Event triggered when the Jukebox has been changed.
$command[0] = 'add', 'clear', 'drop', 'play', 'replay', 'restart', 'skip', 'previous', 'nextenv'
$command[1] = track data (or 'null' for the 'clear' action)
onMaplistChanged ($aseco, $command)
Event triggered when the Maplist has been changed.
$command[0] = 'add', 'remove', 'rename', 'juke', 'unjuke', 'read', 'write'
$command[1] = filename of Map (or 'null' for the 'write' or 'read' action)
onMapListModified ($aseco, $data)
FIX ME
onMusicboxReloaded ($aseco)
Event triggered to alert that the music server config file (musicserver.xml) was reloaded via /music reload
.
onRulesScriptCallback ($aseco, $call)
FIX ME
Last modified: Sun, 03 Mar 2013 21:08:05 +0100
This is a private enthusiast Website. Maniaplanet, Trackmania, Shootmania, Nadeo are trademarks of Ubisoft Entertainment.
XAseco is maintained by Frans P. de Vries.
MPAseco is maintained by Kremsy, ManiacTwister & TheM
Reordered Navigation
Maybe you have already noticed, that i have changed the order in
the Navigation. Since now XAseco2 is in front of all others content.