Paper/CraftBukkit-Patches/0086-Cap-Channel-Registrations.patch
Zach Brown c7f1eed0bf Update from upstream SpigotMC
3beb7729816
a77ed5758a7
52c130fc6d9
2014-12-20 19:09:49 -06:00

22 lines
909 B
Diff

From 7e4f07030baf52de72d53afa3efc52d997fa00e6 Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Wed, 12 Feb 2014 20:02:58 +1100
Subject: [PATCH] Cap Channel Registrations
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index db52ecf..4afe362 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1061,6 +1061,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
public void addChannel(String channel) {
+ com.google.common.base.Preconditions.checkState( channels.size() < 128, "Too many channels registered" ); // Spigot
if (channels.add(channel)) {
server.getPluginManager().callEvent(new PlayerRegisterChannelEvent(this, channel));
}
--
2.1.0