From 5aad14d2b62ca3ced653559760472e9b1ff4cc27 Mon Sep 17 00:00:00 2001 From: md_5 Date: Wed, 12 Feb 2014 20:03:12 +1100 Subject: [PATCH] Cap Channel Registrations to 128 entries --- .../0113-Cap-Channel-Registrations.patch | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 CraftBukkit-Patches/0113-Cap-Channel-Registrations.patch diff --git a/CraftBukkit-Patches/0113-Cap-Channel-Registrations.patch b/CraftBukkit-Patches/0113-Cap-Channel-Registrations.patch new file mode 100644 index 0000000000..8785c8b4cc --- /dev/null +++ b/CraftBukkit-Patches/0113-Cap-Channel-Registrations.patch @@ -0,0 +1,21 @@ +From 86788e0d4bd7d8e5d07c7a922e900bf786952ab3 Mon Sep 17 00:00:00 2001 +From: md_5 +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 84d60c3..d83eefb 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +@@ -1025,6 +1025,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)); + } +-- +1.8.3.2 +