Hello. I am creating a plugin that allows me to execute commands on all servers under my bungeecord proxy from my bungeecord console(for donation/voting rewards). I have everything setup and the commands gets sent to my sponge server and everything is working but when my sponge server receives the message it throws an error. The BungeeCord code is working because my spigot version successfully gets the command and executes it.
Sponge code:
public void handlePayload(ChannelBuf data, RemoteConnection connection, Platform.Type side) {
String command = data.readString();
System.out.println("Received Command " + command + " from Bungeecord! Executing");
Sponge.getCommandManager().process(Sponge.getServer().getConsole(), command);
}
Bungeecord Code:
private void sendToBukkit(String channel, String message, ServerInfo server) {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
DataOutputStream out = new DataOutputStream(stream);
try {
out.writeUTF(channel);
out.writeUTF(message);
} catch (IOException e) {
e.printStackTrace();
}
server.sendData("Return", stream.toByteArray());
Error:
Any help is appreciated!