1.13 and viaversion on 1.12.2
Leymooo opened this issue ยท 10 comments
What behaviour is observed:
Player was kicked.
What behaviour is expected:
Steps/models to reproduce:
Install viaversion to 1.12.2 spigot, drop ChangeSkin to bungeecord plugins. join from MC 1.13
Plugin list:
Environment description
BungeeCord, SQLite
Plugin version or build number:
Build number 133 for bungeecord
Error Log:
[19:19:37 INFO]: [ViaVersion] Leymooo INCOMING: PLAY 10 -> 9 [UNKNOWN[393]] Value: PacketWrapper{packetValues=[], readableObjects=[Pair{Type|String, bungeecord:legacy/changeskin}], id=9}
[19:19:37 INFO]: Leymooo lost connection: Internal Exception: io.netty.handler.codec.DecoderException: The received string length is longer than maximum allowed (28 > 20)
Configuration:
With spigot 1.13 i dont have this problem.
But spigot 1.13 is not stable now, and 1.12.2 + viaversion is more stable, but it disconnect me when i join from 1.13.
I think that this commit fixed this bug, SpigotMC/BungeeCord@6fadb42
But need testing, does plugin will handle this tag on spigot < 1.13 with viaversion when join from 1.13.
In the newest commit ChangeSkin migrated to the new plugin message syntax using ChangeSkin:SubChannel.
12:41:55 [INFO] [Leymooo] <-> InitialHandler has connected
12:41:55 [INFO] [Leymooo] <-> ServerConnector [Auth] has connected
12:41:56 [WARNING] Error dispatching event PluginMessageEvent(super=TargetedEvent(sender=Leymooo, receiver=net.md_5.bungee.ServerConnection@2ad66a41), cancelled=false, tag=minecraft:brand) to listener com.github.games647.changeskin.bungee.listener.PluginMessageListener@5b43fbf6
java.lang.ClassCastException: net.md_5.bungee.ServerConnection cannot be cast to net.md_5.bungee.api.connection.ProxiedPlayer
at com.github.games647.changeskin.bungee.listener.PluginMessageListener.onPluginMessage(PluginMessageListener.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.md_5.bungee.event.EventHandlerMethod.invoke(EventHandlerMethod.java:29)
at net.md_5.bungee.event.EventBus.post(EventBus.java:46)
at net.md_5.bungee.api.plugin.PluginManager.callEvent(PluginManager.java:377)
at net.md_5.bungee.connection.UpstreamBridge.handle(UpstreamBridge.java:254)
at net.md_5.bungee.protocol.packet.PluginMessage.handle(PluginMessage.java:89)
at net.md_5.bungee.netty.HandlerBoss.channelRead(HandlerBoss.java:107)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:647)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:582)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:499)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:461)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884)
at java.lang.Thread.run(Unknown Source)
>
[12:44:05 INFO]: [ViaVersion] Leymooo INCOMING: PLAY 10 -> 9 [UNKNOWN[393]] Value: PacketWrapper{packetValues=[], readableObjects=[Pair{Type|String, ChangeSkin:UpdateSkin}], id=9}
[12:44:05 INFO]: Leymooo lost connection: Internal Exception: io.netty.handler.codec.DecoderException: The received string length is longer than maximum allowed (21 > 20)
maybe use something like this?
if (!channel.equals("ChangeSkin")) {
return;
}
ByteArrayDataInput in = ByteStreams.newDataInput(message);
String action = in.readUTF(); //UpdateSkin
if (!channel.equals("ChangeSkin")) {
return;
}
Such things are no longer alllowed. Channels have to in the format of KEY:SUB
Now the plugin channels should be smaller that it should work with older Minecraft versions.