Problems with Bungee messaging channel

Discussion in 'Spigot Plugin Development' started by XelfeGamer, May 23, 2015.

  1. What's wrong with my code:

    Code (Text):
        public boolean getStatusPlayer(String amigo) {
            ByteArrayDataOutput out = ByteStreams.newDataOutput();
            ByteArrayDataInput in = ByteStreams.newDataInput(out.toByteArray());
            boolean status = false;
            out.writeUTF("PlayerList");
            out.writeUTF("ALL");
            String[] playerList = in.readUTF().split(", ");
            for(String s : playerList) {
                if(status) {
                    break;
                }
                if(s.equalsIgnoreCase(amigo)) {
                    status = true;
                }
            }
            return status;
        }
    i got an error on the line "String[] playerList = in.readUTF().split(", ");"

    Thanks in advance.
     
  2. Wrong section... Post it here!
     
  3. This is a Bukkit plugin
     
  4. And what error is that could we ask
     
  5. I don't think you quite grasped the idea of how plugin messages work. First you send a plugin message, and wait for a response by using a PluginMessageListener.
     
  6. Can you me how it should be? Please, I have tried many things and still i can not get it.
     
  7. Have a look on this!

    ... Or you try my API BungeeBridge, which allows you to interact with Bungeecord without PMCs..