Add cracked whitelist (Fixes #42)

(switch-mode -> switching to online-mode from offlinemode)
This commit is contained in:
games647 committed 2016-09-09 16:40:24 +02:00
1 parent ad1ab22586
commit 5022c9aa7b
7 files changed
+30 -8

No files matched your search

@@ -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;
}
}
@@ -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));
}
@@ -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;
}