PaperMC/Spigot-Server-Patches/0176-Raise-string-limit-for-packet-serialization.patch
Zach Brown 10469dfd46
Remove TE Fixer changes
Ultimately they should be unnecessary now that upstream's fix has been
in place for a while. Removing this reduces our own footprint, and gets
rid of any possible unintended behavior.
2016-10-05 15:46:44 -05:00

27 lines
1.3 KiB
Diff

From 37b1119fcaf9a311e2cd20262498d11e598466f6 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 21 Sep 2016 23:54:20 -0400
Subject: [PATCH] Raise string limit for packet serialization
The default limit is possible to hit with 50 page books with color codes, causing clients to disconnect.
Bump the limit up a hair to above currently seen sizes.
diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java
index b056457..662bd1e 100644
--- a/src/main/java/net/minecraft/server/PacketDataSerializer.java
+++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java
@@ -298,8 +298,8 @@ public class PacketDataSerializer extends ByteBuf {
public PacketDataSerializer a(String s) {
byte[] abyte = s.getBytes(Charsets.UTF_8);
- if (abyte.length > 32767) {
- throw new EncoderException("String too big (was " + s.length() + " bytes encoded, max " + 32767 + ")");
+ if (abyte.length > 44767) { // Paper - raise limit a bit more as normal means can trigger this
+ throw new EncoderException("String too big (was " + s.length() + " bytes encoded, max " + 44767 + ")"); // Paper
} else {
this.d(abyte.length);
this.writeBytes(abyte);
--
2.10.0