Paper/CraftBukkit-Patches/0075-Cap-Channel-Registrations.patch
2016-03-03 03:46:56 -06:00

22 lines
909 B
Diff

From 15992a6545ebf64c4125cc9c71680827b5e85efa 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 6e4ecbe..c5fdd6d 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1058,6 +1058,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.5.0