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

22 Zeilen
912 B
Diff

2014-04-02 08:54:35 +02:00
From 449f7d4c3da8968c7f41ad21397657d24fee2ae6 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
2014-04-02 08:54:35 +02:00
index b6eac78..260502b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
2014-04-02 08:54:35 +02:00
@@ -1024,6 +1024,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-02 08:54:35 +02:00
1.8.3.2