diff --git a/CHANGELOG.md b/CHANGELOG.md index 56dd140a..5e7ff4c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ * Added second attempt login -> cracked login * Fix ProtocolSupport autoRegister * Fix update username in FastLogin database after nameChange +* Fix logging exceptions on encryption enabling +* Add missing add-premium-other message +* Fix compatibility with older ProtocolLib versions (for 1.7) because of the missing getMethodAcccessorOrNull method +* Add cracked whitelist (switch-mode -> switching to online-mode from offlinemode) +* Fix correct cracked permission for bukkit +* A try to fix SQLite timestamp parsing ######1.8 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 48741c33..0cb2659f 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 @@ -77,11 +77,14 @@ public class CrackedCommand implements CommandExecutor { //todo: load async final PlayerProfile profile = plugin.getCore().getStorage().loadProfile(args[0]); if (profile == null) { - sender.sendMessage(plugin.getCore().getMessage("player-unknown")); + sender.sendMessage("Error occured"); return; } - if (profile.isPremium()) { + //existing player is already cracked + if (profile.getUserId() == -1 && !profile.isPremium()) { + sender.sendMessage(plugin.getCore().getMessage("not-premium-other")); + } else { sender.sendMessage(plugin.getCore().getMessage("remove-premium")); profile.setPremium(false); Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() { @@ -90,8 +93,6 @@ public class CrackedCommand implements CommandExecutor { plugin.getCore().getStorage().save(profile); } }); - } else { - sender.sendMessage(plugin.getCore().getMessage("not-premium-other")); } } } diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/ImportCommand.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/ImportCommand.java index f33a852c..311d387b 100644 --- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/ImportCommand.java +++ b/bungee/src/main/java/com/github/games647/fastlogin/bungee/ImportCommand.java @@ -1,5 +1,6 @@ package com.github.games647.fastlogin.bungee; +import com.github.games647.fastlogin.bungee.FastLoginBungee; import com.github.games647.fastlogin.core.AuthStorage; import com.github.games647.fastlogin.core.FastLoginCore; import com.github.games647.fastlogin.core.importer.ImportPlugin; @@ -13,7 +14,7 @@ public class ImportCommand extends Command { private final FastLoginBungee plugin; public ImportCommand(FastLoginBungee plugin) { - super("import-db"); + super("import-db", plugin.getDescription().getName().toLowerCase() + ".import"); this.plugin = plugin; } @@ -79,7 +80,5 @@ public class ImportCommand extends Command { } else { sender.sendMessage(ChatColor.DARK_RED + "Failed to import the data. Check out the logs"); } - - return; } } diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/tasks/AsyncPremiumCheck.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/tasks/AsyncPremiumCheck.java index ed7c7214..d31eca6e 100644 --- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/tasks/AsyncPremiumCheck.java +++ b/bungee/src/main/java/com/github/games647/fastlogin/bungee/tasks/AsyncPremiumCheck.java @@ -58,6 +58,11 @@ public class AsyncPremiumCheck implements Runnable { } else if (profile.isPremium()) { requestPremiumLogin(connection, profile, username, true); } else { + if (plugin.getConfig().getBoolean("switchMode")) { + connection.disconnect(plugin.getCore().getMessage("switch-kick-message")); + return; + } + //Cracked session plugin.getSession().put(connection, new BungeeLoginSession(username, false, profile)); } diff --git a/bungee/src/main/java/com/github/games647/fastlogin/bungee/tasks/AsyncToggleMessage.java b/bungee/src/main/java/com/github/games647/fastlogin/bungee/tasks/AsyncToggleMessage.java index b18a0f3f..012a57b3 100644 --- a/bungee/src/main/java/com/github/games647/fastlogin/bungee/tasks/AsyncToggleMessage.java +++ b/bungee/src/main/java/com/github/games647/fastlogin/bungee/tasks/AsyncToggleMessage.java @@ -32,7 +32,8 @@ public class AsyncToggleMessage implements Runnable { private void turnOffPremium() { PlayerProfile playerProfile = plugin.getCore().getStorage().loadProfile(targetPlayer); - if (!playerProfile.isPremium()) { + //existing player is already cracked + if (playerProfile.getUserId() != -1 && !playerProfile.isPremium()) { fromPlayer.sendMessage(TextComponent.fromLegacyText(plugin.getCore().getMessage("not-premium"))); return; } diff --git a/core/src/main/resources/config.yml b/core/src/main/resources/config.yml index 7d91509e..32f5f0b9 100644 --- a/core/src/main/resources/config.yml +++ b/core/src/main/resources/config.yml @@ -29,6 +29,13 @@ autoRegister: false # tries to join again, so the player could join as cracked player. secondAttemptCracked: false +# New cracked players will be kicked from server. Good if you want switch from offline-mode to online-mode without +# losing players! +# +# Existing cracked and premium players could still join your server. Moreover you could add playernames to a whitelist. +# So that these cracked players could join too although they are new players. +switchMode: false + # If this plugin detected that a player has a premium, it can also set the associated # uuid from that account. So if the players changes their usernames, they will still have # the same playerdata (inventory, permissions, ...) diff --git a/core/src/main/resources/messages.yml b/core/src/main/resources/messages.yml index b84f0cfc..56ec3033 100644 --- a/core/src/main/resources/messages.yml +++ b/core/src/main/resources/messages.yml @@ -21,6 +21,9 @@ # ========= Shared (BungeeCord and Bukkit) ============ +# Switch mode is activated and a new (non-whitelist) cracked player tries to join +switch-kick-message: '&4Only paid minecraft whitelisted accounts are allowed to join this server' + # Player activated premium logins in order to skip offline authentication add-premium: '&2Added to the list of premium players'