2016-12-17 04:13:45 +00:00
|
|
|
From bf0f64529fc9a67c460a0e9d7b8a792f6c64cd67 Mon Sep 17 00:00:00 2001
|
2016-09-22 03:56:41 +00:00
|
|
|
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
|
2016-11-17 02:23:38 +00:00
|
|
|
index 7a66195..68e8c46 100644
|
2016-09-22 03:56:41 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/PacketDataSerializer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java
|
2016-11-17 02:23:38 +00:00
|
|
|
@@ -297,8 +297,8 @@ public class PacketDataSerializer extends ByteBuf {
|
2016-09-22 03:56:41 +00:00
|
|
|
public PacketDataSerializer a(String s) {
|
|
|
|
byte[] abyte = s.getBytes(Charsets.UTF_8);
|
|
|
|
|
|
|
|
- if (abyte.length > 32767) {
|
2016-11-17 02:23:38 +00:00
|
|
|
- throw new EncoderException("String too big (was " + abyte.length + " bytes encoded, max " + 32767 + ")");
|
2016-09-22 03:56:41 +00:00
|
|
|
+ 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);
|
|
|
|
--
|
2016-12-10 23:50:31 +00:00
|
|
|
2.9.3
|
2016-09-22 03:56:41 +00:00
|
|
|
|