mirror of
https://github.com/TuxCoding/FastLogin.git
synced 2025-07-29 10:17:38 +02:00
Update premium status for non-bungeecord setups (Related #200)
This commit is contained in:
@ -89,16 +89,12 @@ public class BungeeListener implements PluginMessageListener {
|
||||
InetSocketAddress address = player.getAddress();
|
||||
String id = '/' + address.getAddress().getHostAddress() + ':' + address.getPort();
|
||||
if (type == Type.LOGIN) {
|
||||
plugin.getPremiumPlayers().put(player.getUniqueId(), PremiumStatus.PREMIUM);
|
||||
|
||||
BukkitLoginSession playerSession = new BukkitLoginSession(playerName, true);
|
||||
playerSession.setVerified(true);
|
||||
plugin.getLoginSessions().put(id, playerSession);
|
||||
|
||||
Bukkit.getScheduler().runTaskLaterAsynchronously(plugin, new ForceLoginTask(plugin.getCore(), player), 20L);
|
||||
} else if (type == Type.REGISTER) {
|
||||
plugin.getPremiumPlayers().put(player.getUniqueId(), PremiumStatus.PREMIUM);
|
||||
|
||||
Bukkit.getScheduler().runTaskLaterAsynchronously(plugin, () -> {
|
||||
AuthPlugin<Player> authPlugin = plugin.getCore().getAuthPluginHook();
|
||||
try {
|
||||
@ -114,6 +110,7 @@ public class BungeeListener implements PluginMessageListener {
|
||||
}
|
||||
}, 20L);
|
||||
} else if (type == Type.CRACKED) {
|
||||
//we don't start a forcelogin task here so update it manually
|
||||
plugin.getPremiumPlayers().put(player.getUniqueId(), PremiumStatus.CRACKED);
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.github.games647.fastlogin.bukkit.tasks;
|
||||
|
||||
import com.github.games647.fastlogin.bukkit.BukkitLoginSession;
|
||||
import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
|
||||
import com.github.games647.fastlogin.core.PremiumStatus;
|
||||
import com.github.games647.fastlogin.core.messages.SuccessMessage;
|
||||
import com.github.games647.fastlogin.core.shared.FastLoginCore;
|
||||
import com.github.games647.fastlogin.core.shared.ForceLoginManagement;
|
||||
@ -28,10 +29,16 @@ public class ForceLoginTask extends ForceLoginManagement<Player, CommandSender,
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
//blacklist this target player for BungeeCord Id brute force attacks
|
||||
//blacklist this target player for BungeeCord ID brute force attacks
|
||||
FastLoginBukkit plugin = core.getPlugin();
|
||||
player.setMetadata(core.getPlugin().getName(), new FixedMetadataValue(plugin, true));
|
||||
|
||||
if (isOnlineMode()) {
|
||||
plugin.getPremiumPlayers().put(player.getUniqueId(), PremiumStatus.PREMIUM);
|
||||
} else {
|
||||
plugin.getPremiumPlayers().put(player.getUniqueId(), PremiumStatus.CRACKED);
|
||||
}
|
||||
|
||||
super.run();
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,6 @@ public abstract class ForceLoginManagement<P extends C, C, L extends LoginSessio
|
||||
}
|
||||
|
||||
AuthStorage storage = core.getStorage();
|
||||
|
||||
StoredProfile playerProfile = session.getProfile();
|
||||
try {
|
||||
if (isOnlineMode()) {
|
||||
|
Reference in New Issue
Block a user