Update 3.3.4
//Changes 3.3.4:// * Add an isLogged column in mySQL * Add a maxLoginPerIp * Add a maxJoinPerIp * Add a way to force kick after register * Add a way to force login after register * Update session correctly * Fix Change Email command * Fix some perm problems * Fix some problems with email sending * Remove some dead code * Add a way to control spawn priority, by default , in order, it is : authme,essentials,multiverse,default
This commit is contained in:
@@ -179,11 +179,11 @@ public class AdminCommand implements CommandExecutor {
|
||||
sender.sendMessage("[AuthMe] The player : " + player.getNickname() + " is unlogged since " + msg);
|
||||
sender.sendMessage("[AuthMe] LastPlayer IP : " + lastIP);
|
||||
} else {
|
||||
sender.sendMessage("This player does not exist");
|
||||
m._(sender, "unknown_user");
|
||||
return true;
|
||||
}
|
||||
} catch (NullPointerException e) {
|
||||
sender.sendMessage("This player does not exist");
|
||||
m._(sender, "unknown_user");
|
||||
return true;
|
||||
}
|
||||
} else if (args[0].equalsIgnoreCase("accounts")) {
|
||||
@@ -344,7 +344,7 @@ public class AdminCommand implements CommandExecutor {
|
||||
String playername = args[1].toLowerCase();
|
||||
PlayerAuth getAuth = database.getAuth(playername);
|
||||
if (getAuth == null) {
|
||||
sender.sendMessage("This player does not exist");
|
||||
m._(sender, "unknown_user");
|
||||
return true;
|
||||
}
|
||||
sender.sendMessage("[AuthMe] " + args[1] + " email : " + getAuth.getEmail());
|
||||
@@ -357,7 +357,7 @@ public class AdminCommand implements CommandExecutor {
|
||||
String playername = args[1].toLowerCase();
|
||||
PlayerAuth getAuth = database.getAuth(playername);
|
||||
if (getAuth == null) {
|
||||
sender.sendMessage("This player does not exist");
|
||||
m._(sender, "unknown_user");
|
||||
return true;
|
||||
}
|
||||
getAuth.setEmail(args[2]);
|
||||
@@ -506,7 +506,7 @@ public class AdminCommand implements CommandExecutor {
|
||||
if (target != null) {
|
||||
if (target.isOnline()) {
|
||||
if (Settings.isTeleportToSpawnEnabled) {
|
||||
Location spawn = plugin.getSpawnLocation(name, target.getWorld());
|
||||
Location spawn = plugin.getSpawnLocation(target, target.getWorld());
|
||||
SpawnTeleportEvent tpEvent = new SpawnTeleportEvent(target, target.getLocation(), spawn, false);
|
||||
plugin.getServer().getPluginManager().callEvent(tpEvent);
|
||||
if(!tpEvent.isCancelled()) {
|
||||
|
||||
@@ -92,9 +92,13 @@ public class EmailCommand implements CommandExecutor {
|
||||
m._(player, "reg_email_msg");
|
||||
}
|
||||
}
|
||||
} else if(args[0].equalsIgnoreCase("change") && args.length == 3 ) {
|
||||
} else if(args[0].equalsIgnoreCase("change")) {
|
||||
if (args.length != 3) {
|
||||
m._(player, "usage_email_change");
|
||||
return true;
|
||||
}
|
||||
if(Settings.getmaxRegPerEmail > 0) {
|
||||
if (!plugin.authmePermissible(sender, "authme.allow2accounts") && data.getAllAuthsByEmail(args[1]).size() >= Settings.getmaxRegPerEmail) {
|
||||
if (!plugin.authmePermissible(sender, "authme.allow2accounts") && data.getAllAuthsByEmail(args[2]).size() >= Settings.getmaxRegPerEmail) {
|
||||
m._(player, "max_reg");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ import fr.xephi.authme.cache.limbo.LimboCache;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.events.AuthMeTeleportEvent;
|
||||
import fr.xephi.authme.settings.Messages;
|
||||
import fr.xephi.authme.settings.PlayersLogs;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.task.MessageTask;
|
||||
import fr.xephi.authme.task.TimeoutTask;
|
||||
@@ -30,7 +29,6 @@ import fr.xephi.authme.task.TimeoutTask;
|
||||
public class LogoutCommand implements CommandExecutor {
|
||||
|
||||
private Messages m = Messages.getInstance();
|
||||
private PlayersLogs pllog = PlayersLogs.getInstance();
|
||||
private AuthMe plugin;
|
||||
private DataSource database;
|
||||
private Utils utils = Utils.getInstance();
|
||||
@@ -61,7 +59,6 @@ public class LogoutCommand implements CommandExecutor {
|
||||
}
|
||||
|
||||
PlayerAuth auth = PlayerCache.getInstance().getAuth(name);
|
||||
auth.setIp("198.18.0.1");
|
||||
database.updateSession(auth);
|
||||
auth.setQuitLocX(player.getLocation().getX());
|
||||
auth.setQuitLocY(player.getLocation().getY());
|
||||
@@ -70,9 +67,10 @@ public class LogoutCommand implements CommandExecutor {
|
||||
database.updateQuitLoc(auth);
|
||||
|
||||
PlayerCache.getInstance().removePlayer(name);
|
||||
database.setUnlogged(name);
|
||||
|
||||
if (Settings.isTeleportToSpawnEnabled) {
|
||||
Location spawnLoc = plugin.getSpawnLocation(name, player.getWorld());
|
||||
Location spawnLoc = plugin.getSpawnLocation(player, player.getWorld());
|
||||
AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(player, spawnLoc);
|
||||
plugin.getServer().getPluginManager().callEvent(tpEvent);
|
||||
if(!tpEvent.isCancelled()) {
|
||||
@@ -104,10 +102,6 @@ public class LogoutCommand implements CommandExecutor {
|
||||
int msgT = sched.scheduleSyncDelayedTask(plugin, new MessageTask(plugin, name, m._("login_msg"), interval));
|
||||
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(msgT);
|
||||
try {
|
||||
if (PlayersLogs.players.contains(player.getName())) {
|
||||
PlayersLogs.players.remove(player.getName());
|
||||
pllog.save();
|
||||
}
|
||||
if (player.isInsideVehicle())
|
||||
player.getVehicle().eject();
|
||||
} catch (NullPointerException npe) {
|
||||
|
||||
@@ -23,7 +23,6 @@ import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.events.SpawnTeleportEvent;
|
||||
import fr.xephi.authme.security.PasswordSecurity;
|
||||
import fr.xephi.authme.settings.Messages;
|
||||
import fr.xephi.authme.settings.PlayersLogs;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.task.MessageTask;
|
||||
import fr.xephi.authme.task.TimeoutTask;
|
||||
@@ -32,7 +31,6 @@ import fr.xephi.authme.task.TimeoutTask;
|
||||
public class UnregisterCommand implements CommandExecutor {
|
||||
|
||||
private Messages m = Messages.getInstance();
|
||||
private PlayersLogs pllog = PlayersLogs.getInstance();
|
||||
public AuthMe plugin;
|
||||
private DataSource database;
|
||||
private FileCache playerCache = new FileCache();
|
||||
@@ -73,7 +71,7 @@ public class UnregisterCommand implements CommandExecutor {
|
||||
}
|
||||
if(Settings.isForcedRegistrationEnabled) {
|
||||
if (Settings.isTeleportToSpawnEnabled) {
|
||||
Location spawn = plugin.getSpawnLocation(name, player.getWorld());
|
||||
Location spawn = plugin.getSpawnLocation(player, player.getWorld());
|
||||
SpawnTeleportEvent tpEvent = new SpawnTeleportEvent(player, player.getLocation(), spawn, false);
|
||||
plugin.getServer().getPluginManager().callEvent(tpEvent);
|
||||
if(!tpEvent.isCancelled()) {
|
||||
@@ -110,17 +108,13 @@ public class UnregisterCommand implements CommandExecutor {
|
||||
if(playerCache.doesCacheExist(name)) {
|
||||
playerCache.removeCache(name);
|
||||
}
|
||||
if (PlayersLogs.players.contains(player.getName())) {
|
||||
PlayersLogs.players.remove(player.getName());
|
||||
pllog.save();
|
||||
}
|
||||
m._(player, "unregistered");
|
||||
ConsoleLogger.info(player.getDisplayName() + " unregistered himself");
|
||||
if(plugin.notifications != null) {
|
||||
plugin.notifications.showNotification(new Notification("[AuthMe] " + player.getName() + " unregistered himself!"));
|
||||
}
|
||||
if (Settings.isTeleportToSpawnEnabled) {
|
||||
Location spawn = plugin.getSpawnLocation(name, player.getWorld());
|
||||
Location spawn = plugin.getSpawnLocation(player, player.getWorld());
|
||||
SpawnTeleportEvent tpEvent = new SpawnTeleportEvent(player, player.getLocation(), spawn, false);
|
||||
plugin.getServer().getPluginManager().callEvent(tpEvent);
|
||||
if(!tpEvent.isCancelled()) {
|
||||
|
||||
Reference in New Issue
Block a user