papermc/CraftBukkit-Patches/0101-Cap-Channel-Registrations.patch

22 lines
910 B
Diff
Raw Normal View History

2014-04-24 06:27:12 +00:00
From 7ba6792c3311566dbf20bd424739c09add59c1fe Mon Sep 17 00:00:00 2001
2014-04-12 04:18:37 +00:00
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
2014-04-18 23:15:23 +00:00
index 3c4b42f..41e785c 100644
2014-04-12 04:18:37 +00:00
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1056,6 +1056,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));
}
--
2014-04-18 23:15:23 +00:00
1.9.1
2014-04-12 04:18:37 +00:00