From 0f24eaeea3c20f69003f5dac33b862f67338acd6 Mon Sep 17 00:00:00 2001 From: md_5 Date: Wed, 12 Feb 2014 19:59:02 +1100 Subject: [PATCH] Mojang caps chat to 100, we should too --- .../main/java/net/md_5/bungee/connection/UpstreamBridge.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java index f1f383a7..1d3d2824 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java @@ -1,5 +1,6 @@ package net.md_5.bungee.connection; +import com.google.common.base.Preconditions; import net.md_5.bungee.BungeeCord; import net.md_5.bungee.EntityMap; import net.md_5.bungee.UserConnection; @@ -81,6 +82,8 @@ public class UpstreamBridge extends PacketHandler @Override public void handle(Chat chat) throws Exception { + Preconditions.checkArgument( chat.getMessage().length() < 100, "Chat message too long" ); // Mojang limit, check on updates + ChatEvent chatEvent = new ChatEvent( con, con.getServer(), chat.getMessage() ); if ( !bungee.getPluginManager().callEvent( chatEvent ).isCancelled() ) {