A rudimentary event system needs to be included for server plugins.
events so far:
serverstart ()-> Just befpre port is opened and server starts
serverstop ()-> After main loop ends. No guarantee this will be reached on every run.
connectionnew ()-> New user connected, before authentication
connectionclose ()-> Connection to user has closed. Authenticated or not
userfailedauth ()-> new connection gave incorrect authentication information
userauth (name, uuid)-> User has successfully authenticated
userquit (name, uuid)-> User has disconnected.
userjoinroom (name, uuid, roomname, roomuuid)-> User has joined a voice & video room
userleaveroom (name, uuid, roomname, roomuuid)-> User has left a voice & video room
usercreate (name, uuid)-> User created on server
userdelete (name, uuid)-> User deleted from server
userchangename (oldname, newname, uuid)-> User name changed
usercontextmenucallback (name, uuid, callbackid)-> User has chosen a GUI context menu item.
messagesend (name, uuid, roomname, roomuuid, message)-> User sent a message
messagecreate (roomname, roomuuid, message)-> A new message has been made to a text room. Differs from above as plugins inserting non-user based messages will only trigger this not 'messagesend'.
messagechange (roomname, roomuuid, oldmessage, newmessage)-> Message contents changed. Note that message deletion is just a change.
pluginprep (pluginname, reference) -> called just before each plugin is start()ed
pluginstart (pluginname, reference) -> called just after each plugin is start()ed
Known events should be kept in a list on server, Plugins are allowed to register new events to use internally or in unison with other plugins and any attempt at listening for an event that doesn't exist MUST be dealt with explicitly or throw an error.
A rudimentary event system needs to be included for server plugins.
events so far:
serverstart ()
-> Just befpre port is opened and server startsserverstop ()
-> After main loop ends. No guarantee this will be reached on every run.connectionnew ()
-> New user connected, before authenticationconnectionclose ()
-> Connection to user has closed. Authenticated or notuserfailedauth ()
-> new connection gave incorrect authentication informationuserauth (name, uuid)
-> User has successfully authenticateduserquit (name, uuid)
-> User has disconnected.userjoinroom (name, uuid, roomname, roomuuid)
-> User has joined a voice & video roomuserleaveroom (name, uuid, roomname, roomuuid)
-> User has left a voice & video roomusercreate (name, uuid)
-> User created on serveruserdelete (name, uuid)
-> User deleted from serveruserchangename (oldname, newname, uuid)
-> User name changedusercontextmenucallback (name, uuid, callbackid)
-> User has chosen a GUI context menu item.messagesend (name, uuid, roomname, roomuuid, message)
-> User sent a messagemessagecreate (roomname, roomuuid, message)
-> A new message has been made to a text room. Differs from above as plugins inserting non-user based messages will only trigger this not 'messagesend'.messagechange (roomname, roomuuid, oldmessage, newmessage)
-> Message contents changed. Note that message deletion is just a change.pluginprep (pluginname, reference)
-> called just before each plugin isstart()
edpluginstart (pluginname, reference)
-> called just after each plugin isstart()
edKnown events should be kept in a list on server, Plugins are allowed to register new events to use internally or in unison with other plugins and any attempt at listening for an event that doesn't exist MUST be dealt with explicitly or throw an error.
Feel free to suggest other events!