Weird bug - Bungeecord API

Discussion in 'BungeeCord Discussion' started by bob7l, Aug 12, 2013.

  1. I tried to create a very simple portal plugin for cross servers without luck.

    https://github.com/bob7l/IPortal/bl...builders/portal/portals/BungeePortal.java#L19

    As you can see, i did "sendPluginMessage" and the server name is NOT null, I've already tested that. If the plugin instance was null, it would print some sort of exception.


    I also registered the channel on enable, that should work.. Right?
    https://github.com/bob7l/IPortal/blob/master/src/me/minebuilders/portal/IP.java#L25

    Now here's the error, note how it says "null". Maybe it's my spigot version? (I use netty). The server IS enabled, and /server DOES work. I also nullchecked EVERYTHING and it all came out clean :3
    [​IMG]

    Btw, the code is very messy atm so don't be mean :)
     
  2. md_5

    Administrator Developer

    The issue here is that you are not encoding the message in a format BungeeCord understands:
    p.sendPluginMessage(IP.instance, "BungeeCord", (server).getBytes());

    Is nothing that BungeeCord can understand, it can only read UTF-8 messages. I suggest you read the wiki article on plugin messaging, and perhaps use a custom plugin channel.
    On that note, the API should be cleaned up to print a warning instead of kick the player on invalid data.
     
  3. Ohh i see, thanks!