Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Plugin Communication Library

Comments in 'Plugin Development' started by jython234, May 17, 2015.

?

Would you like an easy way to communicate between server plugins?

  1. Yes, I would really need it!

    46.2%
  2. It sounds cool, I may use it.

    53.8%
  3. No, this is stupid, why would I use this.

    0 vote(s)
    0.0%
  1. jython234
    Offline

    jython234 Notable Member Plugin Developer

    Joined:
    Nov 4, 2013
    Posts:
    324
    Plugins:
    1
    Minecraft User:
    jython234
    EDIT: The poll question above should be to communicate between different servers, not just one server.

    Hey guys,

    Now that we are starting to see server hubs (multiple servers linked by FastTransfer, or BouncyBall etc.), there is a problem of syncing plugin data. For example, let's say your plugin would like to see what players there are on the hub server (but it's running on the mini-games server). There isn't an easy way to do this, other than pinging the server using query and going into a hassle for that. So, I decided that some developers may want a communication library to easily send data between servers. This would be similar to ProtocolLib, a plugin loaded by PocketMine used by other plugins.

    Please comment below on your ideas.
  2. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,710
    Plugins:
    22
    Minecraft User:
    Falkirknh
    I started writing a plugin called SlowTransfer which would allow for a handshake to occur between the two servers before the client was transferred. This would allow for player related data to move from server to server. I kind of abandoned the project (at least for now) because I can't test it yet.
    Last edited: May 17, 2015
    TigerHix and DunxandMinecraft like this.
  3. DunxandMinecraft
    Offline

    DunxandMinecraft Active Member

    Joined:
    Oct 26, 2014
    Posts:
    158
    @Falk Could I help test this if you want?
  4. jython234
    Offline

    jython234 Notable Member Plugin Developer

    Joined:
    Nov 4, 2013
    Posts:
    324
    Plugins:
    1
    Minecraft User:
    jython234
    Lol SlowTransfer.
  5. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,710
    Plugins:
    22
    Minecraft User:
    Falkirknh
    I like testing my own stuff because I can debug things easier and control the environment. Thanks, though.
    TigerHix and LDX like this.
  6. DunxandMinecraft
    Offline

    DunxandMinecraft Active Member

    Joined:
    Oct 26, 2014
    Posts:
    158
    That's OK.
  7. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    My RemoteChat plugin, if ever completed, coould help.
    https://github.com/PEMapModder/Small-ZC-Plugins/tree/master/RemoteChat

    It is in an email-like structure.
    Let's say the first server (called Alice) wants to send a message to the second server (called Bob).
    First, Bob includes an extra field in the server query (the long one). It contains the port where the RemoteChat recipient server (Peggy) is held.
    Second, Alice queries Bob to get the port of Peggy, and send a request to Peggy that contains the following data:
    • Protocol version Alice is using
    • The action Alice wants to do (e.g. PRIVMSG for sending a chat message, ACK to confirm a message being sent) (ACK isn't implemented yet on the master branch and [email protected] is used instead currently)
    • Human-readable hostname of Alice. Peggy will make sure the hostname provided is resolved (by gethostbyname()) into the number IP of Alice (returned by the socket from socket_getpeername()).
    • Sender of the message (if applicable to the action). This is like the username in emails.
    • Other parameters specific to the action.
    Third, Through some threading and synchronization, Peggy sends a signal to Bob to carry out the action.
    Alice also has a recipient server called Victor, and Alice has Victor's port in its query.
    So fourth, after Bob has finished processing the data required by Alice, it will send a request back to Alice through Victor in the same way.
    TigerHix and jython234 like this.
  8. aliuly
    Offline

    aliuly Notable Member Plugin Developer

    Joined:
    Feb 8, 2014
    Posts:
    1,086
    Plugins:
    17
    In addition to a communication library probably would be good to have a standard storage standard for all plugins. That way plugin data could be moved from server to server. As it is, plugin data is spread through different folders (without clear separation between configuration, player data, other data).
  9. jython234
    Offline

    jython234 Notable Member Plugin Developer

    Joined:
    Nov 4, 2013
    Posts:
    324
    Plugins:
    1
    Minecraft User:
    jython234
    It sounds good. I was going to base the protocol off of MCPE, but with some nice tweaks to make it easier to use.
  10. jython234
    Offline

    jython234 Notable Member Plugin Developer

    Joined:
    Nov 4, 2013
    Posts:
    324
    Plugins:
    1
    Minecraft User:
    jython234
    It seems like a P2P protocol implementation. Which is nice, I like P2P.
  11. jython234
    Offline

    jython234 Notable Member Plugin Developer

    Joined:
    Nov 4, 2013
    Posts:
    324
    Plugins:
    1
    Minecraft User:
    jython234
    According to the poll, all of the results are positive, which means that people think this is a great idea.
    I have created a repository on GitHub where I will upload the plugin source, and work on it. Feel free to contribute!

    The name is AdventureIO (Adventure part from https://github.com/new :) ) , and it is licensed under the GPL v2.

    Link is here.
    PEMapModder and TigerHix like this.
  12. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Actually, for the poll I voted "may" because practical uses may find a MySQL database more effective at connecting more than two servers ;)
  13. jython234
    Offline

    jython234 Notable Member Plugin Developer

    Joined:
    Nov 4, 2013
    Posts:
    324
    Plugins:
    1
    Minecraft User:
    jython234
    It depends on what your plugin is, and what data it transfers.

Share This Page

Advertisement