1. Welcome to LilyPad. Download the project, explore the forums, and create your own LilyPad network.


    If you use the software and enjoy it or have a question, or would like to contribute to the future of the software directly or through resources, please sign up and join our little community.

Planned Event API

Discussion in 'Feature Requests' started by boboman13, Jun 29, 2013.

?

Opinions?

  1. It would be useful

    10 vote(s)
    100.0%
  2. Wouldn't be useful

    0 vote(s)
    0.0%
  1. boboman13

    boboman13 Member Contributor

    I think it would be great if LilyPad supported some sort of an Event API, almost like the Bukkit Event API. Here are a few example events it could have...

    • LPPlayerJoinEvent(Player player) - called when a player joins through the proxy. This event is not recalled everytime someone moves servers.
    • LPPlayerLeaveEvent(Player player) - called when a player quits from the proxy. This event is not, again, recalled.
    • LPPlayerSwitchEvent(Player player, LPServer from, LPServer to) - called when a player switches servers. This is not only called by the /server <server> command but also when another plugin calls a player move.
    The LPServer type part might already be added, I haven't dwelved that far into the API (or it might have a different way of handling servers), I just used that as an example.
    Now, why would anyone want to use this? Here is an example.
    A server owner wants to run separate servers - lets say 3 servers - for all his gamemodes. However, since he wants his servers to be unified, he asks a nice developer to create a plugin for him to 'unify' his servers. He gets a chat plugin that syncs all chat across servers. However, he wants his join/leave messages to be synced, too. So the developer listens for these events and broadcasts the messages '<player> has joined the <server> server!' and the same for leaving servers. If a player switches servers, '<player> has switched to the <server> server!', so that everyone knows the players and nobody is left out, fully fulfilling this server owner's needs.
    That example was just thrown together but it shows just how this event system can be utilized by developers.
    Thanks for listening, and don't forget to vote!
  2. boboman13

    boboman13 Member Contributor

    Anymore votes? I've gotten one and it has 15 views :p
  3. Coelho

    Coelho Software Engineer Staff Member Administrator Maintainer

    I actually want to add this, but at the moment it's not really possible due to the fact that the event API is not extensible. Once I do make it extensible however this is definitely possible.
  4. Coelho

    Coelho Software Engineer Staff Member Administrator Maintainer

  5. boboman13

    boboman13 Member Contributor

  6. bobacadodl

    bobacadodl Member

  7. Coelho

    Coelho Software Engineer Staff Member Administrator Maintainer

  8. Shawshark

    Shawshark Active Member Resource Contributor

Share This Page