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).

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.

Donate Planets

Donate Coppers

Donate via PayPal

ATOM release feeds

RSS release feeds