Paper/CraftBukkit-Patches/0086-Cap-Channel-Registrations.patch
Zach Brown 6a5e553feb Update from upstream SpigotMC
a3168ab2ce4
9b45d9fa8d3
b43a31a5c25
a926b96d5d1
d6b5ba7ca03
bb782d07aed
5a74d55c678
47b1dff3e68 [M]
2014-12-18 17:33:08 -06:00

22 lines
909 B
Diff

From 7b53722e93ea82d5fc6cc5cc597f77fff4e32235 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 1e11630..856e335 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1063,6 +1063,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