forked from TuxCoding/FastLogin
Add cracked whitelist (Fixes #42)
(switch-mode -> switching to online-mode from offlinemode)
This commit is contained in:
@ -3,6 +3,12 @@
|
|||||||
* Added second attempt login -> cracked login
|
* Added second attempt login -> cracked login
|
||||||
* Fix ProtocolSupport autoRegister
|
* Fix ProtocolSupport autoRegister
|
||||||
* Fix update username in FastLogin database after nameChange
|
* 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
|
######1.8
|
||||||
|
|
||||||
|
@ -77,11 +77,14 @@ public class CrackedCommand implements CommandExecutor {
|
|||||||
//todo: load async
|
//todo: load async
|
||||||
final PlayerProfile profile = plugin.getCore().getStorage().loadProfile(args[0]);
|
final PlayerProfile profile = plugin.getCore().getStorage().loadProfile(args[0]);
|
||||||
if (profile == null) {
|
if (profile == null) {
|
||||||
sender.sendMessage(plugin.getCore().getMessage("player-unknown"));
|
sender.sendMessage("Error occured");
|
||||||
return;
|
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"));
|
sender.sendMessage(plugin.getCore().getMessage("remove-premium"));
|
||||||
profile.setPremium(false);
|
profile.setPremium(false);
|
||||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||||
@ -90,8 +93,6 @@ public class CrackedCommand implements CommandExecutor {
|
|||||||
plugin.getCore().getStorage().save(profile);
|
plugin.getCore().getStorage().save(profile);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
sender.sendMessage(plugin.getCore().getMessage("not-premium-other"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.github.games647.fastlogin.bungee;
|
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.AuthStorage;
|
||||||
import com.github.games647.fastlogin.core.FastLoginCore;
|
import com.github.games647.fastlogin.core.FastLoginCore;
|
||||||
import com.github.games647.fastlogin.core.importer.ImportPlugin;
|
import com.github.games647.fastlogin.core.importer.ImportPlugin;
|
||||||
@ -13,7 +14,7 @@ public class ImportCommand extends Command {
|
|||||||
private final FastLoginBungee plugin;
|
private final FastLoginBungee plugin;
|
||||||
|
|
||||||
public ImportCommand(FastLoginBungee plugin) {
|
public ImportCommand(FastLoginBungee plugin) {
|
||||||
super("import-db");
|
super("import-db", plugin.getDescription().getName().toLowerCase() + ".import");
|
||||||
|
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
}
|
}
|
||||||
@ -79,7 +80,5 @@ public class ImportCommand extends Command {
|
|||||||
} else {
|
} else {
|
||||||
sender.sendMessage(ChatColor.DARK_RED + "Failed to import the data. Check out the logs");
|
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()) {
|
} else if (profile.isPremium()) {
|
||||||
requestPremiumLogin(connection, profile, username, true);
|
requestPremiumLogin(connection, profile, username, true);
|
||||||
} else {
|
} else {
|
||||||
|
if (plugin.getConfig().getBoolean("switchMode")) {
|
||||||
|
connection.disconnect(plugin.getCore().getMessage("switch-kick-message"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//Cracked session
|
//Cracked session
|
||||||
plugin.getSession().put(connection, new BungeeLoginSession(username, false, profile));
|
plugin.getSession().put(connection, new BungeeLoginSession(username, false, profile));
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,8 @@ public class AsyncToggleMessage implements Runnable {
|
|||||||
|
|
||||||
private void turnOffPremium() {
|
private void turnOffPremium() {
|
||||||
PlayerProfile playerProfile = plugin.getCore().getStorage().loadProfile(targetPlayer);
|
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")));
|
fromPlayer.sendMessage(TextComponent.fromLegacyText(plugin.getCore().getMessage("not-premium")));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,13 @@ autoRegister: false
|
|||||||
# tries to join again, so the player could join as cracked player.
|
# tries to join again, so the player could join as cracked player.
|
||||||
secondAttemptCracked: false
|
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
|
# 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
|
# uuid from that account. So if the players changes their usernames, they will still have
|
||||||
# the same playerdata (inventory, permissions, ...)
|
# the same playerdata (inventory, permissions, ...)
|
||||||
|
@ -21,6 +21,9 @@
|
|||||||
|
|
||||||
# ========= Shared (BungeeCord and Bukkit) ============
|
# ========= 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
|
# Player activated premium logins in order to skip offline authentication
|
||||||
add-premium: '&2Added to the list of premium players'
|
add-premium: '&2Added to the list of premium players'
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user