Development
Events in UASECO
What are events?
UASECO signals with an event various signals that UASECO receive from
e.g. the dedicated server when a Player joins (onPlayerConnect
(main event) or onPlayerConnectPostfix
)
or from other Plugins to signal something to react on.
With these events you are able to interact in your Plugin, e.g. when a Player cross the finish line
(onPlayerFinishLine
), 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 UASECO or better the dedicated Server.
Register a event
$this->registerEvent( 'onSync', // Event 'onSync' // Callback function );
See also my Example Plugin start-up Plugin.
Development
All available events in UASECO
Ordered by logical meaning (click on the head to sort alphabetically).
Event | Parameter | Released from |
---|---|---|
onStartup |
$aseco |
uaseco.php |
onSync |
$aseco |
uaseco.php |
onMainLoop |
$aseco |
uaseco.php |
onEverySecond |
$aseco |
uaseco.php |
onEveryTenSeconds |
$aseco |
uaseco.php |
onEveryFifteenSeconds |
$aseco |
uaseco.php |
onEveryMinute |
$aseco |
uaseco.php |
onShutdown |
$aseco |
chat.admin.php, helper.class.php |
onPlayerConnect |
$aseco, $player |
uaseco.php |
onPlayerConnectPostfix |
$aseco, $player |
uaseco.php |
onPlayerDisconnectPrepare |
$aseco, $player |
uaseco.php |
onPlayerDisconnect |
$aseco, $player |
uaseco.php |
onPlayerChat |
$aseco, $chat |
uaseco.php |
onPlayerManialinkPageAnswer |
$aseco, $login, $params |
uaseco.php |
onPlayerStartLine |
$aseco, $login |
plugin.modescript_handler.php |
onPlayerCheckpoint |
$aseco, $params |
plugin.modescript_handler.php |
onPlayerRespawn |
$aseco, $login |
plugin.modescript_handler.php |
onPlayerGiveUp |
$aseco, $login |
plugin.modescript_handler.php |
onPlayerStunt |
$aseco, $params |
plugin.modescript_handler.php |
onPlayerFinishLine |
$aseco, $params |
plugin.modescript_handler.php |
onPlayerFinishLap |
$aseco, $params |
plugin.modescript_handler.php |
onPlayerFinishPrefix |
$aseco, $finish |
plugin.modescript_handler.php |
onPlayerFinish |
$aseco, $finish |
plugin.modescript_handler.php |
onPlayerFinishPostfix |
$aseco, $finish |
plugin.modescript_handler.php |
onPlayerRoundFinish |
$aseco, $params |
plugin.modescript_handler.php |
onPlayerWins |
$aseco, $player |
uaseco.php |
onPlayerInfoChanged |
$aseco, $changes |
uaseco.php |
onPlayerAlliesChanged |
$aseco, $login |
uaseco.php |
onPlayerIncoherence |
$aseco, $state |
uaseco.php |
onPlayerRankingUpdated |
$aseco |
rankinglist.class.php, plugin.modescript_handler.php |
onLoadingMap |
$aseco, $map |
uaseco.php |
onUnloadingMap |
$aseco, $uid |
plugin.modescript_handler.php |
onWarmUpStatusChanged |
$aseco, $params |
plugin.modescript_handler.php |
onWarmUpRoundChanged |
$aseco, $params |
plugin.modescript_handler.php |
onBeginTurn |
$aseco, $count |
plugin.modescript_handler.php |
onEndTurn |
$aseco, $count |
plugin.modescript_handler.php |
onBeginMatch |
$aseco, $count |
plugin.modescript_handler.php |
onEndMatch |
$aseco, $count |
plugin.modescript_handler.php |
onBeginMap |
$aseco, $uid |
plugin.modescript_handler.php |
onRestartMap |
$aseco, $map |
uaseco.php |
onEndMapRanking |
$aseco, $map |
uaseco.php |
onEndMapPrefix |
$aseco, $map |
uaseco.php |
onEndMap |
$aseco, $map |
uaseco.php |
onBeginRound |
$aseco, $count |
plugin.modescript_handler.php |
onEndRound |
$aseco, $count |
plugin.modescript_handler.php |
onBeginPlaying |
$aseco, $count |
plugin.modescript_handler.php |
onEndPlaying |
$aseco, $count |
plugin.modescript_handler.php |
onBeginPodium |
$aseco |
plugin.modescript_handler.php |
onEndPodium |
$aseco |
plugin.modescript_handler.php |
onServerChat |
$aseco, $chat |
uaseco.php |
onBillUpdated |
$aseco, $bill |
uaseco.php |
onEcho |
$aseco, $echo |
uaseco.php |
onTunnelDataReceived |
$aseco, $data |
uaseco.php |
onVoteUpdated |
$aseco, $vote |
uaseco.php |
onModeScriptCommand |
$aseco, $params |
plugin.modescript_handler.php |
onMapListModified |
$aseco, $data |
uaseco.php |
onModeScriptCallbackArray |
$aseco, $data |
uaseco.php |
onLocalRecordsLoaded |
$aseco, $records |
plugin.local_records.php |
onLocalRecordBestLoaded |
$aseco, $time |
plugin.local_records.php |
onLocalRecord |
$aseco, $record |
plugin.local_records.php |
onDedimaniaRecordsLoaded |
$aseco, $records |
plugin.dedimania.php |
onDedimaniaRecord |
$aseco, $record |
plugin.dedimania.php |
onManiaExchangeBestLoaded |
$aseco, $time |
uaseco.php |
onDonation |
$aseco, $donation |
plugin.donate.php |
onPointsRepartitionLoaded |
$aseco, $round_points |
plugin.modescript_handler.php, plugin.round_points.php |
onUiProperties |
$aseco, $params |
plugin.modescript_handler.php |
onModeUseTeams |
$aseco, $params |
plugin.modescript_handler.php |
onPauseStatus |
$aseco, $params |
plugin.modescript_handler.php |
onKarmaChange |
$aseco, $karma |
plugin.rasp_karma.php |
onJukeboxChanged |
$aseco, $command |
chat.admin.php, plugin.rasp_jukebox.php |
onMapListChanged |
$aseco, $command |
chat.admin.php, plugin.rasp_jukebox.php |
onMusicboxReloaded |
$aseco |
plugin.music_server.php |
onSendWindowMessage |
$aseco, $data |
plugin.autotime.php, plugin.dedimania.php, plugin.jfreu_lite.php, plugin.jfreu_max.php, plugin.local_records.php, plugin.mania_exchange_info.php, plugin.map.php, plugin.rasp_jukebox.php, plugin.rasp_votes.php, plugin.rounds.php |
Available events in third-party Plugins I have found over the years or have build by myself in some of my Plugins.
Event | Parameter | Released from |
---|---|---|
onPlayerWinPlanets | $eventdata | plugin.records_eyepiece.php |
onKarmaChange | $karma | plugin.mania_karma.php |
onVotingRestartMap | null | plugin.vote_manager.php |
onJukeboxChanged | $aseco, $command | plugin.pay2play.php |
Development
Description of each event in UASECO
onStartup ($aseco)
Event triggered after loading plugins.
At this point UASECO does not have syncronized the status with server and does not have the server name or the player count or players loaded yet.
onSync ($aseco)
Event triggered after server status has been syncronized.
At this event
$aseco->server->players->player_list
is still empty!
onMainLoop ($aseco)
Event triggered every loop after all callbacks and method calls 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 UASECO or a Plugin is busy!
onEveryTenSeconds ($aseco)
Event triggered every 10 seconds.
The time between one triggering to the next can be longer then exact 10 seconds, this is when UASECO or a Plugin is busy!
onEveryFifteenSeconds ($aseco)
Event triggered every 15 seconds.
The time between one triggering to the next can be longer then exact 15 seconds, this is when UASECO or a Plugin is busy!
onEveryMinute ($aseco)
Event triggered every minute.
The time between one triggering to the next can be longer then exact one minute, this is when UASECO or a Plugin is busy!
onShutdown ($aseco)
Event triggered when UASECO is shutting down, ie. with /admin shutdown
.
onPlayerConnect ($aseco, $player)
Main event, triggered when a Player connects to the server.
onPlayerConnectPostfix ($aseco, $player)
Postfix event, triggered when a Player connects to the server. This event is meant for access control.
onPlayerDisconnectPrepare ($aseco, $player)
Prefix event, triggered when a Player disconnects from the server.
This event is mainly used for cleanup the player data before they get stored into the database at the event onPlayerDisconnect
.
onPlayerDisconnect ($aseco, $player)
Event triggered when a Player leaves the Server.
onPlayerChat ($aseco, $chat)
Event triggered when a Player wrote something into the chat.
onServerChat ($aseco, $chat)
Event triggered when a message from a Plugin is sent into the chat.
onPlayerManialinkPageAnswer ($aseco, $login, $params)
Event triggered when a Player clicks a server-side manialink that has the action
attribute, returns the Player login and the Key=Value pairs.
onPlayerStartLine ($aseco, $login)
Event triggered when a Player starts a race.
onPlayerStartCountdown ($aseco, $login)
Callback sent when a player see the 3,2,1,Go! countdown.
onPlayerCheckpoint ($aseco, $params)
Event triggered when a Player crosses a checkpoint.
onPlayerRespawn ($aseco, $login)
Event triggered when a Player respawns at a waypoint (checkpoint, multilap, ...).
onPlayerGiveUp ($aseco, $login)
Event triggered sent when a player restarts.
onPlayerStunt ($aseco, $params)
Event triggered when a Player made a stunt figure.
onPlayerFinishLine ($aseco, $params)
Event triggered when a Player crosses a finish line.
onPlayerFinishLap ($aseco, $params)
Event triggered when a Player finished a lap on a multilap Map.
onPlayerFinishPrefix ($aseco, $finish)
Event triggered when a Player finished the map, triggered before onPlayerFinish
.
onPlayerFinish ($aseco, $finish)
Event triggered when a Player finished the map.
onPlayerFinishPostfix ($aseco, $finish)
Event triggered when a Player finished the map, triggered after onPlayerFinish
.
onPlayerRoundFinish ($aseco, $params)
Event triggered when a Player finished the round, mostly used in rounds based Modescripts.
$params
contains the same array structure as the event onPlayerRankingUpdated
.
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.
onPlayerAlliesChanged ($aseco, $login)
TODO.
onPlayerIncoherence ($aseco, $state)
Event triggered when the red text that says that the Player time is invalid.
onPlayerRankingUpdated ($aseco)
Event triggered when the Player Rankings has been changed/reseted.
onLoadingMap ($aseco, $map)
Event riggered when the map is loaded (without loaded records).
onUnloadingMap ($aseco, $uid)
Event triggered when the script start to unload a map.
onWarmUpStatusChanged ($aseco, $params)
Event triggered when the status of the warm up has been changed.
onWarmUpRoundChanged ($aseco, $params)
Event triggered when the status of the warm up while a round has been changed.
onBeginTurn ($aseco, $count)
Event triggered at the beginning of each turn, if the mode uses turns.
onEndTurn ($aseco, $count)
Event triggered at the end of each turn, if the mode uses turns.
onBeginMatch ($aseco, $count)
Event triggered at the beginning of each match, if the mode uses matches.
onEndMatch ($aseco, $count)
Event triggered at the end of each match, if the mode uses matches.
onBeginMap ($aseco, $uid)
Event triggered after onLoadingMap
, when the script has started the map.
onRestartMap ($aseco, $map)
Event triggered when the map was restarted.
onEndMapRanking ($aseco, $map)
Event triggered at the end of map and before the ranking is finished.
onEndMapPrefix ($aseco, $map)
Event triggered at the end of map (prefix event for chat-based votes) and is send before the event onEndMap
.
onEndMap ($aseco, $map)
Event triggered at the end of map (Main event)
onBeginRound ($aseco, $count)
Event triggered at the beginning of each round, if the mode uses rounds.
onEndRound ($aseco, $count)
Event triggered at the end of each round, if the mode uses rounds.
onBeginPlaying ($aseco, $count)
Event triggered at the beginning of the play loop.
onEndPlaying ($aseco, $count)
Event triggered at the end of the play loop.
onBeginPodium ($aseco)
Event triggered at the beginning of podium sequence.
onEndPodium ($aseco)
Event triggered at the end of podium sequence.
onBeginChannelProgression ($aseco, $time)
Event triggered when the channel progression sequence starts.
onEndChannelProgression ($aseco, $time)
Event triggered when the channel progression sequence ends.
onModeScriptChanged ($aseco, $mode)
Event triggered at the very beginning of the script.
Different events can cause the script to start/restart:
- Launch of the server: Most of the time a XML-RPC client won't receive them because it is not yet connected to the server when the script start.
- Restart map: This cause the script to restart, so the callbacks will be sent again.
- Change mode: After the next map the new script replaces the old one and start from the beginning.
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, $command, $params)
Event triggered when the server received a call from the Echo
method,
e.g. from an external tool like AdminServ which send AdminServ.Map.Added
when a map has been added.
onTunnelDataReceived ($aseco, $data)
Can be use with the Method TunnelSendDataToLogin()
to communicate with the game server from the relay or the other way around.
onVoteUpdated ($aseco, $vote)
TODO
onModeScriptCommand ($aseco, $params)
TODO
onMapListModified ($aseco, $data)
TODO
onModeScriptCallbackArray ($aseco, $data)
TODO
onLocalRecordsLoaded ($aseco, $records)
Event triggered when the plugin.local_records.php
has loaded the local records.
onLocalRecordBestLoaded ($aseco, $time)
Event triggered when the plugin.local_records.php
has loaded the first record.
onLocalRecord ($aseco, $record)
Event triggered when a Player received or driven a better time or score for his/her current local record.
onDedimaniaRecordsLoaded ($aseco, $records)
Event triggered when the plugin.dedimania.php
has loaded the dedimania records.
onDedimaniaRecord ($aseco, $record)
Event triggered when a Player received or driven a better time for his/her current Dedimania record.
onManiaExchangeBestLoaded ($aseco, $time)
Event triggered when the uaseco.php
has loaded the Mania-Exchange first record.
onDonation ($aseco, $donation)
Event triggered when a Player donate some Planets with /donate [N]
.
onPointsRepartitionLoaded ($aseco, $round_points)
Event triggered when the point setup has been changed.
onUiProperties ($aseco, $params)
TODO
onModeUseTeams ($aseco, $params)
TODO
onPauseStatus ($aseco, $params)
TODO
onKarmaChange ($aseco, $karma)
Event triggered when a Player vote a Track.
onJukeboxChanged ($aseco, $command)
Event triggered when the Jukebox has been changed.
$command[0] =
add
,clear
,drop
,play
,replay
,restart
, vskipv, vprevious,
nextenvv $command[1] = track data (ornull
for theclear
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 (ornull
for thewrite
orread
action)
onMusicboxReloaded ($aseco)
Event triggered to alert that the music server config file (config/music_server.xml) was reloaded via /music reload
.
onSendWindowMessage ($aseco, $data)
TODO
This is a private enthusiast Website. Maniaplanet, Trackmania, Shootmania, Nadeo are trademarks of Ubisoft Entertainment.
Windows is a registered trademark of Microsoft Corporation.