mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-09-07 04:38:03 +02:00
Replace m._ by a method call m.send, Java 8 in comming ...
This commit is contained in:
parent
5585db221f
commit
9ba90bfb97
@ -13,7 +13,6 @@ import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
|
||||
@ -122,8 +121,7 @@ public class AuthMe extends JavaPlugin {
|
||||
try {
|
||||
settings = new Settings(this);
|
||||
settings.loadConfigOptions();
|
||||
} catch (Exception e)
|
||||
{
|
||||
} catch (Exception e) {
|
||||
ConsoleLogger.showError("Can't load config file... Something goes wrong, for prevent security issues, server will shutdown");
|
||||
this.getServer().shutdown();
|
||||
return;
|
||||
@ -236,7 +234,7 @@ public class AuthMe extends JavaPlugin {
|
||||
if (Settings.isCachingEnabled) {
|
||||
database = new CacheDataSource(this, database);
|
||||
if (database instanceof CacheDataSource)
|
||||
((CacheDataSource)database).start();
|
||||
((CacheDataSource) database).start();
|
||||
}
|
||||
|
||||
dataManager = new DataManager(this, database);
|
||||
@ -729,7 +727,7 @@ public class AuthMe extends JavaPlugin {
|
||||
if (PlayerCache.getInstance().isAuthenticated(name)) {
|
||||
String email = database.getAuth(name).getEmail();
|
||||
if (email == null || email.isEmpty() || email.equalsIgnoreCase("your@email.com"))
|
||||
m._(player, "add_email");
|
||||
m.send(player, "add_email");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ public class AdminCommand implements CommandExecutor {
|
||||
}
|
||||
|
||||
if (!plugin.authmePermissible(sender, "authme.admin." + args[0].toLowerCase())) {
|
||||
m._(sender, "no_perm");
|
||||
m.send(sender, "no_perm");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -155,7 +155,7 @@ public class AdminCommand implements CommandExecutor {
|
||||
Settings.reloadConfigOptions(newConfig);
|
||||
m.reLoad();
|
||||
s.reLoad();
|
||||
m._(sender, "reload");
|
||||
m.send(sender, "reload");
|
||||
} else if (args[0].equalsIgnoreCase("lastlogin")) {
|
||||
if (args.length != 2) {
|
||||
sender.sendMessage("Usage: /authme lastlogin <playername>");
|
||||
@ -173,11 +173,11 @@ public class AdminCommand implements CommandExecutor {
|
||||
sender.sendMessage("[AuthMe] The player : " + player.getNickname() + " is unlogged since " + msg);
|
||||
sender.sendMessage("[AuthMe] LastPlayer IP : " + lastIP);
|
||||
} else {
|
||||
m._(sender, "unknown_user");
|
||||
m.send(sender, "unknown_user");
|
||||
return true;
|
||||
}
|
||||
} catch (NullPointerException e) {
|
||||
m._(sender, "unknown_user");
|
||||
m.send(sender, "unknown_user");
|
||||
return true;
|
||||
}
|
||||
} else if (args[0].equalsIgnoreCase("accounts")) {
|
||||
@ -276,7 +276,7 @@ public class AdminCommand implements CommandExecutor {
|
||||
try {
|
||||
String name = args[1].toLowerCase();
|
||||
if (database.isAuthAvailable(name)) {
|
||||
m._(sender, "user_regged");
|
||||
m.send(sender, "user_regged");
|
||||
return true;
|
||||
}
|
||||
String hash = PasswordSecurity.getHash(Settings.getPasswordHash, args[2], name);
|
||||
@ -285,14 +285,14 @@ public class AdminCommand implements CommandExecutor {
|
||||
auth.setSalt(PasswordSecurity.userSalt.get(name));
|
||||
else auth.setSalt("");
|
||||
if (!database.saveAuth(auth)) {
|
||||
m._(sender, "error");
|
||||
m.send(sender, "error");
|
||||
return true;
|
||||
}
|
||||
m._(sender, "registered");
|
||||
m.send(sender, "registered");
|
||||
ConsoleLogger.info(args[1] + " registered");
|
||||
} catch (NoSuchAlgorithmException ex) {
|
||||
ConsoleLogger.showError(ex.getMessage());
|
||||
m._(sender, "error");
|
||||
m.send(sender, "error");
|
||||
}
|
||||
return true;
|
||||
} else if (args[0].equalsIgnoreCase("getemail")) {
|
||||
@ -303,7 +303,7 @@ public class AdminCommand implements CommandExecutor {
|
||||
String playername = args[1].toLowerCase();
|
||||
PlayerAuth getAuth = database.getAuth(playername);
|
||||
if (getAuth == null) {
|
||||
m._(sender, "unknown_user");
|
||||
m.send(sender, "unknown_user");
|
||||
return true;
|
||||
}
|
||||
sender.sendMessage("[AuthMe] " + args[1] + " email : " + getAuth.getEmail());
|
||||
@ -316,12 +316,12 @@ public class AdminCommand implements CommandExecutor {
|
||||
String playername = args[1].toLowerCase();
|
||||
PlayerAuth getAuth = database.getAuth(playername);
|
||||
if (getAuth == null) {
|
||||
m._(sender, "unknown_user");
|
||||
m.send(sender, "unknown_user");
|
||||
return true;
|
||||
}
|
||||
getAuth.setEmail(args[2]);
|
||||
if (!database.updateEmail(getAuth)) {
|
||||
m._(sender, "error");
|
||||
m.send(sender, "error");
|
||||
return true;
|
||||
}
|
||||
if (PlayerCache.getInstance().getAuth(playername) != null)
|
||||
@ -409,7 +409,7 @@ public class AdminCommand implements CommandExecutor {
|
||||
auth = database.getAuth(name);
|
||||
}
|
||||
if (auth == null) {
|
||||
m._(sender, "unknown_user");
|
||||
m.send(sender, "unknown_user");
|
||||
return true;
|
||||
}
|
||||
auth.setHash(hash);
|
||||
@ -418,14 +418,14 @@ public class AdminCommand implements CommandExecutor {
|
||||
database.updateSalt(auth);
|
||||
}
|
||||
if (!database.updatePassword(auth)) {
|
||||
m._(sender, "error");
|
||||
m.send(sender, "error");
|
||||
return true;
|
||||
}
|
||||
sender.sendMessage("pwd_changed");
|
||||
ConsoleLogger.info(args[1] + "'s password changed");
|
||||
} catch (NoSuchAlgorithmException ex) {
|
||||
ConsoleLogger.showError(ex.getMessage());
|
||||
m._(sender, "error");
|
||||
m.send(sender, "error");
|
||||
}
|
||||
return true;
|
||||
} else if (args[0].equalsIgnoreCase("unregister") || args[0].equalsIgnoreCase("unreg") || args[0].equalsIgnoreCase("del")) {
|
||||
@ -435,11 +435,11 @@ public class AdminCommand implements CommandExecutor {
|
||||
}
|
||||
String name = args[1].toLowerCase();
|
||||
if (!database.isAuthAvailable(name)) {
|
||||
m._(sender, "user_unknown");
|
||||
m.send(sender, "user_unknown");
|
||||
return true;
|
||||
}
|
||||
if (!database.removeAuth(name)) {
|
||||
m._(sender, "error");
|
||||
m.send(sender, "error");
|
||||
return true;
|
||||
}
|
||||
Player target = Bukkit.getPlayer(name);
|
||||
@ -463,17 +463,17 @@ public class AdminCommand implements CommandExecutor {
|
||||
BukkitTask id = sched.runTaskLater(plugin, new TimeoutTask(plugin, name), delay);
|
||||
LimboCache.getInstance().getLimboPlayer(name).setTimeoutTaskId(id);
|
||||
}
|
||||
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(sched.runTask(plugin, new MessageTask(plugin, name, m._("reg_msg"), interval)));
|
||||
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(sched.runTask(plugin, new MessageTask(plugin, name, m.send("reg_msg"), interval)));
|
||||
if (Settings.applyBlindEffect)
|
||||
target.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, Settings.getRegistrationTimeout * 20, 2));
|
||||
m._(target, "unregistered");
|
||||
m.send(target, "unregistered");
|
||||
} else {
|
||||
// Player isn't online, do nothing else
|
||||
}
|
||||
} else {
|
||||
// Player does not exist, do nothing else
|
||||
}
|
||||
m._(sender, "unregistered");
|
||||
m.send(sender, "unregistered");
|
||||
ConsoleLogger.info(args[1] + " unregistered");
|
||||
return true;
|
||||
} else if (args[0].equalsIgnoreCase("purgelastpos")) {
|
||||
@ -540,7 +540,7 @@ public class AdminCommand implements CommandExecutor {
|
||||
}
|
||||
PlayerAuth auth = database.getAuth(args[1]);
|
||||
if (auth == null) {
|
||||
m._(sender, "unknown_user");
|
||||
m.send(sender, "unknown_user");
|
||||
return true;
|
||||
}
|
||||
auth.setQuitLocX(0D);
|
||||
|
@ -33,34 +33,34 @@ public class CaptchaCommand implements CommandExecutor {
|
||||
String name = player.getName().toLowerCase();
|
||||
|
||||
if (args.length == 0) {
|
||||
m._(player, "usage_captcha");
|
||||
m.send(player, "usage_captcha");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (PlayerCache.getInstance().isAuthenticated(name)) {
|
||||
m._(player, "logged_in");
|
||||
m.send(player, "logged_in");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!plugin.authmePermissible(player, "authme." + label.toLowerCase())) {
|
||||
m._(player, "no_perm");
|
||||
m.send(player, "no_perm");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!Settings.useCaptcha) {
|
||||
m._(player, "usage_log");
|
||||
m.send(player, "usage_log");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!plugin.cap.containsKey(name)) {
|
||||
m._(player, "usage_log");
|
||||
m.send(player, "usage_log");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Settings.useCaptcha && !args[0].equals(plugin.cap.get(name))) {
|
||||
plugin.cap.remove(name);
|
||||
plugin.cap.put(name, rdm.nextString());
|
||||
for (String s : m._("wrong_captcha")) {
|
||||
for (String s : m.send("wrong_captcha")) {
|
||||
player.sendMessage(s.replace("THE_CAPTCHA", plugin.cap.get(name)));
|
||||
}
|
||||
return true;
|
||||
@ -70,8 +70,8 @@ public class CaptchaCommand implements CommandExecutor {
|
||||
plugin.cap.remove(name);
|
||||
} catch (NullPointerException npe) {
|
||||
}
|
||||
m._(player, "valid_captcha");
|
||||
m._(player, "login_msg");
|
||||
m.send(player, "valid_captcha");
|
||||
m.send(player, "login_msg");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -37,19 +37,19 @@ public class ChangePasswordCommand implements CommandExecutor {
|
||||
}
|
||||
|
||||
if (!plugin.authmePermissible(sender, "authme." + label.toLowerCase())) {
|
||||
m._(sender, "no_perm");
|
||||
m.send(sender, "no_perm");
|
||||
return true;
|
||||
}
|
||||
|
||||
Player player = (Player) sender;
|
||||
String name = player.getName().toLowerCase();
|
||||
if (!PlayerCache.getInstance().isAuthenticated(name)) {
|
||||
m._(player, "not_logged_in");
|
||||
m.send(player, "not_logged_in");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args.length != 2) {
|
||||
m._(player, "usage_changepassword");
|
||||
m.send(player, "usage_changepassword");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -63,22 +63,22 @@ public class ChangePasswordCommand implements CommandExecutor {
|
||||
auth.setSalt(PasswordSecurity.userSalt.get(name));
|
||||
else auth.setSalt("");
|
||||
if (!database.updatePassword(auth)) {
|
||||
m._(player, "error");
|
||||
m.send(player, "error");
|
||||
return true;
|
||||
}
|
||||
database.updateSalt(auth);
|
||||
PlayerCache.getInstance().updatePlayer(auth);
|
||||
m._(player, "pwd_changed");
|
||||
m.send(player, "pwd_changed");
|
||||
ConsoleLogger.info(player.getName() + " changed his password");
|
||||
if (plugin.notifications != null) {
|
||||
plugin.notifications.showNotification(new Notification("[AuthMe] " + player.getName() + " change his password!"));
|
||||
}
|
||||
} else {
|
||||
m._(player, "wrong_pwd");
|
||||
m.send(player, "wrong_pwd");
|
||||
}
|
||||
} catch (NoSuchAlgorithmException ex) {
|
||||
ConsoleLogger.showError(ex.getMessage());
|
||||
m._(sender, "error");
|
||||
m.send(sender, "error");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ public class ConverterCommand implements CommandExecutor {
|
||||
}
|
||||
|
||||
if (!plugin.authmePermissible(sender, "authme.admin.converter")) {
|
||||
m._(sender, "no_perm");
|
||||
m.send(sender, "no_perm");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ public class ConverterCommand implements CommandExecutor {
|
||||
|
||||
ConvertType type = ConvertType.fromName(args[0]);
|
||||
if (type == null) {
|
||||
m._(sender, "error");
|
||||
m.send(sender, "error");
|
||||
return true;
|
||||
}
|
||||
Converter converter = null;
|
||||
@ -82,7 +82,7 @@ public class ConverterCommand implements CommandExecutor {
|
||||
break;
|
||||
}
|
||||
if (converter == null) {
|
||||
m._(sender, "error");
|
||||
m.send(sender, "error");
|
||||
return true;
|
||||
}
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, converter);
|
||||
|
@ -41,7 +41,7 @@ public class EmailCommand implements CommandExecutor {
|
||||
}
|
||||
|
||||
if (!plugin.authmePermissible(sender, "authme." + label.toLowerCase())) {
|
||||
m._(sender, "no_perm");
|
||||
m.send(sender, "no_perm");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -49,105 +49,105 @@ public class EmailCommand implements CommandExecutor {
|
||||
String name = player.getName();
|
||||
|
||||
if (args.length == 0) {
|
||||
m._(player, "usage_email_add");
|
||||
m._(player, "usage_email_change");
|
||||
m._(player, "usage_email_recovery");
|
||||
m.send(player, "usage_email_add");
|
||||
m.send(player, "usage_email_change");
|
||||
m.send(player, "usage_email_recovery");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args[0].equalsIgnoreCase("add")) {
|
||||
if (args.length != 3) {
|
||||
m._(player, "usage_email_add");
|
||||
m.send(player, "usage_email_add");
|
||||
return true;
|
||||
}
|
||||
if (Settings.getmaxRegPerEmail > 0) {
|
||||
if (!plugin.authmePermissible(sender, "authme.allow2accounts") && data.getAllAuthsByEmail(args[1]).size() >= Settings.getmaxRegPerEmail) {
|
||||
m._(player, "max_reg");
|
||||
m.send(player, "max_reg");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (args[1].equals(args[2]) && PlayerCache.getInstance().isAuthenticated(name)) {
|
||||
PlayerAuth auth = PlayerCache.getInstance().getAuth(name);
|
||||
if (auth.getEmail() == null || (!auth.getEmail().equals("your@email.com") && !auth.getEmail().isEmpty())) {
|
||||
m._(player, "usage_email_change");
|
||||
m.send(player, "usage_email_change");
|
||||
return true;
|
||||
}
|
||||
if (!Settings.isEmailCorrect(args[1])) {
|
||||
m._(player, "email_invalid");
|
||||
m.send(player, "email_invalid");
|
||||
return true;
|
||||
}
|
||||
auth.setEmail(args[1]);
|
||||
if (!data.updateEmail(auth)) {
|
||||
m._(player, "error");
|
||||
m.send(player, "error");
|
||||
return true;
|
||||
}
|
||||
PlayerCache.getInstance().updatePlayer(auth);
|
||||
m._(player, "email_added");
|
||||
m.send(player, "email_added");
|
||||
player.sendMessage(auth.getEmail());
|
||||
} else if (PlayerCache.getInstance().isAuthenticated(name)) {
|
||||
m._(player, "email_confirm");
|
||||
m.send(player, "email_confirm");
|
||||
} else {
|
||||
if (!data.isAuthAvailable(name)) {
|
||||
m._(player, "login_msg");
|
||||
m.send(player, "login_msg");
|
||||
} else {
|
||||
m._(player, "reg_email_msg");
|
||||
m.send(player, "reg_email_msg");
|
||||
}
|
||||
}
|
||||
} else if (args[0].equalsIgnoreCase("change")) {
|
||||
if (args.length != 3) {
|
||||
m._(player, "usage_email_change");
|
||||
m.send(player, "usage_email_change");
|
||||
return true;
|
||||
}
|
||||
if (Settings.getmaxRegPerEmail > 0) {
|
||||
if (!plugin.authmePermissible(sender, "authme.allow2accounts") && data.getAllAuthsByEmail(args[2]).size() >= Settings.getmaxRegPerEmail) {
|
||||
m._(player, "max_reg");
|
||||
m.send(player, "max_reg");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (PlayerCache.getInstance().isAuthenticated(name)) {
|
||||
PlayerAuth auth = PlayerCache.getInstance().getAuth(name);
|
||||
if (auth.getEmail() == null || auth.getEmail().equals("your@email.com") || auth.getEmail().isEmpty()) {
|
||||
m._(player, "usage_email_add");
|
||||
m.send(player, "usage_email_add");
|
||||
return true;
|
||||
}
|
||||
if (!args[1].equals(auth.getEmail())) {
|
||||
m._(player, "old_email_invalid");
|
||||
m.send(player, "old_email_invalid");
|
||||
return true;
|
||||
}
|
||||
if (!Settings.isEmailCorrect(args[2])) {
|
||||
m._(player, "new_email_invalid");
|
||||
m.send(player, "new_email_invalid");
|
||||
return true;
|
||||
}
|
||||
auth.setEmail(args[2]);
|
||||
if (!data.updateEmail(auth)) {
|
||||
m._(player, "error");
|
||||
m.send(player, "error");
|
||||
return true;
|
||||
}
|
||||
PlayerCache.getInstance().updatePlayer(auth);
|
||||
m._(player, "email_changed");
|
||||
player.sendMessage(m._("email_defined") + auth.getEmail());
|
||||
m.send(player, "email_changed");
|
||||
player.sendMessage(m.send("email_defined") + auth.getEmail());
|
||||
} else if (PlayerCache.getInstance().isAuthenticated(name)) {
|
||||
m._(player, "email_confirm");
|
||||
m.send(player, "email_confirm");
|
||||
} else {
|
||||
if (!data.isAuthAvailable(name)) {
|
||||
m._(player, "login_msg");
|
||||
m.send(player, "login_msg");
|
||||
} else {
|
||||
m._(player, "reg_email_msg");
|
||||
m.send(player, "reg_email_msg");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (args[0].equalsIgnoreCase("recovery")) {
|
||||
if (args.length != 2) {
|
||||
m._(player, "usage_email_recovery");
|
||||
m.send(player, "usage_email_recovery");
|
||||
return true;
|
||||
}
|
||||
if (plugin.mail == null) {
|
||||
m._(player, "error");
|
||||
m.send(player, "error");
|
||||
return true;
|
||||
}
|
||||
if (data.isAuthAvailable(name)) {
|
||||
if (PlayerCache.getInstance().isAuthenticated(name)) {
|
||||
m._(player, "logged_in");
|
||||
m.send(player, "logged_in");
|
||||
return true;
|
||||
}
|
||||
try {
|
||||
@ -160,16 +160,16 @@ public class EmailCommand implements CommandExecutor {
|
||||
} else if (data.isAuthAvailable(name)) {
|
||||
auth = data.getAuth(name);
|
||||
} else {
|
||||
m._(player, "unknown_user");
|
||||
m.send(player, "unknown_user");
|
||||
return true;
|
||||
}
|
||||
if (Settings.getmailAccount.equals("") || Settings.getmailAccount.isEmpty()) {
|
||||
m._(player, "error");
|
||||
m.send(player, "error");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!args[1].equalsIgnoreCase(auth.getEmail()) || args[1].equalsIgnoreCase("your@email.com") || auth.getEmail().equalsIgnoreCase("your@email.com")) {
|
||||
m._(player, "email_invalid");
|
||||
m.send(player, "email_invalid");
|
||||
return true;
|
||||
}
|
||||
final String finalhashnew = hashnew;
|
||||
@ -188,16 +188,16 @@ public class EmailCommand implements CommandExecutor {
|
||||
});
|
||||
}
|
||||
plugin.mail.main(auth, thePass);
|
||||
m._(player, "email_send");
|
||||
m.send(player, "email_send");
|
||||
} catch (NoSuchAlgorithmException ex) {
|
||||
ConsoleLogger.showError(ex.getMessage());
|
||||
m._(sender, "error");
|
||||
m.send(sender, "error");
|
||||
} catch (NoClassDefFoundError ncdfe) {
|
||||
ConsoleLogger.showError(ncdfe.getMessage());
|
||||
m._(sender, "error");
|
||||
m.send(sender, "error");
|
||||
}
|
||||
} else {
|
||||
m._(player, "reg_email_msg");
|
||||
m.send(player, "reg_email_msg");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -27,12 +27,12 @@ public class LoginCommand implements CommandExecutor {
|
||||
final Player player = (Player) sender;
|
||||
|
||||
if (args.length == 0) {
|
||||
m._(player, "usage_log");
|
||||
m.send(player, "usage_log");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!plugin.authmePermissible(player, "authme." + label.toLowerCase())) {
|
||||
m._(player, "no_perm");
|
||||
m.send(player, "no_perm");
|
||||
return true;
|
||||
}
|
||||
plugin.management.performLogin(player, args[0], false);
|
||||
|
@ -52,7 +52,7 @@ public class LogoutCommand implements CommandExecutor {
|
||||
}
|
||||
|
||||
if (!plugin.authmePermissible(sender, "authme." + label.toLowerCase())) {
|
||||
m._(sender, "no_perm");
|
||||
m.send(sender, "no_perm");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ public class LogoutCommand implements CommandExecutor {
|
||||
String name = player.getName().toLowerCase();
|
||||
|
||||
if (!PlayerCache.getInstance().isAuthenticated(name)) {
|
||||
m._(player, "not_logged_in");
|
||||
m.send(player, "not_logged_in");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -106,7 +106,7 @@ public class LogoutCommand implements CommandExecutor {
|
||||
BukkitTask id = sched.runTaskLater(plugin, new TimeoutTask(plugin, name), delay);
|
||||
LimboCache.getInstance().getLimboPlayer(name).setTimeoutTaskId(id);
|
||||
}
|
||||
BukkitTask msgT = sched.runTask(plugin, new MessageTask(plugin, name, m._("login_msg"), interval));
|
||||
BukkitTask msgT = sched.runTask(plugin, new MessageTask(plugin, name, m.send("login_msg"), interval));
|
||||
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(msgT);
|
||||
try {
|
||||
if (player.isInsideVehicle())
|
||||
@ -125,7 +125,7 @@ public class LogoutCommand implements CommandExecutor {
|
||||
Bukkit.getServer().getPluginManager().callEvent(new LogoutEvent(player));
|
||||
}
|
||||
});
|
||||
m._(player, "logout");
|
||||
m.send(player, "logout");
|
||||
ConsoleLogger.info(player.getDisplayName() + " logged out");
|
||||
if (plugin.notifications != null) {
|
||||
plugin.notifications.showNotification(new Notification("[AuthMe] " + player.getName() + " logged out!"));
|
||||
|
@ -29,7 +29,7 @@ public class PasspartuCommand implements CommandExecutor {
|
||||
String[] args) {
|
||||
|
||||
if (!plugin.authmePermissible(sender, "authme." + label.toLowerCase())) {
|
||||
m._(sender, "no_perm");
|
||||
m.send(sender, "no_perm");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -29,27 +29,27 @@ public class RegisterCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
if (args.length == 0) {
|
||||
m._(sender, "usage_reg");
|
||||
m.send(sender, "usage_reg");
|
||||
}
|
||||
if (!plugin.authmePermissible(sender, "authme." + label.toLowerCase())) {
|
||||
m._(sender, "no_perm");
|
||||
m.send(sender, "no_perm");
|
||||
return true;
|
||||
}
|
||||
final Player player = (Player) sender;
|
||||
if (Settings.emailRegistration && !Settings.getmailAccount.isEmpty()) {
|
||||
if (Settings.doubleEmailCheck) {
|
||||
if (args.length < 2) {
|
||||
m._(player, "usage_reg");
|
||||
m.send(player, "usage_reg");
|
||||
return true;
|
||||
}
|
||||
if (!args[0].equals(args[1])) {
|
||||
m._(player, "usage_reg");
|
||||
m.send(player, "usage_reg");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
final String email = args[0];
|
||||
if (!Settings.isEmailCorrect(email)) {
|
||||
m._(player, "email_invalid");
|
||||
m.send(player, "email_invalid");
|
||||
return true;
|
||||
}
|
||||
RandomString rand = new RandomString(Settings.getRecoveryPassLength);
|
||||
@ -58,12 +58,12 @@ public class RegisterCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
if (args.length == 0 || (Settings.getEnablePasswordVerifier && args.length < 2)) {
|
||||
m._(player, "usage_reg");
|
||||
m.send(player, "usage_reg");
|
||||
return true;
|
||||
}
|
||||
if (args.length > 1 && Settings.getEnablePasswordVerifier)
|
||||
if (!args[0].equals(args[1])) {
|
||||
m._(player, "password_error");
|
||||
m.send(player, "password_error");
|
||||
return true;
|
||||
}
|
||||
plugin.management.performRegister(player, args[0], "");
|
||||
|
@ -51,7 +51,7 @@ public class UnregisterCommand implements CommandExecutor {
|
||||
}
|
||||
|
||||
if (!plugin.authmePermissible(sender, "authme." + label.toLowerCase())) {
|
||||
m._(sender, "no_perm");
|
||||
m.send(sender, "no_perm");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -59,12 +59,12 @@ public class UnregisterCommand implements CommandExecutor {
|
||||
String name = player.getName().toLowerCase();
|
||||
|
||||
if (!PlayerCache.getInstance().isAuthenticated(name)) {
|
||||
m._(player, "not_logged_in");
|
||||
m.send(player, "not_logged_in");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args.length != 1) {
|
||||
m._(player, "usage_unreg");
|
||||
m.send(player, "usage_unreg");
|
||||
return true;
|
||||
}
|
||||
try {
|
||||
@ -96,8 +96,8 @@ public class UnregisterCommand implements CommandExecutor {
|
||||
BukkitTask id = sched.runTaskLater(plugin, new TimeoutTask(plugin, name), delay);
|
||||
LimboCache.getInstance().getLimboPlayer(name).setTimeoutTaskId(id);
|
||||
}
|
||||
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(sched.runTask(plugin, new MessageTask(plugin, name, m._("reg_msg"), interval)));
|
||||
m._(player, "unregistered");
|
||||
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(sched.runTask(plugin, new MessageTask(plugin, name, m.send("reg_msg"), interval)));
|
||||
m.send(player, "unregistered");
|
||||
ConsoleLogger.info(player.getDisplayName() + " unregistered himself");
|
||||
if (plugin.notifications != null) {
|
||||
plugin.notifications.showNotification(new Notification("[AuthMe] " + player.getName() + " unregistered himself!"));
|
||||
@ -115,7 +115,7 @@ public class UnregisterCommand implements CommandExecutor {
|
||||
}
|
||||
if (Settings.applyBlindEffect)
|
||||
player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, Settings.getRegistrationTimeout * 20, 2));
|
||||
m._(player, "unregistered");
|
||||
m.send(player, "unregistered");
|
||||
ConsoleLogger.info(player.getDisplayName() + " unregistered himself");
|
||||
if (plugin.notifications != null) {
|
||||
plugin.notifications.showNotification(new Notification("[AuthMe] " + player.getName() + " unregistered himself!"));
|
||||
@ -133,7 +133,7 @@ public class UnregisterCommand implements CommandExecutor {
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
m._(player, "wrong_pwd");
|
||||
m.send(player, "wrong_pwd");
|
||||
}
|
||||
} catch (NoSuchAlgorithmException ex) {
|
||||
ConsoleLogger.showError(ex.getMessage());
|
||||
|
@ -44,7 +44,7 @@ public class SqlToFlat implements Converter {
|
||||
return;
|
||||
} catch (Exception ex) {
|
||||
ConsoleLogger.showError(ex.getMessage());
|
||||
Messages.getInstance()._(sender, "error");
|
||||
Messages.getInstance().send(sender, "error");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -132,16 +132,16 @@ public class AuthMePlayerListener implements Listener {
|
||||
String cmd = event.getMessage().split(" ")[0];
|
||||
|
||||
if (data.isAuthAvailable(name)) {
|
||||
m._(player, "login_msg");
|
||||
m.send(player, "login_msg");
|
||||
} else {
|
||||
if (!Settings.isForcedRegistrationEnabled) {
|
||||
return;
|
||||
}
|
||||
if (Settings.emailRegistration) {
|
||||
m._(player, "reg_email_msg");
|
||||
m.send(player, "reg_email_msg");
|
||||
return;
|
||||
} else {
|
||||
m._(player, "reg_msg");
|
||||
m.send(player, "reg_msg");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -169,16 +169,16 @@ public class AuthMePlayerListener implements Listener {
|
||||
String cmd = event.getMessage().split(" ")[0];
|
||||
|
||||
if (data.isAuthAvailable(name)) {
|
||||
m._(player, "login_msg");
|
||||
m.send(player, "login_msg");
|
||||
} else {
|
||||
if (!Settings.isForcedRegistrationEnabled) {
|
||||
return;
|
||||
}
|
||||
if (Settings.emailRegistration) {
|
||||
m._(player, "reg_email_msg");
|
||||
m.send(player, "reg_email_msg");
|
||||
return;
|
||||
} else {
|
||||
m._(player, "reg_msg");
|
||||
m.send(player, "reg_msg");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -206,16 +206,16 @@ public class AuthMePlayerListener implements Listener {
|
||||
String cmd = event.getMessage().split(" ")[0];
|
||||
|
||||
if (data.isAuthAvailable(name)) {
|
||||
m._(player, "login_msg");
|
||||
m.send(player, "login_msg");
|
||||
} else {
|
||||
if (!Settings.isForcedRegistrationEnabled) {
|
||||
return;
|
||||
}
|
||||
if (Settings.emailRegistration) {
|
||||
m._(player, "reg_email_msg");
|
||||
m.send(player, "reg_email_msg");
|
||||
return;
|
||||
} else {
|
||||
m._(player, "reg_msg");
|
||||
m.send(player, "reg_msg");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -243,16 +243,16 @@ public class AuthMePlayerListener implements Listener {
|
||||
String cmd = event.getMessage().split(" ")[0];
|
||||
|
||||
if (data.isAuthAvailable(name)) {
|
||||
m._(player, "login_msg");
|
||||
m.send(player, "login_msg");
|
||||
} else {
|
||||
if (!Settings.isForcedRegistrationEnabled) {
|
||||
return;
|
||||
}
|
||||
if (Settings.emailRegistration) {
|
||||
m._(player, "reg_email_msg");
|
||||
m.send(player, "reg_email_msg");
|
||||
return;
|
||||
} else {
|
||||
m._(player, "reg_msg");
|
||||
m.send(player, "reg_msg");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -281,16 +281,16 @@ public class AuthMePlayerListener implements Listener {
|
||||
String cmd = event.getMessage().split(" ")[0];
|
||||
|
||||
if (data.isAuthAvailable(name)) {
|
||||
m._(player, "login_msg");
|
||||
m.send(player, "login_msg");
|
||||
} else {
|
||||
if (!Settings.isForcedRegistrationEnabled) {
|
||||
return;
|
||||
}
|
||||
if (Settings.emailRegistration) {
|
||||
m._(player, "reg_email_msg");
|
||||
m.send(player, "reg_email_msg");
|
||||
return;
|
||||
} else {
|
||||
m._(player, "reg_msg");
|
||||
m.send(player, "reg_msg");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -318,15 +318,15 @@ public class AuthMePlayerListener implements Listener {
|
||||
String cmd = event.getMessage().split(" ")[0];
|
||||
|
||||
if (data.isAuthAvailable(name)) {
|
||||
m._(player, "login_msg");
|
||||
m.send(player, "login_msg");
|
||||
} else {
|
||||
if (!Settings.isForcedRegistrationEnabled) {
|
||||
return;
|
||||
}
|
||||
if (Settings.emailRegistration) {
|
||||
m._(player, "reg_email_msg");
|
||||
m.send(player, "reg_email_msg");
|
||||
} else {
|
||||
m._(player, "reg_msg");
|
||||
m.send(player, "reg_msg");
|
||||
}
|
||||
}
|
||||
|
||||
@ -405,7 +405,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
if (!Settings.countriesBlacklist.isEmpty()) {
|
||||
String code = plugin.getCountryCode(event.getAddress().getHostAddress());
|
||||
if (((code == null) || (Settings.countriesBlacklist.contains(code) && !API.isRegistered(name))) && !plugin.authmePermissible(player, "authme.bypassantibot")) {
|
||||
event.setKickMessage(m._("country_banned")[0]);
|
||||
event.setKickMessage(m.send("country_banned")[0]);
|
||||
event.setLoginResult(AsyncPlayerPreLoginEvent.Result.KICK_OTHER);
|
||||
return;
|
||||
}
|
||||
@ -413,7 +413,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
if (Settings.enableProtection && !Settings.countries.isEmpty()) {
|
||||
String code = plugin.getCountryCode(event.getAddress().getHostAddress());
|
||||
if (((code == null) || (!Settings.countries.contains(code) && !API.isRegistered(name))) && !plugin.authmePermissible(player, "authme.bypassantibot")) {
|
||||
event.setKickMessage(m._("country_banned")[0]);
|
||||
event.setKickMessage(m.send("country_banned")[0]);
|
||||
event.setLoginResult(AsyncPlayerPreLoginEvent.Result.KICK_OTHER);
|
||||
return;
|
||||
}
|
||||
@ -421,14 +421,14 @@ public class AuthMePlayerListener implements Listener {
|
||||
|
||||
if (Settings.isKickNonRegisteredEnabled) {
|
||||
if (!data.isAuthAvailable(name)) {
|
||||
event.setKickMessage(m._("reg_only")[0]);
|
||||
event.setKickMessage(m.send("reg_only")[0]);
|
||||
event.setLoginResult(AsyncPlayerPreLoginEvent.Result.KICK_OTHER);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (player.isOnline() && Settings.isForceSingleSessionEnabled) {
|
||||
event.setKickMessage(m._("same_nick")[0]);
|
||||
event.setKickMessage(m.send("same_nick")[0]);
|
||||
event.setLoginResult(AsyncPlayerPreLoginEvent.Result.KICK_OTHER);
|
||||
return;
|
||||
}
|
||||
@ -446,7 +446,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
// joined with same nick of online player
|
||||
if (player.isOnline() && Settings.isForceSingleSessionEnabled) {
|
||||
LimboPlayer limbo = LimboCache.getInstance().getLimboPlayer(player.getName().toLowerCase());
|
||||
event.setKickMessage(m._("same_nick")[0]);
|
||||
event.setKickMessage(m.send("same_nick")[0]);
|
||||
event.setLoginResult(AsyncPlayerPreLoginEvent.Result.KICK_OTHER);
|
||||
if (PlayerCache.getInstance().isAuthenticated(player.getName().toLowerCase())) {
|
||||
utils.addNormal(player, limbo.getGroup());
|
||||
@ -461,14 +461,14 @@ public class AuthMePlayerListener implements Listener {
|
||||
|
||||
if (name.length() > max || name.length() < min) {
|
||||
|
||||
event.setKickMessage(m._("name_len")[0]);
|
||||
event.setKickMessage(m.send("name_len")[0]);
|
||||
event.setLoginResult(AsyncPlayerPreLoginEvent.Result.KICK_OTHER);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
if (!player.getName().matches(regex) || name.equals("Player")) {
|
||||
try {
|
||||
event.setKickMessage(m._("regex")[0].replace("REG_EX", regex));
|
||||
event.setKickMessage(m.send("regex")[0].replace("REG_EX", regex));
|
||||
event.setLoginResult(AsyncPlayerPreLoginEvent.Result.KICK_OTHER);
|
||||
} catch (Exception exc) {
|
||||
event.setKickMessage("allowed char : " + regex);
|
||||
@ -483,7 +483,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
event.setKickMessage(m._("regex")[0].replace("REG_EX", regex));
|
||||
event.setKickMessage(m.send("regex")[0].replace("REG_EX", regex));
|
||||
event.setLoginResult(AsyncPlayerPreLoginEvent.Result.KICK_OTHER);
|
||||
} catch (Exception exc) {
|
||||
event.setKickMessage("allowed char : " + regex);
|
||||
@ -511,7 +511,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
if (player.isBanned())
|
||||
return;
|
||||
if (!plugin.authmePermissible(player, "authme.vip")) {
|
||||
event.setKickMessage(m._("kick_fullserver")[0]);
|
||||
event.setKickMessage(m.send("kick_fullserver")[0]);
|
||||
event.setLoginResult(AsyncPlayerPreLoginEvent.Result.KICK_FULL);
|
||||
return;
|
||||
}
|
||||
@ -522,12 +522,12 @@ public class AuthMePlayerListener implements Listener {
|
||||
} else {
|
||||
final Player pl = plugin.generateKickPlayer(plugin.getServer().getOnlinePlayers());
|
||||
if (pl != null) {
|
||||
pl.kickPlayer(m._("kick_forvip")[0]);
|
||||
pl.kickPlayer(m.send("kick_forvip")[0]);
|
||||
event.allow();
|
||||
return;
|
||||
} else {
|
||||
ConsoleLogger.info("The player " + player.getName() + " wants to join, but the server is full");
|
||||
event.setKickMessage(m._("kick_fullserver")[0]);
|
||||
event.setKickMessage(m.send("kick_fullserver")[0]);
|
||||
event.setLoginResult(AsyncPlayerPreLoginEvent.Result.KICK_FULL);
|
||||
return;
|
||||
}
|
||||
@ -541,7 +541,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
return;
|
||||
if (antibot.keySet().size() > Settings.antiBotSensibility) {
|
||||
plugin.switchAntiBotMod(true);
|
||||
for (String s : m._("antibot_auto_enabled"))
|
||||
for (String s : m.send("antibot_auto_enabled"))
|
||||
Bukkit.broadcastMessage(s);
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
|
||||
|
||||
@ -550,7 +550,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
if (plugin.antibotMod) {
|
||||
plugin.switchAntiBotMod(false);
|
||||
antibot.clear();
|
||||
for (String s : m._("antibot_auto_disabled"))
|
||||
for (String s : m.send("antibot_auto_disabled"))
|
||||
Bukkit.broadcastMessage(s.replace("%m", "" + Settings.antiBotDuration));
|
||||
}
|
||||
}
|
||||
@ -622,7 +622,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
PlayerCache.getInstance().addPlayer(auth);
|
||||
data.setLogged(name);
|
||||
}
|
||||
m._(player, "valid_session");
|
||||
m.send(player, "valid_session");
|
||||
// Restore Permission Group
|
||||
utils.setGroup(player, Utils.groupType.LOGGEDIN);
|
||||
plugin.getServer().getPluginManager().callEvent(new SessionEvent(auth, true));
|
||||
@ -632,7 +632,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
causeByAuthMe.put(name, true);
|
||||
player.setGameMode(gM);
|
||||
causeByAuthMe.put(name, false);
|
||||
player.kickPlayer(m._("unvalid_session")[0]);
|
||||
player.kickPlayer(m.send("unvalid_session")[0]);
|
||||
return;
|
||||
} else if (auth.getNickname().equalsIgnoreCase(name)) {
|
||||
if (Settings.isForceSurvivalModeEnabled && !Settings.forceOnlyAfterLogin) {
|
||||
@ -648,7 +648,7 @@ public class AuthMePlayerListener implements Listener {
|
||||
causeByAuthMe.put(name, true);
|
||||
player.setGameMode(gM);
|
||||
causeByAuthMe.put(name, false);
|
||||
player.kickPlayer(m._("unvalid_session")[0]);
|
||||
player.kickPlayer(m.send("unvalid_session")[0]);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
@ -724,9 +724,9 @@ public class AuthMePlayerListener implements Listener {
|
||||
}
|
||||
String[] msg;
|
||||
if (Settings.emailRegistration) {
|
||||
msg = data.isAuthAvailable(name) ? m._("login_msg") : m._("reg_email_msg");
|
||||
msg = data.isAuthAvailable(name) ? m.send("login_msg") : m.send("reg_email_msg");
|
||||
} else {
|
||||
msg = data.isAuthAvailable(name) ? m._("login_msg") : m._("reg_msg");
|
||||
msg = data.isAuthAvailable(name) ? m.send("login_msg") : m.send("reg_msg");
|
||||
}
|
||||
int time = Settings.getRegistrationTimeout * 20;
|
||||
int msgInterval = Settings.getWarnMessageInterval;
|
||||
@ -771,14 +771,14 @@ public class AuthMePlayerListener implements Listener {
|
||||
return;
|
||||
Block b = player.getLocation().getBlock();
|
||||
if (b.getType() == Material.PORTAL || b.getType() == Material.ENDER_PORTAL || b.getType() == Material.LAVA || b.getType() == Material.STATIONARY_LAVA) {
|
||||
m._(player, "unsafe_spawn");
|
||||
m.send(player, "unsafe_spawn");
|
||||
if (spawnLoc.getWorld() != null)
|
||||
player.teleport(spawnLoc);
|
||||
return;
|
||||
}
|
||||
Block c = player.getLocation().add(0D, 1D, 0D).getBlock();
|
||||
if (c.getType() == Material.PORTAL || c.getType() == Material.ENDER_PORTAL || c.getType() == Material.LAVA || c.getType() == Material.STATIONARY_LAVA) {
|
||||
m._(player, "unsafe_spawn");
|
||||
m.send(player, "unsafe_spawn");
|
||||
if (spawnLoc.getWorld() != null)
|
||||
player.teleport(spawnLoc);
|
||||
return;
|
||||
|
@ -29,12 +29,12 @@ public class AuthMeServerListener implements Listener {
|
||||
return;
|
||||
if (!Settings.countriesBlacklist.isEmpty()) {
|
||||
if (Settings.countriesBlacklist.contains(plugin.getCountryCode(event.getAddress().getHostAddress())))
|
||||
event.setMotd(m._("country_banned")[0]);
|
||||
event.setMotd(m.send("country_banned")[0]);
|
||||
}
|
||||
if (Settings.countries.contains(plugin.getCountryCode(event.getAddress().getHostAddress()))) {
|
||||
event.setMotd(plugin.getServer().getMotd());
|
||||
} else {
|
||||
event.setMotd(m._("country_banned")[0]);
|
||||
event.setMotd(m.send("country_banned")[0]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ public class AsyncronousLogin {
|
||||
}
|
||||
if (plugin.captcha.containsKey(name) && plugin.captcha.get(name) >= Settings.maxLoginTry) {
|
||||
plugin.cap.put(name, rdm.nextString());
|
||||
for (String s : m._("usage_captcha")) {
|
||||
for (String s : m.send("usage_captcha")) {
|
||||
player.sendMessage(s.replace("THE_CAPTCHA", plugin.cap.get(name)).replace("<theCaptcha>", plugin.cap.get(name)));
|
||||
}
|
||||
return true;
|
||||
@ -81,18 +81,18 @@ public class AsyncronousLogin {
|
||||
*/
|
||||
protected PlayerAuth preAuth() {
|
||||
if (PlayerCache.getInstance().isAuthenticated(name)) {
|
||||
m._(player, "logged_in");
|
||||
m.send(player, "logged_in");
|
||||
return null;
|
||||
}
|
||||
if (!database.isAuthAvailable(name)) {
|
||||
m._(player, "user_unknown");
|
||||
m.send(player, "user_unknown");
|
||||
if (LimboCache.getInstance().hasLimboPlayer(name)) {
|
||||
LimboCache.getInstance().getLimboPlayer(name).getMessageTaskId().cancel();
|
||||
String[] msg;
|
||||
if (Settings.emailRegistration) {
|
||||
msg = m._("reg_email_msg");
|
||||
msg = m.send("reg_email_msg");
|
||||
} else {
|
||||
msg = m._("reg_msg");
|
||||
msg = m.send("reg_msg");
|
||||
}
|
||||
BukkitTask msgT = Bukkit.getScheduler().runTask(plugin, new MessageTask(plugin, name, msg, Settings.getWarnMessageInterval));
|
||||
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(msgT);
|
||||
@ -101,17 +101,17 @@ public class AsyncronousLogin {
|
||||
}
|
||||
if (Settings.getMaxLoginPerIp > 0 && !plugin.authmePermissible(player, "authme.allow2accounts") && !getIP().equalsIgnoreCase("127.0.0.1") && !getIP().equalsIgnoreCase("localhost")) {
|
||||
if (plugin.isLoggedIp(name, getIP())) {
|
||||
m._(player, "logged_in");
|
||||
m.send(player, "logged_in");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
PlayerAuth pAuth = database.getAuth(name);
|
||||
if (pAuth == null) {
|
||||
m._(player, "user_unknown");
|
||||
m.send(player, "user_unknown");
|
||||
return null;
|
||||
}
|
||||
if (!Settings.getMySQLColumnGroup.isEmpty() && pAuth.getGroupId() == Settings.getNonActivatedGroup) {
|
||||
m._(player, "vb_nonActiv");
|
||||
m.send(player, "vb_nonActiv");
|
||||
return null;
|
||||
}
|
||||
return pAuth;
|
||||
@ -130,7 +130,7 @@ public class AsyncronousLogin {
|
||||
passwordVerified = PasswordSecurity.comparePasswordWithHash(password, hash, realName);
|
||||
} catch (Exception ex) {
|
||||
ConsoleLogger.showError(ex.getMessage());
|
||||
m._(player, "error");
|
||||
m.send(player, "error");
|
||||
return;
|
||||
}
|
||||
if (passwordVerified && player.isOnline()) {
|
||||
@ -147,7 +147,7 @@ public class AsyncronousLogin {
|
||||
}
|
||||
|
||||
player.setNoDamageTicks(0);
|
||||
m._(player, "login");
|
||||
m.send(player, "login");
|
||||
|
||||
displayOtherAccounts(auth, player);
|
||||
|
||||
@ -184,11 +184,11 @@ public class AsyncronousLogin {
|
||||
if (AuthMePlayerListener.gameMode != null && AuthMePlayerListener.gameMode.containsKey(name)) {
|
||||
player.setGameMode(AuthMePlayerListener.gameMode.get(name));
|
||||
}
|
||||
player.kickPlayer(m._("wrong_pwd")[0]);
|
||||
player.kickPlayer(m.send("wrong_pwd")[0]);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
m._(player, "wrong_pwd");
|
||||
m.send(player, "wrong_pwd");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
|
@ -42,23 +42,23 @@ public class AsyncronousRegister {
|
||||
|
||||
protected void preRegister() {
|
||||
if (PlayerCache.getInstance().isAuthenticated(name)) {
|
||||
m._(player, "logged_in");
|
||||
m.send(player, "logged_in");
|
||||
allowRegister = false;
|
||||
}
|
||||
|
||||
if (!Settings.isRegistrationEnabled) {
|
||||
m._(player, "reg_disabled");
|
||||
m.send(player, "reg_disabled");
|
||||
allowRegister = false;
|
||||
}
|
||||
|
||||
String lowpass = password.toLowerCase();
|
||||
if ((lowpass.contains("delete") || lowpass.contains("where") || lowpass.contains("insert") || lowpass.contains("modify") || lowpass.contains("from") || lowpass.contains("select") || lowpass.contains(";") || lowpass.contains("null")) || !lowpass.matches(Settings.getPassRegex)) {
|
||||
m._(player, "password_error");
|
||||
m.send(player, "password_error");
|
||||
allowRegister = false;
|
||||
}
|
||||
|
||||
if (database.isAuthAvailable(name)) {
|
||||
m._(player, "user_regged");
|
||||
m.send(player, "user_regged");
|
||||
if (plugin.pllog.getStringList("players").contains(name)) {
|
||||
plugin.pllog.getStringList("players").remove(name);
|
||||
}
|
||||
@ -67,7 +67,7 @@ public class AsyncronousRegister {
|
||||
|
||||
if (Settings.getmaxRegPerIp > 0) {
|
||||
if (!plugin.authmePermissible(player, "authme.allow2accounts") && database.getAllAuthsByIp(getIp()).size() >= Settings.getmaxRegPerIp && !getIp().equalsIgnoreCase("127.0.0.1") && !getIp().equalsIgnoreCase("localhost")) {
|
||||
m._(player, "max_reg");
|
||||
m.send(player, "max_reg");
|
||||
allowRegister = false;
|
||||
}
|
||||
}
|
||||
@ -81,7 +81,7 @@ public class AsyncronousRegister {
|
||||
if (!email.isEmpty() && email != "") {
|
||||
if (Settings.getmaxRegPerEmail > 0) {
|
||||
if (!plugin.authmePermissible(player, "authme.allow2accounts") && database.getAllAuthsByEmail(email).size() >= Settings.getmaxRegPerEmail) {
|
||||
m._(player, "max_reg");
|
||||
m.send(player, "max_reg");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -94,7 +94,7 @@ public class AsyncronousRegister {
|
||||
protected void emailRegister() {
|
||||
if (Settings.getmaxRegPerEmail > 0) {
|
||||
if (!plugin.authmePermissible(player, "authme.allow2accounts") && database.getAllAuthsByEmail(email).size() >= Settings.getmaxRegPerEmail) {
|
||||
m._(player, "max_reg");
|
||||
m.send(player, "max_reg");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -104,7 +104,7 @@ public class AsyncronousRegister {
|
||||
auth = new PlayerAuth(name, hashnew, getIp(), 0, (int) player.getLocation().getX(), (int) player.getLocation().getY(), (int) player.getLocation().getZ(), player.getLocation().getWorld().getName(), email);
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
ConsoleLogger.showError(e.getMessage());
|
||||
m._(player, "error");
|
||||
m.send(player, "error");
|
||||
return;
|
||||
}
|
||||
if (PasswordSecurity.userSalt.containsKey(name)) {
|
||||
@ -121,12 +121,12 @@ public class AsyncronousRegister {
|
||||
|
||||
protected void passwordRegister() {
|
||||
if (password.length() < Settings.getPasswordMinLen || password.length() > Settings.passwordMaxLength) {
|
||||
m._(player, "pass_len");
|
||||
m.send(player, "pass_len");
|
||||
return;
|
||||
}
|
||||
if (!Settings.unsafePasswords.isEmpty()) {
|
||||
if (Settings.unsafePasswords.contains(password.toLowerCase())) {
|
||||
m._(player, "password_error");
|
||||
m.send(player, "password_error");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -136,7 +136,7 @@ public class AsyncronousRegister {
|
||||
hash = PasswordSecurity.getHash(Settings.getPasswordHash, password, name);
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
ConsoleLogger.showError(e.getMessage());
|
||||
m._(player, "error");
|
||||
m.send(player, "error");
|
||||
return;
|
||||
}
|
||||
if (Settings.getMySQLColumnSalt.isEmpty() && !PasswordSecurity.userSalt.containsKey(name)) {
|
||||
@ -145,7 +145,7 @@ public class AsyncronousRegister {
|
||||
auth = new PlayerAuth(name, hash, PasswordSecurity.userSalt.get(name), getIp(), new Date().getTime());
|
||||
}
|
||||
if (!database.saveAuth(auth)) {
|
||||
m._(player, "error");
|
||||
m.send(player, "error");
|
||||
return;
|
||||
}
|
||||
if (!Settings.forceRegLogin) {
|
||||
|
@ -33,7 +33,7 @@ public class ProcessSyncronousEmailRegister implements Runnable {
|
||||
if (!Settings.getRegisteredGroup.isEmpty()) {
|
||||
Utils.getInstance().setGroup(player, Utils.groupType.REGISTERED);
|
||||
}
|
||||
m._(player, "vb_nonActiv");
|
||||
m.send(player, "vb_nonActiv");
|
||||
int time = Settings.getRegistrationTimeout * 20;
|
||||
int msgInterval = Settings.getWarnMessageInterval;
|
||||
if (time != 0) {
|
||||
@ -43,7 +43,7 @@ public class ProcessSyncronousEmailRegister implements Runnable {
|
||||
}
|
||||
|
||||
LimboCache.getInstance().getLimboPlayer(name).getMessageTaskId().cancel();
|
||||
BukkitTask nwMsg = Bukkit.getScheduler().runTask(plugin, new MessageTask(plugin, name, m._("login_msg"), msgInterval));
|
||||
BukkitTask nwMsg = Bukkit.getScheduler().runTask(plugin, new MessageTask(plugin, name, m.send("login_msg"), msgInterval));
|
||||
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(nwMsg);
|
||||
player.saveData();
|
||||
if (!Settings.noConsoleSpam)
|
||||
|
@ -70,7 +70,7 @@ public class ProcessSyncronousPasswordRegister implements Runnable {
|
||||
BukkitTask id = sched.runTaskLater(plugin, new TimeoutTask(plugin, name), delay);
|
||||
LimboCache.getInstance().getLimboPlayer(name).setTimeoutTaskId(id);
|
||||
}
|
||||
BukkitTask msgT = sched.runTask(plugin, new MessageTask(plugin, name, m._("login_msg"), interval));
|
||||
BukkitTask msgT = sched.runTask(plugin, new MessageTask(plugin, name, m.send("login_msg"), interval));
|
||||
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(msgT);
|
||||
try {
|
||||
plugin.pllog.removePlayer(name);
|
||||
@ -104,9 +104,9 @@ public class ProcessSyncronousPasswordRegister implements Runnable {
|
||||
if (!Settings.getRegisteredGroup.isEmpty()) {
|
||||
Utils.getInstance().setGroup(player, Utils.groupType.REGISTERED);
|
||||
}
|
||||
m._(player, "registered");
|
||||
m.send(player, "registered");
|
||||
if (!Settings.getmailAccount.isEmpty())
|
||||
m._(player, "add_email");
|
||||
m.send(player, "add_email");
|
||||
if (player.getGameMode() != GameMode.CREATIVE && !Settings.isMovementAllowed) {
|
||||
player.setAllowFlight(false);
|
||||
player.setFlying(false);
|
||||
@ -125,7 +125,7 @@ public class ProcessSyncronousPasswordRegister implements Runnable {
|
||||
|
||||
// Kick Player after Registration is enabled, kick the player
|
||||
if (Settings.forceRegKick) {
|
||||
player.kickPlayer(m._("registered")[0]);
|
||||
player.kickPlayer(m.send("registered")[0]);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ public class Messages extends CustomConfiguration {
|
||||
this.save();
|
||||
}
|
||||
|
||||
public void _(CommandSender sender, String msg) {
|
||||
public void send(CommandSender sender, String msg) {
|
||||
String loc = (String) this.get(msg);
|
||||
if (loc == null) {
|
||||
loc = "Error with Translation files; Please contact the admin for verify or update translation";
|
||||
@ -79,7 +79,7 @@ public class Messages extends CustomConfiguration {
|
||||
}
|
||||
}
|
||||
|
||||
public String[] _(String msg) {
|
||||
public String[] send(String msg) {
|
||||
int i = ((String) this.get(msg)).split("&n").length;
|
||||
String[] loc = new String[i];
|
||||
int a;
|
||||
|
@ -50,7 +50,7 @@ public class TimeoutTask implements Runnable {
|
||||
player.setGameMode(gm);
|
||||
ConsoleLogger.info("Set " + player.getName() + " to gamemode: " + gm.name());
|
||||
}
|
||||
player.kickPlayer(m._("timeout")[0]);
|
||||
player.kickPlayer(m.send("timeout")[0]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user