IN DEVELOPPEMENT : Change how session work

This commit is contained in:
Xephi59
2015-07-07 01:40:37 +02:00
parent d22607e8bd
commit 30e9610053
9 changed files with 58 additions and 102 deletions
@@ -28,7 +28,8 @@ public class AsyncronousLogout {
private Utils utils = Utils.getInstance();
private FileCache playerBackup;
public AsyncronousLogout(Player player, AuthMe plugin, DataSource database) {
public AsyncronousLogout(Player player, AuthMe plugin,
DataSource database) {
this.player = player;
this.plugin = plugin;
this.database = database;
@@ -50,8 +51,6 @@ public class AsyncronousLogout {
final Player p = player;
BukkitScheduler sched = p.getServer().getScheduler();
PlayerAuth auth = PlayerCache.getInstance().getAuth(name);
if (Settings.isSessionsEnabled)
auth.setLastLogin(0L);
database.updateSession(auth);
auth.setQuitLocX(p.getLocation().getX());
auth.setQuitLocY(p.getLocation().getY());
@@ -32,6 +32,9 @@ public class ProcessSyncronousPlayerLogout implements Runnable {
@Override
public void run() {
if (plugin.sessions.containsKey(name))
plugin.sessions.get(name).cancel();
plugin.sessions.remove(name);
int delay = Settings.getRegistrationTimeout * 20;
int interval = Settings.getWarnMessageInterval;
BukkitScheduler sched = player.getServer().getScheduler();