Mojang caps chat to 100, we should too

This commit is contained in:
md_5 2014-02-12 19:59:02 +11:00
parent 56e9e6a245
commit 0f24eaeea3

View File

@ -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() )
{