From 777dddbc2459b81f315f12e4b770e952d30422ab Mon Sep 17 00:00:00 2001 From: md_5 Date: Sun, 23 Jun 2013 11:06:30 +1000 Subject: [PATCH] Customize server is full message --- .../0053-Configurable-Messages.patch | 19 +++++++++++++++---- .../0055-Add-Log-Filtering.patch | 8 ++++---- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/CraftBukkit-Patches/0053-Configurable-Messages.patch b/CraftBukkit-Patches/0053-Configurable-Messages.patch index 184702f0a..ba50f966a 100644 --- a/CraftBukkit-Patches/0053-Configurable-Messages.patch +++ b/CraftBukkit-Patches/0053-Configurable-Messages.patch @@ -1,11 +1,11 @@ -From 866aee41f87d8a15b7181248f1f36076e818c67a Mon Sep 17 00:00:00 2001 +From 1c42664186e3191cc60a48a07769707934d3a112 Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 21 Jun 2013 19:21:58 +1000 Subject: [PATCH] Configurable Messages diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index fe846af..edeefba 100644 +index fe846af..ab38736 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -307,7 +307,7 @@ public abstract class PlayerList { @@ -17,6 +17,15 @@ index fe846af..edeefba 100644 } else { String s2 = socketaddress.toString(); +@@ -323,7 +323,7 @@ public abstract class PlayerList { + + event.disallow(PlayerLoginEvent.Result.KICK_BANNED, s3); + } else if (this.players.size() >= this.maxPlayers) { +- event.disallow(PlayerLoginEvent.Result.KICK_FULL, "The server is full!"); ++ event.disallow(PlayerLoginEvent.Result.KICK_FULL, org.spigotmc.SpigotConfig.serverFullMessage); // Spigot + } else { + event.disallow(PlayerLoginEvent.Result.ALLOWED, s2); + } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 42600a6..9d71ae3 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -31,7 +40,7 @@ index 42600a6..9d71ae3 100644 return false; } diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java -index 3cccb72..102c5fa 100644 +index d217794..0d53a5b 100644 --- a/src/main/java/org/spigotmc/SpigotConfig.java +++ b/src/main/java/org/spigotmc/SpigotConfig.java @@ -15,6 +15,7 @@ import java.util.Map; @@ -42,13 +51,14 @@ index 3cccb72..102c5fa 100644 import org.bukkit.command.Command; import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.craftbukkit.command.TicksPerSecondCommand; -@@ -225,4 +226,16 @@ public class SpigotConfig +@@ -225,4 +226,18 @@ public class SpigotConfig { tabComplete = getBoolean( "commands.tab-complete", true ); } + + public static String whitelistMessage; + public static String unknownCommandMessage; ++ public static String serverFullMessage; + private static String transform(String s) + { + return ChatColor.translateAlternateColorCodes( '&', s ).replaceAll( "\\n", "\n" ); @@ -57,6 +67,7 @@ index 3cccb72..102c5fa 100644 + { + whitelistMessage = transform( getString( "messages.whitelist", "You are not whitelisted on this server!" ) ); + unknownCommandMessage = transform( getString( "messages.unknown-command", "Unknown command. Type \"help\" for help." ) ); ++ serverFullMessage = transform( getString( "messages.server-full", "The server is full!" ) ); + } } -- diff --git a/CraftBukkit-Patches/0055-Add-Log-Filtering.patch b/CraftBukkit-Patches/0055-Add-Log-Filtering.patch index d0db27ea2..269378f61 100644 --- a/CraftBukkit-Patches/0055-Add-Log-Filtering.patch +++ b/CraftBukkit-Patches/0055-Add-Log-Filtering.patch @@ -1,4 +1,4 @@ -From a6d06947f8a021fe637a3a32b1c1e5a8213ffc93 Mon Sep 17 00:00:00 2001 +From 12842ce0abe79fc49a1c054dbd3cd04a4959d0c1 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 22 Jun 2013 16:40:11 +1000 Subject: [PATCH] Add Log Filtering @@ -32,7 +32,7 @@ index 0000000..fd26480 + } +} diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java -index 67854aa..7c80298 100644 +index 0d53a5b..cc3b9d8 100644 --- a/src/main/java/org/spigotmc/SpigotConfig.java +++ b/src/main/java/org/spigotmc/SpigotConfig.java @@ -13,6 +13,8 @@ import java.util.HashMap; @@ -44,9 +44,9 @@ index 67854aa..7c80298 100644 import net.minecraft.server.MinecraftServer; import org.bukkit.Bukkit; import org.bukkit.ChatColor; -@@ -238,4 +240,27 @@ public class SpigotConfig - whitelistMessage = transform( getString( "messages.whitelist", "You are not whitelisted on this server!" ) ); +@@ -240,4 +242,27 @@ public class SpigotConfig unknownCommandMessage = transform( getString( "messages.unknown-command", "Unknown command. Type \"help\" for help." ) ); + serverFullMessage = transform( getString( "messages.server-full", "The server is full!" ) ); } + + public static List logFilters;