mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-24 03:05:17 +01:00
Try this way to fix quitloc
This commit is contained in:
parent
84a1227afd
commit
4ecbd7b526
@ -46,16 +46,13 @@ public class AsyncronousQuit {
|
||||
return;
|
||||
}
|
||||
|
||||
Location loc = player.getLocation();
|
||||
String ip = plugin.getIP(player);
|
||||
|
||||
if (PlayerCache.getInstance().isAuthenticated(name) && !player.isDead()) {
|
||||
if (Settings.isSaveQuitLocationEnabled && database.isAuthAvailable(name)) {
|
||||
final PlayerAuth auth = new PlayerAuth(name, loc.getX(), loc.getY(), loc.getZ(), loc.getWorld().getName(), player.getName());
|
||||
try {
|
||||
database.updateQuitLoc(auth);
|
||||
} catch (NullPointerException npe) {
|
||||
}
|
||||
Location loc = player.getLocation();
|
||||
PlayerAuth auth = new PlayerAuth(name, loc.getX(), loc.getY(), loc.getZ(), loc.getWorld().getName(), player.getName());
|
||||
database.updateQuitLoc(auth);
|
||||
}
|
||||
PlayerAuth auth = new PlayerAuth(name, ip, System.currentTimeMillis(), player.getName());
|
||||
database.updateSession(auth);
|
||||
@ -78,19 +75,19 @@ public class AsyncronousQuit {
|
||||
LimboCache.getInstance().deleteLimboPlayer(name);
|
||||
}
|
||||
if (Settings.isSessionsEnabled && !isKick) {
|
||||
if (Settings.getSessionTimeout != 0){
|
||||
BukkitTask task = plugin.getServer().getScheduler().runTaskLaterAsynchronously(plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
PlayerCache.getInstance().removePlayer(name);
|
||||
if (database.isLogged(name))
|
||||
database.setUnlogged(name);
|
||||
plugin.sessions.remove(name);
|
||||
}
|
||||
|
||||
}, Settings.getSessionTimeout * 20 * 60);
|
||||
plugin.sessions.put(name, task);
|
||||
if (Settings.getSessionTimeout != 0) {
|
||||
BukkitTask task = plugin.getServer().getScheduler().runTaskLaterAsynchronously(plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
PlayerCache.getInstance().removePlayer(name);
|
||||
if (database.isLogged(name))
|
||||
database.setUnlogged(name);
|
||||
plugin.sessions.remove(name);
|
||||
}
|
||||
|
||||
}, Settings.getSessionTimeout * 20 * 60);
|
||||
plugin.sessions.put(name, task);
|
||||
}
|
||||
} else {
|
||||
PlayerCache.getInstance().removePlayer(name);
|
||||
|
Loading…
Reference in New Issue
Block a user