retrooper / packetevents

PacketEvents is emerging as a strong contender in the realm of Minecraft packet processing libraries. Designed to simplify packet manipulation while delivering high performance, this powerful tool aims to demystify the complexities of projects utilizing packets.
GNU General Public License v3.0
508 stars 145 forks source link

Teams suffix/prefix limits is based on server version #960

Open f4n74z14 opened 3 weeks ago

f4n74z14 commented 3 weeks ago

Describe the bug If you have packet-based plugins for teams, PacketEvents do not support them (extended limits and etc.) because determines version from the server rather than the client.

Software brand PaperSpigot 1.8.8

Plugins ViaVersion, GrimAC (2.3.67), TAB

How To Reproduce Steps to reproduce the behavior:

  1. Set prefix more than 16 chars in TAB on 1.8.8 server
  2. Try decode PlayServerTeam
  3. The error will appear

Expected behavior PacketEvents determines version from the client rather than the server.

AoElite commented 3 weeks ago

@f4n74z14 You need to send the error

f4n74z14 commented 3 weeks ago

@f4n74z14 You need to send the error

https://pastebin.com/ZZVpkiKn

SamB440 commented 2 weeks ago

How does via handle this?

f4n74z14 commented 2 weeks ago

I haven't looked into Via's code, but logically I don't see why the server version is used when writing/reading a client-only packet.

SamB440 commented 2 weeks ago

Server version is used in all packets because via expects packets sent from the server to be of that version, likewise packetevents does, otherwise you get errors due to differing client and server versions.

f4n74z14 commented 2 weeks ago

You are right! Perhaps this could be done by combining the client and server versions, for example: the packet structure would be server based and the limits would be client based. (I looked how it is done in BungeeCord, there the limits are the same for all - Short.MAX_VALUE).