Paper/CraftBukkit-Patches/0086-Cap-Channel-Registrations.patch
Zach Brown 8bbab87c6b Update from upstream SpigotMC
3e3ea0bd0d8
320ed92779f
612de468951
2014-12-14 15:54:10 -06:00

22 lines
909 B
Diff

From dd50c6bd40232a7f970f235cabd621276dfdfe9c 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 025bae0..fa357a0 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1060,6 +1060,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