mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-27 04:55:47 +01:00
c55b9c30d7
66af3b310e0 a969bf6c85d 95d56229d8f 87c1d0c8b7c baf01cc7f84 38b8866783d [M]
22 lines
909 B
Diff
22 lines
909 B
Diff
From 1a3cc56937c40ebe7fe5e3eb4e5651926df75895 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 b28ec72..5480607 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
@@ -1060,6 +1060,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
|
|
|