2016-09-22 05:56:41 +02:00
|
|
|
From 0000000000000000000000000000000000000000 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
|
2018-01-18 07:00:51 +01:00
|
|
|
index a8fc7e431..c1273e988 100644
|
2016-09-22 05:56:41 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/PacketDataSerializer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java
|
|
|
|
@@ -0,0 +0,0 @@ public class PacketDataSerializer extends ByteBuf {
|
|
|
|
public PacketDataSerializer a(String s) {
|
2017-05-14 20:05:01 +02:00
|
|
|
byte[] abyte = s.getBytes(StandardCharsets.UTF_8);
|
2016-09-22 05:56:41 +02:00
|
|
|
|
|
|
|
- if (abyte.length > 32767) {
|
2016-11-17 03:23:38 +01:00
|
|
|
- throw new EncoderException("String too big (was " + abyte.length + " bytes encoded, max " + 32767 + ")");
|
2016-09-22 05:56:41 +02: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);
|
|
|
|
--
|