- Create IP address manager for handling and caching IP addresses -> outside of the manager I do not want to care about caching details - Make more processes use the ProcessService in favor of statically injected objects
This commit is contained in:
@@ -43,14 +43,7 @@ public class Management {
|
||||
}
|
||||
|
||||
public void performLogin(final Player player, final String password, final boolean forceLogin) {
|
||||
sched.runTaskAsynchronously(plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
new AsynchronousLogin(player, password, forceLogin, plugin, dataSource, settings)
|
||||
.process();
|
||||
}
|
||||
});
|
||||
runTask(new AsynchronousLogin(player, password, forceLogin, plugin, dataSource, processService));
|
||||
}
|
||||
|
||||
public void performLogout(final Player player) {
|
||||
@@ -64,23 +57,11 @@ public class Management {
|
||||
}
|
||||
|
||||
public void performRegister(final Player player, final String password, final String email) {
|
||||
sched.runTaskAsynchronously(plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
new AsyncRegister(player, password, email, plugin, dataSource, settings).process();
|
||||
}
|
||||
});
|
||||
runTask(new AsyncRegister(player, password, email, plugin, dataSource, processService));
|
||||
}
|
||||
|
||||
public void performUnregister(final Player player, final String password, final boolean force) {
|
||||
sched.runTaskAsynchronously(plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
new AsynchronousUnregister(player, password, force, plugin).process();
|
||||
}
|
||||
});
|
||||
runTask(new AsynchronousUnregister(player, password, force, plugin, processService));
|
||||
}
|
||||
|
||||
public void performJoin(final Player player) {
|
||||
@@ -88,14 +69,7 @@ public class Management {
|
||||
}
|
||||
|
||||
public void performQuit(final Player player, final boolean isKick) {
|
||||
sched.runTaskAsynchronously(plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
new AsynchronousQuit(player, plugin, dataSource, isKick).process();
|
||||
}
|
||||
|
||||
});
|
||||
runTask(new AsynchronousQuit(player, plugin, dataSource, isKick, processService));
|
||||
}
|
||||
|
||||
public void performAddEmail(final Player player, final String newEmail) {
|
||||
@@ -103,12 +77,7 @@ public class Management {
|
||||
}
|
||||
|
||||
public void performChangeEmail(final Player player, final String oldEmail, final String newEmail) {
|
||||
sched.runTaskAsynchronously(plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
new AsyncChangeEmail(player, plugin, oldEmail, newEmail, dataSource, playerCache, settings).process();
|
||||
}
|
||||
});
|
||||
runTask(new AsyncChangeEmail(player, plugin, oldEmail, newEmail, dataSource, playerCache, settings));
|
||||
}
|
||||
|
||||
private void runTask(Process process) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package fr.xephi.authme.process;
|
||||
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.manager.IpAddressManager;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.output.Messages;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
@@ -17,11 +18,13 @@ public class ProcessService {
|
||||
private final NewSetting settings;
|
||||
private final Messages messages;
|
||||
private final AuthMe authMe;
|
||||
private final IpAddressManager ipAddressManager;
|
||||
|
||||
public ProcessService(NewSetting settings, Messages messages, AuthMe authMe) {
|
||||
public ProcessService(NewSetting settings, Messages messages, AuthMe authMe, IpAddressManager ipAddressManager) {
|
||||
this.settings = settings;
|
||||
this.messages = messages;
|
||||
this.authMe = authMe;
|
||||
this.ipAddressManager = ipAddressManager;
|
||||
}
|
||||
|
||||
public <T> T getProperty(Property<T> property) {
|
||||
@@ -36,7 +39,15 @@ public class ProcessService {
|
||||
messages.send(sender, key);
|
||||
}
|
||||
|
||||
public String retrieveMessage(MessageKey key) {
|
||||
public void send(CommandSender sender, MessageKey key, String... replacements) {
|
||||
messages.send(sender, key, replacements);
|
||||
}
|
||||
|
||||
public String[] retrieveMessage(MessageKey key) {
|
||||
return messages.retrieve(key);
|
||||
}
|
||||
|
||||
public String retrieveSingleMessage(MessageKey key) {
|
||||
return messages.retrieveSingle(key);
|
||||
}
|
||||
|
||||
@@ -60,4 +71,8 @@ public class ProcessService {
|
||||
return authMe;
|
||||
}
|
||||
|
||||
public IpAddressManager getIpAddressManager() {
|
||||
return ipAddressManager;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import fr.xephi.authme.cache.auth.PlayerCache;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.output.Messages;
|
||||
import fr.xephi.authme.process.Process;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.util.Utils;
|
||||
@@ -14,7 +15,7 @@ import org.bukkit.entity.Player;
|
||||
/**
|
||||
* Async task for changing the email.
|
||||
*/
|
||||
public class AsyncChangeEmail {
|
||||
public class AsyncChangeEmail implements Process {
|
||||
|
||||
private final Player player;
|
||||
private final String oldEmail;
|
||||
@@ -35,7 +36,8 @@ public class AsyncChangeEmail {
|
||||
this.settings = settings;
|
||||
}
|
||||
|
||||
public void process() {
|
||||
@Override
|
||||
public void run() {
|
||||
String playerName = player.getName().toLowerCase();
|
||||
if (playerCache.isAuthenticated(playerName)) {
|
||||
PlayerAuth auth = playerCache.getAuth(playerName);
|
||||
|
||||
@@ -59,15 +59,11 @@ public class AsynchronousJoin implements Process {
|
||||
return;
|
||||
}
|
||||
|
||||
if (service.getProperty(HooksSettings.ENABLE_VERYGAMES_IP_CHECK)) {
|
||||
plugin.getVerygamesIp(player);
|
||||
}
|
||||
|
||||
if (plugin.ess != null && service.getProperty(HooksSettings.DISABLE_SOCIAL_SPY)) {
|
||||
plugin.ess.getUser(player).setSocialSpyEnabled(false);
|
||||
}
|
||||
|
||||
final String ip = plugin.getIP(player);
|
||||
final String ip = service.getIpAddressManager().getPlayerIp(player);
|
||||
|
||||
|
||||
if (isNameRestricted(name, ip, player.getAddress().getHostName(), service.getSettings())) {
|
||||
@@ -75,7 +71,7 @@ public class AsynchronousJoin implements Process {
|
||||
@Override
|
||||
public void run() {
|
||||
AuthMePlayerListener.causeByAuthMe.putIfAbsent(name, true);
|
||||
player.kickPlayer(service.retrieveMessage(MessageKey.NOT_OWNER_ERROR));
|
||||
player.kickPlayer(service.retrieveSingleMessage(MessageKey.NOT_OWNER_ERROR));
|
||||
if (Settings.banUnsafeIp) {
|
||||
plugin.getServer().banIP(ip);
|
||||
}
|
||||
@@ -87,7 +83,7 @@ public class AsynchronousJoin implements Process {
|
||||
&& !plugin.getPermissionsManager().hasPermission(player, PlayerStatePermission.ALLOW_MULTIPLE_ACCOUNTS)
|
||||
&& !"127.0.0.1".equalsIgnoreCase(ip)
|
||||
&& !"localhost".equalsIgnoreCase(ip)
|
||||
&& hasJoinedIp(player.getName(), ip, service.getSettings(), service.getAuthMe())) {
|
||||
&& hasJoinedIp(player.getName(), ip, service.getSettings())) {
|
||||
service.scheduleSyncDelayedTask(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -295,11 +291,13 @@ public class AsynchronousJoin implements Process {
|
||||
return nameFound;
|
||||
}
|
||||
|
||||
private boolean hasJoinedIp(String name, String ip, NewSetting settings, AuthMe authMe) {
|
||||
private boolean hasJoinedIp(String name, String ip, NewSetting settings) {
|
||||
int count = 0;
|
||||
for (Player player : Utils.getOnlinePlayers()) {
|
||||
if (ip.equalsIgnoreCase(authMe.getIP(player)) && !player.getName().equalsIgnoreCase(name))
|
||||
if (ip.equalsIgnoreCase(service.getIpAddressManager().getPlayerIp(player))
|
||||
&& !player.getName().equalsIgnoreCase(name)) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count >= settings.getProperty(RestrictionSettings.MAX_JOIN_PER_IP);
|
||||
}
|
||||
|
||||
@@ -8,14 +8,15 @@ import fr.xephi.authme.cache.limbo.LimboCache;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.events.AuthMeAsyncPreLoginEvent;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.output.Messages;
|
||||
import fr.xephi.authme.permission.AdminPermission;
|
||||
import fr.xephi.authme.permission.PlayerPermission;
|
||||
import fr.xephi.authme.permission.PlayerStatePermission;
|
||||
import fr.xephi.authme.process.Process;
|
||||
import fr.xephi.authme.process.ProcessService;
|
||||
import fr.xephi.authme.security.RandomString;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.RegistrationSettings;
|
||||
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||
import fr.xephi.authme.task.MessageTask;
|
||||
import fr.xephi.authme.util.StringUtils;
|
||||
import fr.xephi.authme.util.Utils;
|
||||
@@ -27,7 +28,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class AsynchronousLogin {
|
||||
public class AsynchronousLogin implements Process {
|
||||
|
||||
private final Player player;
|
||||
private final String name;
|
||||
@@ -36,23 +37,11 @@ public class AsynchronousLogin {
|
||||
private final boolean forceLogin;
|
||||
private final AuthMe plugin;
|
||||
private final DataSource database;
|
||||
private final Messages m;
|
||||
private final String ip;
|
||||
private final NewSetting settings;
|
||||
private final ProcessService service;
|
||||
|
||||
/**
|
||||
* Constructor for AsynchronousLogin.
|
||||
*
|
||||
* @param player Player
|
||||
* @param password String
|
||||
* @param forceLogin boolean
|
||||
* @param plugin AuthMe
|
||||
* @param data DataSource
|
||||
* @param settings The settings
|
||||
*/
|
||||
public AsynchronousLogin(Player player, String password, boolean forceLogin, AuthMe plugin, DataSource data,
|
||||
NewSetting settings) {
|
||||
this.m = plugin.getMessages();
|
||||
ProcessService service) {
|
||||
this.player = player;
|
||||
this.name = player.getName().toLowerCase();
|
||||
this.password = password;
|
||||
@@ -60,12 +49,12 @@ public class AsynchronousLogin {
|
||||
this.forceLogin = forceLogin;
|
||||
this.plugin = plugin;
|
||||
this.database = data;
|
||||
this.ip = plugin.getIP(player);
|
||||
this.settings = settings;
|
||||
this.ip = service.getIpAddressManager().getPlayerIp(player);
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
private boolean needsCaptcha() {
|
||||
if (Settings.useCaptcha) {
|
||||
if (service.getProperty(SecuritySettings.USE_CAPTCHA)) {
|
||||
if (!plugin.captcha.containsKey(name)) {
|
||||
plugin.captcha.putIfAbsent(name, 1);
|
||||
} else {
|
||||
@@ -75,7 +64,7 @@ public class AsynchronousLogin {
|
||||
}
|
||||
if (plugin.captcha.containsKey(name) && plugin.captcha.get(name) > Settings.maxLoginTry) {
|
||||
plugin.cap.putIfAbsent(name, RandomString.generate(Settings.captchaLength));
|
||||
m.send(player, MessageKey.USAGE_CAPTCHA, plugin.cap.get(name));
|
||||
service.send(player, MessageKey.USAGE_CAPTCHA, plugin.cap.get(name));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -90,30 +79,27 @@ public class AsynchronousLogin {
|
||||
*/
|
||||
private PlayerAuth preAuth() {
|
||||
if (PlayerCache.getInstance().isAuthenticated(name)) {
|
||||
m.send(player, MessageKey.ALREADY_LOGGED_IN_ERROR);
|
||||
service.send(player, MessageKey.ALREADY_LOGGED_IN_ERROR);
|
||||
return null;
|
||||
}
|
||||
|
||||
PlayerAuth pAuth = database.getAuth(name);
|
||||
if (pAuth == null) {
|
||||
m.send(player, MessageKey.USER_NOT_REGISTERED);
|
||||
service.send(player, MessageKey.USER_NOT_REGISTERED);
|
||||
if (LimboCache.getInstance().hasLimboPlayer(name)) {
|
||||
LimboCache.getInstance().getLimboPlayer(name).getMessageTaskId().cancel();
|
||||
String[] msg;
|
||||
if (Settings.emailRegistration) {
|
||||
msg = m.retrieve(MessageKey.REGISTER_EMAIL_MESSAGE);
|
||||
} else {
|
||||
msg = m.retrieve(MessageKey.REGISTER_MESSAGE);
|
||||
}
|
||||
BukkitTask msgT = Bukkit.getScheduler().runTask(plugin,
|
||||
new MessageTask(plugin, name, msg, settings.getProperty(RegistrationSettings.MESSAGE_INTERVAL)));
|
||||
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(msgT);
|
||||
String[] msg = service.getProperty(RegistrationSettings.USE_EMAIL_REGISTRATION)
|
||||
? service.retrieveMessage(MessageKey.REGISTER_EMAIL_MESSAGE)
|
||||
: service.retrieveMessage(MessageKey.REGISTER_MESSAGE);
|
||||
BukkitTask messageTask = service.runTask(
|
||||
new MessageTask(plugin, name, msg, service.getProperty(RegistrationSettings.MESSAGE_INTERVAL)));
|
||||
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(messageTask);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!Settings.getMySQLColumnGroup.isEmpty() && pAuth.getGroupId() == Settings.getNonActivatedGroup) {
|
||||
m.send(player, MessageKey.ACCOUNT_NOT_ACTIVATED);
|
||||
service.send(player, MessageKey.ACCOUNT_NOT_ACTIVATED);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -121,7 +107,7 @@ public class AsynchronousLogin {
|
||||
&& !plugin.getPermissionsManager().hasPermission(player, PlayerStatePermission.ALLOW_MULTIPLE_ACCOUNTS)
|
||||
&& !ip.equalsIgnoreCase("127.0.0.1") && !ip.equalsIgnoreCase("localhost")) {
|
||||
if (plugin.isLoggedIp(name, ip)) {
|
||||
m.send(player, MessageKey.ALREADY_LOGGED_IN_ERROR);
|
||||
service.send(player, MessageKey.ALREADY_LOGGED_IN_ERROR);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -134,7 +120,8 @@ public class AsynchronousLogin {
|
||||
return pAuth;
|
||||
}
|
||||
|
||||
public void process() {
|
||||
@Override
|
||||
public void run() {
|
||||
PlayerAuth pAuth = preAuth();
|
||||
if (pAuth == null || needsCaptcha()) {
|
||||
return;
|
||||
@@ -170,12 +157,12 @@ public class AsynchronousLogin {
|
||||
|
||||
player.setNoDamageTicks(0);
|
||||
if (!forceLogin)
|
||||
m.send(player, MessageKey.LOGIN_SUCCESS);
|
||||
service.send(player, MessageKey.LOGIN_SUCCESS);
|
||||
|
||||
displayOtherAccounts(auth);
|
||||
|
||||
if (Settings.recallEmail && (StringUtils.isEmpty(email) || "your@email.com".equalsIgnoreCase(email))) {
|
||||
m.send(player, MessageKey.ADD_EMAIL_MESSAGE);
|
||||
service.send(player, MessageKey.ADD_EMAIL_MESSAGE);
|
||||
}
|
||||
|
||||
if (!Settings.noConsoleSpam) {
|
||||
@@ -191,7 +178,8 @@ public class AsynchronousLogin {
|
||||
// task, we schedule it in the end
|
||||
// so that we can be sure, and have not to care if it might be
|
||||
// processed in other order.
|
||||
ProcessSyncPlayerLogin syncPlayerLogin = new ProcessSyncPlayerLogin(player, plugin, database, settings);
|
||||
ProcessSyncPlayerLogin syncPlayerLogin = new ProcessSyncPlayerLogin(
|
||||
player, plugin, database, service.getSettings());
|
||||
if (syncPlayerLogin.getLimbo() != null) {
|
||||
if (syncPlayerLogin.getLimbo().getTimeoutTaskId() != null) {
|
||||
syncPlayerLogin.getLimbo().getTimeoutTaskId().cancel();
|
||||
@@ -206,14 +194,13 @@ public class AsynchronousLogin {
|
||||
ConsoleLogger.info(realName + " used the wrong password");
|
||||
if (Settings.isKickOnWrongPasswordEnabled) {
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
player.kickPlayer(m.retrieveSingle(MessageKey.WRONG_PASSWORD));
|
||||
player.kickPlayer(service.retrieveSingleMessage(MessageKey.WRONG_PASSWORD));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
m.send(player, MessageKey.WRONG_PASSWORD);
|
||||
service.send(player, MessageKey.WRONG_PASSWORD);
|
||||
}
|
||||
} else {
|
||||
ConsoleLogger.showError("Player " + name + " wasn't online during login process, aborted... ");
|
||||
|
||||
@@ -7,7 +7,10 @@ import fr.xephi.authme.cache.limbo.LimboCache;
|
||||
import fr.xephi.authme.cache.limbo.LimboPlayer;
|
||||
import fr.xephi.authme.datasource.CacheDataSource;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.process.Process;
|
||||
import fr.xephi.authme.process.ProcessService;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.RestrictionSettings;
|
||||
import fr.xephi.authme.util.StringUtils;
|
||||
import fr.xephi.authme.util.Utils;
|
||||
import org.bukkit.Bukkit;
|
||||
@@ -15,7 +18,7 @@ import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
|
||||
public class AsynchronousQuit {
|
||||
public class AsynchronousQuit implements Process {
|
||||
|
||||
private final AuthMe plugin;
|
||||
private final DataSource database;
|
||||
@@ -23,26 +26,28 @@ public class AsynchronousQuit {
|
||||
private final String name;
|
||||
private boolean isOp = false;
|
||||
private boolean needToChange = false;
|
||||
private boolean isKick = false;
|
||||
private final boolean isKick;
|
||||
private final ProcessService service;
|
||||
|
||||
public AsynchronousQuit(Player p, AuthMe plugin, DataSource database,
|
||||
boolean isKick) {
|
||||
public AsynchronousQuit(Player p, AuthMe plugin, DataSource database, boolean isKick, ProcessService service) {
|
||||
this.player = p;
|
||||
this.plugin = plugin;
|
||||
this.database = database;
|
||||
this.name = p.getName().toLowerCase();
|
||||
this.isKick = isKick;
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
public void process() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (player == null || Utils.isUnrestricted(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
String ip = plugin.getIP(player);
|
||||
String ip = service.getIpAddressManager().getPlayerIp(player);
|
||||
|
||||
if (PlayerCache.getInstance().isAuthenticated(name)) {
|
||||
if (Settings.isSaveQuitLocationEnabled) {
|
||||
if (service.getProperty(RestrictionSettings.SAVE_QUIT_LOCATION)) {
|
||||
Location loc = player.getLocation();
|
||||
PlayerAuth auth = PlayerAuth.builder()
|
||||
.name(name).location(loc)
|
||||
@@ -76,7 +81,7 @@ public class AsynchronousQuit {
|
||||
|
||||
plugin.sessions.put(name, task);
|
||||
} else {
|
||||
//plugin is disable we canno schedule more tasks so run it directly here
|
||||
//plugin is disabled; we cannot schedule more tasks so run it directly here
|
||||
postLogout();
|
||||
}
|
||||
}
|
||||
@@ -85,7 +90,7 @@ public class AsynchronousQuit {
|
||||
database.setUnlogged(name);
|
||||
}
|
||||
|
||||
plugin.realIp.remove(name);
|
||||
service.getIpAddressManager().removeCache(player.getName());
|
||||
if (plugin.isEnabled()) {
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new ProcessSyncronousPlayerQuit(plugin, player, isOp, needToChange));
|
||||
}
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
package fr.xephi.authme.process.register;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.output.Messages;
|
||||
import fr.xephi.authme.permission.PlayerStatePermission;
|
||||
import fr.xephi.authme.process.Process;
|
||||
import fr.xephi.authme.process.ProcessService;
|
||||
import fr.xephi.authme.security.HashAlgorithm;
|
||||
import fr.xephi.authme.security.crypts.HashedPassword;
|
||||
import fr.xephi.authme.security.crypts.TwoFactor;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||
import fr.xephi.authme.util.StringUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class AsyncRegister {
|
||||
public class AsyncRegister implements Process {
|
||||
|
||||
private final Player player;
|
||||
private final String name;
|
||||
@@ -28,66 +28,65 @@ public class AsyncRegister {
|
||||
private final String email;
|
||||
private final AuthMe plugin;
|
||||
private final DataSource database;
|
||||
private final Messages m;
|
||||
private final NewSetting settings;
|
||||
private final ProcessService service;
|
||||
|
||||
public AsyncRegister(Player player, String password, String email, AuthMe plugin, DataSource data,
|
||||
NewSetting settings) {
|
||||
this.m = plugin.getMessages();
|
||||
ProcessService service) {
|
||||
this.player = player;
|
||||
this.password = password;
|
||||
this.name = player.getName().toLowerCase();
|
||||
this.email = email;
|
||||
this.plugin = plugin;
|
||||
this.database = data;
|
||||
this.ip = plugin.getIP(player);
|
||||
this.settings = settings;
|
||||
this.ip = service.getIpAddressManager().getPlayerIp(player);
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
private boolean preRegisterCheck() {
|
||||
String passLow = password.toLowerCase();
|
||||
if (PlayerCache.getInstance().isAuthenticated(name)) {
|
||||
m.send(player, MessageKey.ALREADY_LOGGED_IN_ERROR);
|
||||
service.send(player, MessageKey.ALREADY_LOGGED_IN_ERROR);
|
||||
return false;
|
||||
} else if (!Settings.isRegistrationEnabled) {
|
||||
m.send(player, MessageKey.REGISTRATION_DISABLED);
|
||||
service.send(player, MessageKey.REGISTRATION_DISABLED);
|
||||
return false;
|
||||
}
|
||||
|
||||
//check the password safety only if it's not a automatically generated password
|
||||
if (Settings.getPasswordHash != HashAlgorithm.TWO_FACTOR) {
|
||||
if (service.getProperty(SecuritySettings.PASSWORD_HASH) != HashAlgorithm.TWO_FACTOR) {
|
||||
if (!passLow.matches(Settings.getPassRegex)) {
|
||||
m.send(player, MessageKey.PASSWORD_MATCH_ERROR);
|
||||
service.send(player, MessageKey.PASSWORD_MATCH_ERROR);
|
||||
return false;
|
||||
} else if (passLow.equalsIgnoreCase(player.getName())) {
|
||||
m.send(player, MessageKey.PASSWORD_IS_USERNAME_ERROR);
|
||||
service.send(player, MessageKey.PASSWORD_IS_USERNAME_ERROR);
|
||||
return false;
|
||||
} else if (password.length() < Settings.getPasswordMinLen || password.length() > Settings.passwordMaxLength) {
|
||||
m.send(player, MessageKey.INVALID_PASSWORD_LENGTH);
|
||||
service.send(player, MessageKey.INVALID_PASSWORD_LENGTH);
|
||||
return false;
|
||||
} else if (!Settings.unsafePasswords.isEmpty() && Settings.unsafePasswords.contains(password.toLowerCase())) {
|
||||
m.send(player, MessageKey.PASSWORD_UNSAFE_ERROR);
|
||||
service.send(player, MessageKey.PASSWORD_UNSAFE_ERROR);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//check this in both possiblities so don't use 'else if'
|
||||
Integer size = 0;
|
||||
//check this in both possibilities so don't use 'else if'
|
||||
int size;
|
||||
if (database.isAuthAvailable(name)) {
|
||||
m.send(player, MessageKey.NAME_ALREADY_REGISTERED);
|
||||
service.send(player, MessageKey.NAME_ALREADY_REGISTERED);
|
||||
return false;
|
||||
} else if (Settings.getmaxRegPerIp > 0
|
||||
&& !plugin.getPermissionsManager().hasPermission(player, PlayerStatePermission.ALLOW_MULTIPLE_ACCOUNTS)
|
||||
&& !ip.equalsIgnoreCase("127.0.0.1")
|
||||
&& !ip.equalsIgnoreCase("localhost")
|
||||
&& (size = database.getAllAuthsByIp(ip).size()) >= Settings.getmaxRegPerIp) {
|
||||
m.send(player, MessageKey.MAX_REGISTER_EXCEEDED, size.toString());
|
||||
service.send(player, MessageKey.MAX_REGISTER_EXCEEDED, Integer.toString(size));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void process() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (preRegisterCheck()) {
|
||||
if (!StringUtils.isEmpty(email)) {
|
||||
emailRegister();
|
||||
@@ -98,11 +97,11 @@ public class AsyncRegister {
|
||||
}
|
||||
|
||||
private void emailRegister() {
|
||||
Integer size = 0;
|
||||
int size;
|
||||
if (Settings.getmaxRegPerEmail > 0
|
||||
&& !plugin.getPermissionsManager().hasPermission(player, PlayerStatePermission.ALLOW_MULTIPLE_ACCOUNTS)
|
||||
&& (size = database.countAuthsByEmail(email)) >= Settings.getmaxRegPerEmail) {
|
||||
m.send(player, MessageKey.MAX_REGISTER_EXCEEDED, size.toString());
|
||||
service.send(player, MessageKey.MAX_REGISTER_EXCEEDED, Integer.toString(size));
|
||||
return;
|
||||
}
|
||||
final HashedPassword hashedPassword = plugin.getPasswordSecurity().computeHash(password, name);
|
||||
@@ -116,13 +115,13 @@ public class AsyncRegister {
|
||||
.build();
|
||||
|
||||
if (!database.saveAuth(auth)) {
|
||||
m.send(player, MessageKey.ERROR);
|
||||
service.send(player, MessageKey.ERROR);
|
||||
return;
|
||||
}
|
||||
database.updateEmail(auth);
|
||||
database.updateSession(auth);
|
||||
plugin.mail.main(auth, password);
|
||||
ProcessSyncEmailRegister sync = new ProcessSyncEmailRegister(player, plugin);
|
||||
ProcessSyncEmailRegister sync = new ProcessSyncEmailRegister(player, service);
|
||||
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, sync);
|
||||
|
||||
}
|
||||
@@ -138,7 +137,7 @@ public class AsyncRegister {
|
||||
.build();
|
||||
|
||||
if (!database.saveAuth(auth)) {
|
||||
m.send(player, MessageKey.ERROR);
|
||||
service.send(player, MessageKey.ERROR);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -150,13 +149,13 @@ public class AsyncRegister {
|
||||
}
|
||||
|
||||
plugin.otherAccounts.addPlayer(player.getUniqueId());
|
||||
ProcessSyncPasswordRegister sync = new ProcessSyncPasswordRegister(player, plugin, settings);
|
||||
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, sync);
|
||||
ProcessSyncPasswordRegister sync = new ProcessSyncPasswordRegister(player, plugin, service);
|
||||
service.scheduleSyncDelayedTask(sync);
|
||||
|
||||
//give the user the secret code to setup their app code generation
|
||||
if (Settings.getPasswordHash == HashAlgorithm.TWO_FACTOR) {
|
||||
String qrCodeUrl = TwoFactor.getQRBarcodeURL(player.getName(), Bukkit.getIp(), hashedPassword.getHash());
|
||||
m.send(player, MessageKey.TWO_FACTOR_CREATE, hashedPassword.getHash(), qrCodeUrl);
|
||||
service.send(player, MessageKey.TWO_FACTOR_CREATE, hashedPassword.getHash(), qrCodeUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
package fr.xephi.authme.process.register;
|
||||
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.ConsoleLogger;
|
||||
import fr.xephi.authme.cache.limbo.LimboCache;
|
||||
import fr.xephi.authme.cache.limbo.LimboPlayer;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.output.Messages;
|
||||
import fr.xephi.authme.process.ProcessService;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.RegistrationSettings;
|
||||
import fr.xephi.authme.settings.properties.RestrictionSettings;
|
||||
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||
import fr.xephi.authme.task.MessageTask;
|
||||
import fr.xephi.authme.task.TimeoutTask;
|
||||
import fr.xephi.authme.util.Utils;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitScheduler;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
|
||||
/**
|
||||
@@ -20,51 +21,43 @@ public class ProcessSyncEmailRegister implements Runnable {
|
||||
|
||||
protected final Player player;
|
||||
protected final String name;
|
||||
private final AuthMe plugin;
|
||||
private final Messages m;
|
||||
private final ProcessService service;
|
||||
|
||||
/**
|
||||
* Constructor for ProcessSyncEmailRegister.
|
||||
*
|
||||
* @param player Player
|
||||
* @param plugin AuthMe
|
||||
* @param player The player to process an email registration for
|
||||
* @param service The process service
|
||||
*/
|
||||
public ProcessSyncEmailRegister(Player player, AuthMe plugin) {
|
||||
this.m = plugin.getMessages();
|
||||
public ProcessSyncEmailRegister(Player player, ProcessService service) {
|
||||
this.player = player;
|
||||
this.name = player.getName().toLowerCase();
|
||||
this.plugin = plugin;
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method run.
|
||||
*
|
||||
* @see java.lang.Runnable#run()
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
LimboPlayer limbo = LimboCache.getInstance().getLimboPlayer(name);
|
||||
if (!Settings.getRegisteredGroup.isEmpty()) {
|
||||
Utils.setGroup(player, Utils.GroupType.REGISTERED);
|
||||
}
|
||||
m.send(player, MessageKey.ACCOUNT_NOT_ACTIVATED);
|
||||
int time = Settings.getRegistrationTimeout * 20;
|
||||
int msgInterval = Settings.getWarnMessageInterval;
|
||||
|
||||
BukkitScheduler sched = plugin.getServer().getScheduler();
|
||||
service.send(player, MessageKey.ACCOUNT_NOT_ACTIVATED);
|
||||
int time = service.getProperty(RestrictionSettings.TIMEOUT) * 20;
|
||||
int msgInterval = service.getProperty(RegistrationSettings.MESSAGE_INTERVAL);
|
||||
|
||||
if (limbo != null) {
|
||||
if (time != 0) {
|
||||
BukkitTask id = sched.runTaskLater(plugin, new TimeoutTask(plugin, name, player), time);
|
||||
BukkitTask id = service.runTaskLater(new TimeoutTask(service.getAuthMe(), name, player), time);
|
||||
limbo.setTimeoutTaskId(id);
|
||||
}
|
||||
BukkitTask nwMsg = sched.runTask(plugin, new MessageTask(plugin, name, m.retrieve(MessageKey.LOGIN_MESSAGE), msgInterval));
|
||||
limbo.setMessageTaskId(nwMsg);
|
||||
BukkitTask messageTask = service.runTask(new MessageTask(
|
||||
service.getAuthMe(), name, service.retrieveMessage(MessageKey.LOGIN_MESSAGE), msgInterval));
|
||||
limbo.setMessageTaskId(messageTask);
|
||||
}
|
||||
|
||||
player.saveData();
|
||||
if (!Settings.noConsoleSpam) {
|
||||
ConsoleLogger.info(player.getName() + " registered " + plugin.getIP(player));
|
||||
if (!service.getProperty(SecuritySettings.REMOVE_SPAM_FROM_CONSOLE)) {
|
||||
ConsoleLogger.info(player.getName() + " registered " + service.getIpAddressManager().getPlayerIp(player));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,42 +9,34 @@ import fr.xephi.authme.cache.limbo.LimboPlayer;
|
||||
import fr.xephi.authme.events.LoginEvent;
|
||||
import fr.xephi.authme.events.RestoreInventoryEvent;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.output.Messages;
|
||||
import fr.xephi.authme.settings.NewSetting;
|
||||
import fr.xephi.authme.process.Process;
|
||||
import fr.xephi.authme.process.ProcessService;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.HooksSettings;
|
||||
import fr.xephi.authme.settings.properties.RegistrationSettings;
|
||||
import fr.xephi.authme.settings.properties.RestrictionSettings;
|
||||
import fr.xephi.authme.task.MessageTask;
|
||||
import fr.xephi.authme.task.TimeoutTask;
|
||||
import fr.xephi.authme.util.Utils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.bukkit.scheduler.BukkitScheduler;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class ProcessSyncPasswordRegister implements Runnable {
|
||||
public class ProcessSyncPasswordRegister implements Process {
|
||||
|
||||
protected final Player player;
|
||||
protected final String name;
|
||||
private final AuthMe plugin;
|
||||
private final Messages m;
|
||||
private final NewSetting settings;
|
||||
private final ProcessService service;
|
||||
|
||||
/**
|
||||
* Constructor for ProcessSyncPasswordRegister.
|
||||
*
|
||||
* @param player Player
|
||||
* @param plugin AuthMe
|
||||
* @param settings The plugin settings
|
||||
*/
|
||||
public ProcessSyncPasswordRegister(Player player, AuthMe plugin, NewSetting settings) {
|
||||
this.m = plugin.getMessages();
|
||||
public ProcessSyncPasswordRegister(Player player, AuthMe plugin, ProcessService service) {
|
||||
this.player = player;
|
||||
this.name = player.getName().toLowerCase();
|
||||
this.plugin = plugin;
|
||||
this.settings = settings;
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
private void sendBungeeMessage() {
|
||||
@@ -70,15 +62,14 @@ public class ProcessSyncPasswordRegister implements Runnable {
|
||||
Utils.teleportToSpawn(player);
|
||||
LimboCache cache = LimboCache.getInstance();
|
||||
cache.updateLimboPlayer(player);
|
||||
int delay = Settings.getRegistrationTimeout * 20;
|
||||
int interval = Settings.getWarnMessageInterval;
|
||||
BukkitScheduler sched = plugin.getServer().getScheduler();
|
||||
int delay = service.getProperty(RestrictionSettings.TIMEOUT) * 20;
|
||||
int interval = service.getProperty(RegistrationSettings.MESSAGE_INTERVAL);
|
||||
BukkitTask task;
|
||||
if (delay != 0) {
|
||||
task = sched.runTaskLater(plugin, new TimeoutTask(plugin, name, player), delay);
|
||||
task = service.runTaskLater(new TimeoutTask(service.getAuthMe(), name, player), delay);
|
||||
cache.getLimboPlayer(name).setTimeoutTaskId(task);
|
||||
}
|
||||
task = sched.runTask(plugin, new MessageTask(plugin, name, MessageKey.LOGIN_MESSAGE, interval));
|
||||
task = service.runTask(new MessageTask(plugin, name, MessageKey.LOGIN_MESSAGE, interval));
|
||||
cache.getLimboPlayer(name).setMessageTaskId(task);
|
||||
if (player.isInsideVehicle() && player.getVehicle() != null) {
|
||||
player.getVehicle().eject();
|
||||
@@ -106,13 +97,13 @@ public class ProcessSyncPasswordRegister implements Runnable {
|
||||
Utils.setGroup(player, Utils.GroupType.REGISTERED);
|
||||
}
|
||||
|
||||
m.send(player, MessageKey.REGISTER_SUCCESS);
|
||||
service.send(player, MessageKey.REGISTER_SUCCESS);
|
||||
|
||||
if (!Settings.getmailAccount.isEmpty()) {
|
||||
m.send(player, MessageKey.ADD_EMAIL_MESSAGE);
|
||||
service.send(player, MessageKey.ADD_EMAIL_MESSAGE);
|
||||
}
|
||||
|
||||
if (Settings.applyBlindEffect) {
|
||||
if (service.getProperty(RegistrationSettings.APPLY_BLIND_EFFECT)) {
|
||||
player.removePotionEffect(PotionEffectType.BLINDNESS);
|
||||
}
|
||||
|
||||
@@ -121,23 +112,23 @@ public class ProcessSyncPasswordRegister implements Runnable {
|
||||
player.saveData();
|
||||
|
||||
if (!Settings.noConsoleSpam) {
|
||||
ConsoleLogger.info(player.getName() + " registered " + plugin.getIP(player));
|
||||
ConsoleLogger.info(player.getName() + " registered " + service.getIpAddressManager().getPlayerIp(player));
|
||||
}
|
||||
|
||||
// Kick Player after Registration is enabled, kick the player
|
||||
if (Settings.forceRegKick) {
|
||||
player.kickPlayer(m.retrieveSingle(MessageKey.REGISTER_SUCCESS));
|
||||
player.kickPlayer(service.retrieveSingleMessage(MessageKey.REGISTER_SUCCESS));
|
||||
return;
|
||||
}
|
||||
|
||||
// Register is finish and player is logged, display welcome message
|
||||
if (Settings.useWelcomeMessage) {
|
||||
if (Settings.broadcastWelcomeMessage) {
|
||||
for (String s : settings.getWelcomeMessage()) {
|
||||
if (service.getProperty(RegistrationSettings.USE_WELCOME_MESSAGE)) {
|
||||
if (service.getProperty(RegistrationSettings.BROADCAST_WELCOME_MESSAGE)) {
|
||||
for (String s : service.getSettings().getWelcomeMessage()) {
|
||||
plugin.getServer().broadcastMessage(plugin.replaceAllInfo(s, player));
|
||||
}
|
||||
} else {
|
||||
for (String s : settings.getWelcomeMessage()) {
|
||||
for (String s : service.getSettings().getWelcomeMessage()) {
|
||||
player.sendMessage(plugin.replaceAllInfo(s, player));
|
||||
}
|
||||
}
|
||||
@@ -160,10 +151,10 @@ public class ProcessSyncPasswordRegister implements Runnable {
|
||||
}
|
||||
|
||||
private void sendTo() {
|
||||
if (!settings.getProperty(HooksSettings.BUNGEECORD_SERVER).isEmpty()) {
|
||||
if (!service.getProperty(HooksSettings.BUNGEECORD_SERVER).isEmpty()) {
|
||||
ByteArrayDataOutput out = ByteStreams.newDataOutput();
|
||||
out.writeUTF("Connect");
|
||||
out.writeUTF(settings.getProperty(HooksSettings.BUNGEECORD_SERVER));
|
||||
out.writeUTF(service.getProperty(HooksSettings.BUNGEECORD_SERVER));
|
||||
player.sendPluginMessage(plugin, "BungeeCord", out.toByteArray());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,8 +8,11 @@ import fr.xephi.authme.cache.backup.JsonCache;
|
||||
import fr.xephi.authme.cache.limbo.LimboCache;
|
||||
import fr.xephi.authme.cache.limbo.LimboPlayer;
|
||||
import fr.xephi.authme.output.MessageKey;
|
||||
import fr.xephi.authme.output.Messages;
|
||||
import fr.xephi.authme.process.Process;
|
||||
import fr.xephi.authme.process.ProcessService;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.RegistrationSettings;
|
||||
import fr.xephi.authme.settings.properties.RestrictionSettings;
|
||||
import fr.xephi.authme.task.MessageTask;
|
||||
import fr.xephi.authme.task.TimeoutTask;
|
||||
import fr.xephi.authme.util.Utils;
|
||||
@@ -20,15 +23,15 @@ import org.bukkit.potion.PotionEffectType;
|
||||
import org.bukkit.scheduler.BukkitScheduler;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
|
||||
public class AsynchronousUnregister {
|
||||
public class AsynchronousUnregister implements Process {
|
||||
|
||||
private final Player player;
|
||||
private final String name;
|
||||
private final String password;
|
||||
private final boolean force;
|
||||
private final AuthMe plugin;
|
||||
private final Messages m;
|
||||
private final JsonCache playerCache;
|
||||
private final ProcessService service;
|
||||
|
||||
/**
|
||||
* Constructor for AsynchronousUnregister.
|
||||
@@ -38,29 +41,27 @@ public class AsynchronousUnregister {
|
||||
* @param force boolean
|
||||
* @param plugin AuthMe
|
||||
*/
|
||||
public AsynchronousUnregister(Player player, String password, boolean force, AuthMe plugin) {
|
||||
this.m = plugin.getMessages();
|
||||
public AsynchronousUnregister(Player player, String password, boolean force, AuthMe plugin,
|
||||
ProcessService service) {
|
||||
this.player = player;
|
||||
this.name = player.getName().toLowerCase();
|
||||
this.password = password;
|
||||
this.force = force;
|
||||
this.plugin = plugin;
|
||||
this.playerCache = new JsonCache();
|
||||
this.service = service;
|
||||
}
|
||||
|
||||
protected String getIp() {
|
||||
return plugin.getIP(player);
|
||||
}
|
||||
|
||||
public void process() {
|
||||
@Override
|
||||
public void run() {
|
||||
PlayerAuth cachedAuth = PlayerCache.getInstance().getAuth(name);
|
||||
if (force || plugin.getPasswordSecurity().comparePassword(
|
||||
password, cachedAuth.getPassword(), player.getName())) {
|
||||
if (!plugin.getDataSource().removeAuth(name)) {
|
||||
m.send(player, MessageKey.ERROR);
|
||||
service.send(player, MessageKey.ERROR);
|
||||
return;
|
||||
}
|
||||
int timeOut = Settings.getRegistrationTimeout * 20;
|
||||
int timeOut = service.getProperty(RestrictionSettings.TIMEOUT) * 20;
|
||||
if (Settings.isForcedRegistrationEnabled) {
|
||||
Utils.teleportToSpawn(player);
|
||||
player.saveData();
|
||||
@@ -70,7 +71,7 @@ public class AsynchronousUnregister {
|
||||
}
|
||||
LimboCache.getInstance().addLimboPlayer(player);
|
||||
LimboPlayer limboPlayer = LimboCache.getInstance().getLimboPlayer(name);
|
||||
int interval = Settings.getWarnMessageInterval;
|
||||
int interval = service.getProperty(RegistrationSettings.MESSAGE_INTERVAL);
|
||||
BukkitScheduler scheduler = plugin.getServer().getScheduler();
|
||||
if (timeOut != 0) {
|
||||
BukkitTask id = scheduler.runTaskLater(plugin, new TimeoutTask(plugin, name, player), timeOut);
|
||||
@@ -78,7 +79,7 @@ public class AsynchronousUnregister {
|
||||
}
|
||||
limboPlayer.setMessageTaskId(scheduler.runTask(plugin,
|
||||
new MessageTask(plugin, name, MessageKey.REGISTER_MESSAGE, interval)));
|
||||
m.send(player, MessageKey.UNREGISTERED_SUCCESS);
|
||||
service.send(player, MessageKey.UNREGISTERED_SUCCESS);
|
||||
ConsoleLogger.info(player.getDisplayName() + " unregistered himself");
|
||||
return;
|
||||
}
|
||||
@@ -92,14 +93,14 @@ public class AsynchronousUnregister {
|
||||
playerCache.removeCache(player);
|
||||
}
|
||||
// Apply blind effect
|
||||
if (Settings.applyBlindEffect) {
|
||||
if (service.getProperty(RegistrationSettings.APPLY_BLIND_EFFECT)) {
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, timeOut, 2));
|
||||
}
|
||||
m.send(player, MessageKey.UNREGISTERED_SUCCESS);
|
||||
service.send(player, MessageKey.UNREGISTERED_SUCCESS);
|
||||
ConsoleLogger.info(player.getDisplayName() + " unregistered himself");
|
||||
Utils.teleportToSpawn(player);
|
||||
} else {
|
||||
m.send(player, MessageKey.WRONG_PASSWORD);
|
||||
service.send(player, MessageKey.WRONG_PASSWORD);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user