-
Notifications
You must be signed in to change notification settings - Fork 1
Events
Tutorial Events provide an API for accessing features of the Tutorials plugin from other plugins.
The Tutorials database has an Events table which is read on a recurring basis. Externals plugins can insert events such as 'Start Next Tutorial', 'Redo Compulsory Tutorial' and 'Open Admin Menu' and the tutorials plugin will pick these up and perform the actions as if they were done from the Tutorial's own GUI.
This allows you to integrate Tutorials into your own GUIs and server systems.
Adding an event simply involves adding an entry to the Events table of your database. The structure of this entry is indicated below.
All that is required is the UUID of the player for which the event is to be performed and then the event that it to be performed. The timestamp is inserted automatically by the DB when the UUID and EventName are inserted as a row.
The Tutorials plugin will delete the event from the table once it has been registered.
If you have the Tutorials plugin on a different server then you will have to transfer the player to the tutorials server from your own plugin. The events system will then pick it up as normal.
If multiple events were added before a player was transferred or if multiple events are added between event checking cycles then it will take the most recent one and discard the other. Hence the timestamp feature.