[API] PluginMessageAPI+ - Object Orientated Plugin Message Wrapper

Discussion in 'WIP and Development Status' started by iKeirNez, Dec 31, 2013.

  1. Offline

    iKeirNez

    My BukkitDev Profile
    My Plugins (9)
    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    So I was working on a private project which required a lot of communication between our Proxy, Lobby and Slave servers. The lobby and slaves ran on Bukkit whilst the Proxy ran on BungeeCord. We had choice of either using sockets or the plugin message api. I opted for the plugin message api.

    After using it for awhile it became easy to see that it was easy to make mistakes and the code was very long to do this. So instead I created my own wrapper for the plugin message api. It works very similarly to the way vanilla Minecraft handles packets, via objects. The api is also works across Bukkit and BungeeCord and supports BungeeCord's forward channel (forwards a packet/message to another server)

    I've been using it a lot in this project and I am almost ready to release it. The only issue is I have absolutely no idea what to name it. I would like it to be descriptive about what it does. If you guys have any suggestions then let me know. Someone suggest PluginMessageAPI+ which I really like so I'm going with that. I'll link to it here when I release it.

    I hope to in the future add support for client mods (via Forge etc)

    EDIT: Some example usage:

    Code:java
    1. packetManager.sendPacket(new PacketPlayer(player), new PacketUpdatePoints(50)); // this packet would be sent via the players connection to the BungeeCord server which would then read, process the packet and add 50 points onto the players balance


    To receive:

    Code:java
    1. @PacketHandler
    2. public void onPacketPoints(PacketUpdatePoints packet){
    3. someClass.updatePoints(packet.getSender().getBungeePlayer(), packet.points);
    4. }


    Keir

    EDIT: Repo is up, writing a proper post for this just now https://github.com/iKeirNez/PluginMessageAPI-Plus

    EDIT2: I've made a proper post here, please reply there instead http://forums.bukkit.org/threads/api-pluginmessageapi.213649/
     
  2. Offline

    RainoBoy97

    My BukkitDev Profile
    My Plugins (1)
    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Awesome!! This will come in handy for a project i'm working on, and I dont want to poll my database each second :p
     
  3. Offline

    iKeirNez

    My BukkitDev Profile
    My Plugins (9)
    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME

    Yep, we had it setup so only the lobby server has access to the database. The bad thing about this is servers can't communicate to each other unless there is a player connected to each server you need to communicate with.
     
  4. Offline

    iKeirNez

    My BukkitDev Profile
    My Plugins (9)
    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME

    Repo is up now btw, check the original post
     
  5. Offline

    RainoBoy97

    My BukkitDev Profile
    My Plugins (1)
    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Okay, cool! Thanks :D
     
  6. Offline

    iKeirNez

    My BukkitDev Profile
    My Plugins (9)
    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
  7. Offline

    Cirno

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    I hope this doesn't get locked for mentioning BungeeCord...
    Anyways, nice work :)
     
  8. Offline

    iKeirNez

    My BukkitDev Profile
    My Plugins (9)
    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Not so far anyway, hopefully the mods are understanding
     

Share This Page