HexagonMC / BungeeCord

BungeeCord for Minecraft 1.7.10/1.8/1.9/1.10/1.11/1.12/1.13/1.14/1.15/1.16/1.17/1.18/1.19
Other
157 stars 66 forks source link

Data cap causes decoder exception and kicks player from servers. #284

Open Zilacon opened 3 years ago

Zilacon commented 3 years ago

What Hexacord version are you using? Post the output of /bungee

Latest

Are you using Bungee plugins? If yes, please list all of them + versionnumber

Reproduced with no plugins.

How can we reproduce the error/bug?

Add a large modpack like MC:Eternal to the bungeecord, start exploring around in chunks with many modded blocks and entities. Get the error.

Is an error message (bungee/spigot/client)? If yes, use pastebin.com and share the link.

The error shows on client and server, but not on bungeecord.

In addidtion to that, please explain your issue as detailed as possible.

Modded servers in newer versions of minecraft are sending too much data to the bungee/client and vice versa which causes a decoder exception. These exceptions are coming from the entity maps for bungeecord as specific length and limits are specified for each version in the entity maps. Once this limit is exceeded, you get a decoder exception.

This issue is more rare on 1.7.10 then it is on 1.12.2 or above. As 1.7.10 doesnt allow NBT data for blocks or entities, only UUID's. So the amount of data has increased but not by much compared to newer versions.

This error can be reproduced infinitely once its been triggered once. As long as you are in the same chunk as when the error originated you will continue to get the error and get kicked. If you get moved, to lets say, spawn. But you go back to where you errored, you repeat the process all over again.

Here is an example of the error: [15:49:44] [Server thread/INFO]: LuckIThonkNut lost connection: Internal Exception: io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException: readerIndex(4) + length(1) exceeds writerIndex(4): PooledUnsafeDirectByteBuf(ridx: 4, widx: 4, cap: 4)

You can find this here: https://github.com/HexagonMC/BungeeCord/blob/master/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java#L85-L93 https://github.com/HexagonMC/BungeeCord/blob/master/proxy/src/main/java/net/md_5/bungee/entitymap/EntityMap_1_7_2.java#L53-L61

And im sure you can find the same thing on many other entity map files. How can this be fixed?

Server softwares issue reproduced on: Thermos Crucible Magma Catserver Mohist Forge+Sponge