diff --git a/CHANGELOG.md b/CHANGELOG.md index b7b19fad..f39a3710 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,12 @@ ######1.6 +* Add a warning message if the user tries to invoke the premium command +* Added missing translation if the server isn't fully started * Removed ProtocolLib as required dependency. You can use ProtocolSupport or BungeeCord as alternative * Reduce the number of worker threads from 5 to 3 in ProtocolLib * Process packets in ProtocolLib async/non-blocking -> better performance +* Fixed missing translation in commands +* Fixed cracked command not working on BungeeCord * Fix error if forward skins is disabled ######1.5.2 diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/commands/CrackedCommand.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/commands/CrackedCommand.java index a1d0c553..ad4bc15e 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/commands/CrackedCommand.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/commands/CrackedCommand.java @@ -6,7 +6,6 @@ import com.google.common.io.ByteArrayDataOutput; import com.google.common.io.ByteStreams; import org.bukkit.Bukkit; -import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; @@ -39,7 +38,7 @@ public class CrackedCommand implements CommandExecutor { //todo: load async if it's not in the cache anymore final PlayerProfile profile = plugin.getCore().getStorage().loadProfile(sender.getName()); if (profile.isPremium()) { - sender.sendMessage(ChatColor.DARK_GREEN + "Removed from the list of premium players"); + sender.sendMessage(plugin.getCore().getMessage("remove-premium")); profile.setPremium(false); profile.setUuid(null); Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() { @@ -49,7 +48,7 @@ public class CrackedCommand implements CommandExecutor { } }); } else { - sender.sendMessage(ChatColor.DARK_RED + "You are not in the premium list"); + sender.sendMessage(plugin.getCore().getMessage("not-premium")); } } @@ -75,7 +74,7 @@ public class CrackedCommand implements CommandExecutor { } if (profile.isPremium()) { - sender.sendMessage(ChatColor.DARK_GREEN + "Removed from the list of premium players"); + sender.sendMessage(plugin.getCore().getMessage("remove-premium")); profile.setPremium(false); profile.setUuid(null); Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() { @@ -85,7 +84,7 @@ public class CrackedCommand implements CommandExecutor { } }); } else { - sender.sendMessage(ChatColor.DARK_RED + "Player is not in the premium list"); + sender.sendMessage(plugin.getCore().getMessage("not-premium-other")); } } } @@ -97,6 +96,7 @@ public class CrackedCommand implements CommandExecutor { if (sender instanceof Player) { notifiyBungeeCord((Player) sender, target); } else { + plugin.getLogger().info("No player online to send a plugin message to the proxy"); //todo: add console support // Player firstPlayer = Iterables.getFirst(Bukkit.getOnlinePlayers(), null); // notifiyBungeeCord(firstPlayer, target); @@ -109,7 +109,7 @@ public class CrackedCommand implements CommandExecutor { dataOutput.writeUTF("OFF"); dataOutput.writeUTF(target); - plugin.getLogger().info("No player online to send a plugin message to the proxy"); + sender.sendPluginMessage(plugin, plugin.getName(), dataOutput.toByteArray()); } } } diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/commands/PremiumCommand.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/commands/PremiumCommand.java index ae4310da..9557ccd5 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/commands/PremiumCommand.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/commands/PremiumCommand.java @@ -6,7 +6,6 @@ import com.google.common.io.ByteArrayDataOutput; import com.google.common.io.ByteStreams; import org.bukkit.Bukkit; -import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; @@ -44,7 +43,7 @@ public class PremiumCommand implements CommandExecutor { // //todo: load async if it's not in the cache anymore final PlayerProfile profile = plugin.getCore().getStorage().loadProfile(sender.getName()); if (profile.isPremium()) { - sender.sendMessage(ChatColor.DARK_RED + "You are already on the premium list"); + sender.sendMessage(plugin.getCore().getMessage("already-exists")); } else { //todo: resolve uuid profile.setPremium(true); @@ -55,7 +54,7 @@ public class PremiumCommand implements CommandExecutor { } }); - sender.sendMessage(ChatColor.DARK_GREEN + "Added to the list of premium players"); + sender.sendMessage(plugin.getCore().getMessage("add-premium")); } } @@ -81,7 +80,7 @@ public class PremiumCommand implements CommandExecutor { } if (profile.isPremium()) { - sender.sendMessage(ChatColor.DARK_RED + "Player is already on the premium list"); + sender.sendMessage(plugin.getCore().getMessage("already-exists-other")); } else { //todo: resolve uuid profile.setPremium(true); @@ -92,7 +91,7 @@ public class PremiumCommand implements CommandExecutor { } }); - sender.sendMessage(ChatColor.DARK_GREEN + "Added to the list of premium players"); + sender.sendMessage(plugin.getCore().getMessage("add-premium")); } } } @@ -104,6 +103,7 @@ public class PremiumCommand implements CommandExecutor { if (sender instanceof Player) { notifiyBungeeCord((Player) sender, target); } else { + plugin.getLogger().info("No player online to send a plugin message to the proxy"); //todo: add console support // Player firstPlayer = Iterables.getFirst(Bukkit.getOnlinePlayers(), null); // notifiyBungeeCord(firstPlayer, target); diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/BukkitJoinListener.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/BukkitJoinListener.java index eb6af793..4c811081 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/BukkitJoinListener.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/BukkitJoinListener.java @@ -30,7 +30,7 @@ public class BukkitJoinListener implements Listener { @EventHandler(priority = EventPriority.LOWEST) public void onPlayerLogin(PlayerLoginEvent loginEvent) { if (loginEvent.getResult() == Result.ALLOWED && !plugin.isServerFullyStarted()) { - loginEvent.disallow(Result.KICK_OTHER, "§cServer is not fully started yet. Please retry"); + loginEvent.disallow(Result.KICK_OTHER, plugin.getCore().getMessage("not-started")); } } diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/PlayerConnectionListener.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/PlayerConnectionListener.java index 486aa16e..9949117b 100644 --- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/PlayerConnectionListener.java +++ b/bungee/src/main/java/com/github/games647/fastlogin/bungee/listener/PlayerConnectionListener.java @@ -91,7 +91,7 @@ public class PlayerConnectionListener implements Listener { } @EventHandler - public void onServerConnected(PlayerDisconnectEvent disconnectEvent) { + public void onDisconnect(PlayerDisconnectEvent disconnectEvent) { ProxiedPlayer player = disconnectEvent.getPlayer(); plugin.getSession().remove(player.getPendingConnection()); } diff --git a/core/src/main/resources/config.yml b/core/src/main/resources/config.yml index c8274215..d5a0b819 100644 --- a/core/src/main/resources/config.yml +++ b/core/src/main/resources/config.yml @@ -100,6 +100,12 @@ nameChangeCheck: false # ChangeSkin, SkinRestoer, ... forwardSkin: true +# Displays a warning message that this message SHOULD only be invoked by +# users who actually are the owner of this account. So not by cracked players +# +# If they still want to invoke the command, they have to invoke /premium again +premium-warning: true + # Database configuration # Recommened is the use of MariaDB (a better version of MySQL) diff --git a/core/src/main/resources/messages.yml b/core/src/main/resources/messages.yml index 6f3083b2..5ff50ad7 100644 --- a/core/src/main/resources/messages.yml +++ b/core/src/main/resources/messages.yml @@ -27,12 +27,18 @@ add-premium: '&2Added to the list of premium players' # Player is already set be a paid account already-exists: '&4You are already on the premium list' +# Player is already set be a paid account +already-exists-other: '&4You are already on the premium list' + # Player was changed to be cracked remove-premium: '&2Removed from the list of premium players' # Player is already set to be cracked not-premium: '&4You are not in the premium list' +# Player is already set to be cracked +not-premium-other: '&4You are not in the premium list' + # Admin wanted to change the premium of a user that isn't known to the plugin player-unknown: '&4Player not in the database' @@ -74,6 +80,13 @@ invalid-session: '&4Invalid session' # The client sent a malicous packet without a login request packet invalid-requst: '&4Invalid request' +# Message if the bukkit isn't fully started to inject the packets +not-started: '&cServer is not fully started yet. Please retry' + +# Warning message if a user invoked /premium command +premium-warming: '&6WARNING: This command should only be invoked if you are the owner of this paid minecraft account +Type /premium again to confirm' + # ========= Bungee/Waterfall only ================================