Paper/CraftBukkit-Patches/0100-Cap-Channel-Registrations.patch

22 lines
910 B
Diff
Raw Normal View History

2014-06-22 11:25:10 +02:00
From 5784ed33b2e9c9a5b05f72d3f31bd2e23073c90f Mon Sep 17 00:00:00 2001
2014-04-12 06:18:37 +02: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-06-22 11:25:10 +02:00
index 73e1423..a88aec4 100644
2014-04-12 06:18:37 +02: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-19 01:15:23 +02:00
1.9.1
2014-04-12 06:18:37 +02:00