Sponge:
sendToAll {
channelBuf.writeUTF(channel)
channelBuf.writeUTF(command)
channelBuf.writeUTF(arguments)
}
https://github.com/SettingDust/nucleus-sync/blob/master/nucleus-sync-sponge/src/main/kotlin/me/settingdust/nucleussync/module/CommandSync.kt#L116
https://github.com/SettingDust/laven-sponge/blob/master/src/main/kotlin/me/settingdust/laven/sponge/SpongeChannelWrapper.kt#L9
https://github.com/SettingDust/nucleus-sync/blob/master/nucleus-sync-sponge/src/main/kotlin/me/settingdust/nucleussync/core/BungeeChannelWrapper.kt#L14
BungeeCord:
@EventHandler
fun onReceiveMessage(event: PluginMessageEvent) {
event.apply {
if (tag == bungeeChannel) {
val input = ByteStreams.newDataInput(data)
val subchannel = input.readUTF()
}
}
}
https://github.com/SettingDust/nucleus-sync/blob/master/nucleus-sync-bungee/src/main/kotlin/me/settingdust/nucleussync/bungee/NucleusSync.kt#L103
The first readUTF
in BC side will throw a exception
The line 103 is 