replace cache with Json

This commit is contained in:
DNx5
2015-09-13 22:08:18 +07:00
parent 851eab2fd0
commit 576ff59fcd
9 changed files with 226 additions and 297 deletions
@@ -19,7 +19,7 @@ import fr.xephi.authme.Utils.groupType;
import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.cache.auth.PlayerCache;
import fr.xephi.authme.cache.backup.DataFileCache;
import fr.xephi.authme.cache.backup.FileCache;
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.datasource.DataSource;
@@ -42,13 +42,13 @@ public class AsyncronousJoin {
protected String name;
private Utils utils = Utils.getInstance();
private Messages m = Messages.getInstance();
private FileCache playerBackup;
private JsonCache playerBackup;
public AsyncronousJoin(Player player, AuthMe plugin, DataSource database) {
this.player = player;
this.plugin = plugin;
this.database = database;
this.playerBackup = new FileCache(plugin);
this.playerBackup = new JsonCache(plugin);
this.name = player.getName().toLowerCase();
}
@@ -11,7 +11,7 @@ import fr.xephi.authme.AuthMe;
import fr.xephi.authme.Utils;
import fr.xephi.authme.Utils.groupType;
import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.cache.backup.FileCache;
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.datasource.DataSource;
@@ -31,7 +31,7 @@ public class ProcessSyncronousPlayerLogin implements Runnable {
private AuthMe plugin;
private DataSource database;
private PluginManager pm;
private FileCache playerCache;
private JsonCache playerCache;
public ProcessSyncronousPlayerLogin(Player player, AuthMe plugin,
DataSource data) {
@@ -42,7 +42,7 @@ public class ProcessSyncronousPlayerLogin implements Runnable {
this.name = player.getName().toLowerCase();
this.limbo = LimboCache.getInstance().getLimboPlayer(name);
this.auth = database.getAuth(name);
this.playerCache = new FileCache(plugin);
this.playerCache = new JsonCache(plugin);
}
public LimboPlayer getLimbo() {
@@ -10,7 +10,7 @@ import fr.xephi.authme.Utils.groupType;
import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.cache.auth.PlayerCache;
import fr.xephi.authme.cache.backup.DataFileCache;
import fr.xephi.authme.cache.backup.FileCache;
import fr.xephi.authme.cache.backup.JsonCache;
import fr.xephi.authme.cache.limbo.LimboCache;
import fr.xephi.authme.datasource.DataSource;
import fr.xephi.authme.events.AuthMeTeleportEvent;
@@ -26,7 +26,7 @@ public class AsyncronousLogout {
protected boolean canLogout = true;
private Messages m = Messages.getInstance();
private Utils utils = Utils.getInstance();
private FileCache playerBackup;
private JsonCache playerBackup;
public AsyncronousLogout(Player player, AuthMe plugin,
DataSource database) {
@@ -34,7 +34,7 @@ public class AsyncronousLogout {
this.plugin = plugin;
this.database = database;
this.name = player.getName().toLowerCase();
this.playerBackup = new FileCache(plugin);
this.playerBackup = new JsonCache(plugin);
}
private void preLogout() {