Prepare the project for javadocs
This commit is contained in:
@@ -15,12 +15,19 @@ import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||
import fr.xephi.authme.util.Utils;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class CacheDataSource implements DataSource {
|
||||
|
||||
private final DataSource source;
|
||||
private final ExecutorService exec;
|
||||
private final ConcurrentHashMap<String, PlayerAuth> cache = new ConcurrentHashMap<>();
|
||||
|
||||
/**
|
||||
* Constructor for CacheDataSource.
|
||||
* @param pl AuthMe
|
||||
* @param src DataSource
|
||||
*/
|
||||
public CacheDataSource(final AuthMe pl, DataSource src) {
|
||||
this.source = src;
|
||||
this.exec = Executors.newCachedThreadPool();
|
||||
@@ -42,11 +49,23 @@ public class CacheDataSource implements DataSource {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Method isAuthAvailable.
|
||||
* @param user String
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#isAuthAvailable(String)
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean isAuthAvailable(String user) {
|
||||
return cache.containsKey(user.toLowerCase());
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getAuth.
|
||||
* @param user String
|
||||
* @return PlayerAuth
|
||||
* @see fr.xephi.authme.datasource.DataSource#getAuth(String)
|
||||
*/
|
||||
@Override
|
||||
public synchronized PlayerAuth getAuth(String user) {
|
||||
user = user.toLowerCase();
|
||||
@@ -56,6 +75,12 @@ public class CacheDataSource implements DataSource {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method saveAuth.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#saveAuth(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean saveAuth(final PlayerAuth auth) {
|
||||
cache.put(auth.getNickname(), auth);
|
||||
@@ -70,6 +95,12 @@ public class CacheDataSource implements DataSource {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method updatePassword.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#updatePassword(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean updatePassword(final PlayerAuth auth) {
|
||||
if (!cache.containsKey(auth.getNickname())) {
|
||||
@@ -90,6 +121,12 @@ public class CacheDataSource implements DataSource {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method updateSession.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#updateSession(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public boolean updateSession(final PlayerAuth auth) {
|
||||
if (!cache.containsKey(auth.getNickname())) {
|
||||
@@ -119,6 +156,12 @@ public class CacheDataSource implements DataSource {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method updateQuitLoc.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#updateQuitLoc(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public boolean updateQuitLoc(final PlayerAuth auth) {
|
||||
if (!cache.containsKey(auth.getNickname())) {
|
||||
@@ -151,6 +194,12 @@ public class CacheDataSource implements DataSource {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getIps.
|
||||
* @param ip String
|
||||
* @return int
|
||||
* @see fr.xephi.authme.datasource.DataSource#getIps(String)
|
||||
*/
|
||||
@Override
|
||||
public int getIps(String ip) {
|
||||
int count = 0;
|
||||
@@ -162,6 +211,12 @@ public class CacheDataSource implements DataSource {
|
||||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method purgeDatabase.
|
||||
* @param until long
|
||||
* @return int
|
||||
* @see fr.xephi.authme.datasource.DataSource#purgeDatabase(long)
|
||||
*/
|
||||
@Override
|
||||
public int purgeDatabase(long until) {
|
||||
int cleared = source.purgeDatabase(until);
|
||||
@@ -175,6 +230,12 @@ public class CacheDataSource implements DataSource {
|
||||
return cleared;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method autoPurgeDatabase.
|
||||
* @param until long
|
||||
* @return List<String>
|
||||
* @see fr.xephi.authme.datasource.DataSource#autoPurgeDatabase(long)
|
||||
*/
|
||||
@Override
|
||||
public List<String> autoPurgeDatabase(long until) {
|
||||
List<String> cleared = source.autoPurgeDatabase(until);
|
||||
@@ -188,6 +249,12 @@ public class CacheDataSource implements DataSource {
|
||||
return cleared;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method removeAuth.
|
||||
* @param username String
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#removeAuth(String)
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean removeAuth(String username) {
|
||||
final String user = username.toLowerCase();
|
||||
@@ -204,12 +271,20 @@ public class CacheDataSource implements DataSource {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method close.
|
||||
* @see fr.xephi.authme.datasource.DataSource#close()
|
||||
*/
|
||||
@Override
|
||||
public synchronized void close() {
|
||||
exec.shutdown();
|
||||
source.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method reload.
|
||||
* @see fr.xephi.authme.datasource.DataSource#reload()
|
||||
*/
|
||||
@Override
|
||||
public void reload() {
|
||||
exec.execute(new Runnable() {
|
||||
@@ -228,6 +303,12 @@ public class CacheDataSource implements DataSource {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Method updateEmail.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#updateEmail(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean updateEmail(final PlayerAuth auth) {
|
||||
try {
|
||||
@@ -241,6 +322,12 @@ public class CacheDataSource implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method updateSalt.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#updateSalt(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean updateSalt(final PlayerAuth auth) {
|
||||
if (!cache.containsKey(auth.getNickname())) {
|
||||
@@ -262,6 +349,12 @@ public class CacheDataSource implements DataSource {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getAllAuthsByName.
|
||||
* @param auth PlayerAuth
|
||||
* @return List<String>
|
||||
* @see fr.xephi.authme.datasource.DataSource#getAllAuthsByName(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public synchronized List<String> getAllAuthsByName(PlayerAuth auth) {
|
||||
List<String> result = new ArrayList<>();
|
||||
@@ -273,6 +366,13 @@ public class CacheDataSource implements DataSource {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getAllAuthsByIp.
|
||||
* @param ip String
|
||||
* @return List<String>
|
||||
* @throws Exception
|
||||
* @see fr.xephi.authme.datasource.DataSource#getAllAuthsByIp(String)
|
||||
*/
|
||||
@Override
|
||||
public synchronized List<String> getAllAuthsByIp(final String ip) throws Exception {
|
||||
return exec.submit(new Callable<List<String>>() {
|
||||
@@ -282,6 +382,13 @@ public class CacheDataSource implements DataSource {
|
||||
}).get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getAllAuthsByEmail.
|
||||
* @param email String
|
||||
* @return List<String>
|
||||
* @throws Exception
|
||||
* @see fr.xephi.authme.datasource.DataSource#getAllAuthsByEmail(String)
|
||||
*/
|
||||
@Override
|
||||
public synchronized List<String> getAllAuthsByEmail(final String email) throws Exception {
|
||||
return exec.submit(new Callable<List<String>>() {
|
||||
@@ -291,6 +398,11 @@ public class CacheDataSource implements DataSource {
|
||||
}).get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method purgeBanned.
|
||||
* @param banned List<String>
|
||||
* @see fr.xephi.authme.datasource.DataSource#purgeBanned(List<String>)
|
||||
*/
|
||||
@Override
|
||||
public synchronized void purgeBanned(final List<String> banned) {
|
||||
exec.execute(new Runnable() {
|
||||
@@ -306,17 +418,33 @@ public class CacheDataSource implements DataSource {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getType.
|
||||
* @return DataSourceType
|
||||
* @see fr.xephi.authme.datasource.DataSource#getType()
|
||||
*/
|
||||
@Override
|
||||
public DataSourceType getType() {
|
||||
return source.getType();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method isLogged.
|
||||
* @param user String
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#isLogged(String)
|
||||
*/
|
||||
@Override
|
||||
public boolean isLogged(String user) {
|
||||
user = user.toLowerCase();
|
||||
return PlayerCache.getInstance().getCache().containsKey(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method setLogged.
|
||||
* @param user String
|
||||
* @see fr.xephi.authme.datasource.DataSource#setLogged(String)
|
||||
*/
|
||||
@Override
|
||||
public void setLogged(final String user) {
|
||||
exec.execute(new Runnable() {
|
||||
@@ -327,6 +455,11 @@ public class CacheDataSource implements DataSource {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Method setUnlogged.
|
||||
* @param user String
|
||||
* @see fr.xephi.authme.datasource.DataSource#setUnlogged(String)
|
||||
*/
|
||||
@Override
|
||||
public void setUnlogged(final String user) {
|
||||
exec.execute(new Runnable() {
|
||||
@@ -337,6 +470,10 @@ public class CacheDataSource implements DataSource {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Method purgeLogged.
|
||||
* @see fr.xephi.authme.datasource.DataSource#purgeLogged()
|
||||
*/
|
||||
@Override
|
||||
public void purgeLogged() {
|
||||
exec.execute(new Runnable() {
|
||||
@@ -347,11 +484,22 @@ public class CacheDataSource implements DataSource {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getAccountsRegistered.
|
||||
* @return int
|
||||
* @see fr.xephi.authme.datasource.DataSource#getAccountsRegistered()
|
||||
*/
|
||||
@Override
|
||||
public int getAccountsRegistered() {
|
||||
return cache.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method updateName.
|
||||
* @param oldone String
|
||||
* @param newone String
|
||||
* @see fr.xephi.authme.datasource.DataSource#updateName(String, String)
|
||||
*/
|
||||
@Override
|
||||
public void updateName(final String oldone, final String newone) {
|
||||
if (cache.containsKey(oldone)) {
|
||||
@@ -366,11 +514,21 @@ public class CacheDataSource implements DataSource {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getAllAuths.
|
||||
* @return List<PlayerAuth>
|
||||
* @see fr.xephi.authme.datasource.DataSource#getAllAuths()
|
||||
*/
|
||||
@Override
|
||||
public List<PlayerAuth> getAllAuths() {
|
||||
return new ArrayList<>(cache.values());
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getLoggedPlayers.
|
||||
* @return List<PlayerAuth>
|
||||
* @see fr.xephi.authme.datasource.DataSource#getLoggedPlayers()
|
||||
*/
|
||||
@Override
|
||||
public List<PlayerAuth> getLoggedPlayers() {
|
||||
return new ArrayList<>(PlayerCache.getInstance().getCache().values());
|
||||
|
||||
@@ -4,66 +4,185 @@ import java.util.List;
|
||||
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
|
||||
/**
|
||||
*/
|
||||
public interface DataSource {
|
||||
|
||||
/**
|
||||
*/
|
||||
enum DataSourceType {
|
||||
MYSQL,
|
||||
FILE,
|
||||
SQLITE
|
||||
}
|
||||
|
||||
/**
|
||||
* Method isAuthAvailable.
|
||||
* @param user String
|
||||
* @return boolean
|
||||
*/
|
||||
boolean isAuthAvailable(String user);
|
||||
|
||||
/**
|
||||
* Method getAuth.
|
||||
* @param user String
|
||||
* @return PlayerAuth
|
||||
*/
|
||||
PlayerAuth getAuth(String user);
|
||||
|
||||
/**
|
||||
* Method saveAuth.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
*/
|
||||
boolean saveAuth(PlayerAuth auth);
|
||||
|
||||
/**
|
||||
* Method updateSession.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
*/
|
||||
boolean updateSession(PlayerAuth auth);
|
||||
|
||||
/**
|
||||
* Method updatePassword.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
*/
|
||||
boolean updatePassword(PlayerAuth auth);
|
||||
|
||||
/**
|
||||
* Method purgeDatabase.
|
||||
* @param until long
|
||||
* @return int
|
||||
*/
|
||||
int purgeDatabase(long until);
|
||||
|
||||
/**
|
||||
* Method autoPurgeDatabase.
|
||||
* @param until long
|
||||
* @return List<String>
|
||||
*/
|
||||
List<String> autoPurgeDatabase(long until);
|
||||
|
||||
/**
|
||||
* Method removeAuth.
|
||||
* @param user String
|
||||
* @return boolean
|
||||
*/
|
||||
boolean removeAuth(String user);
|
||||
|
||||
/**
|
||||
* Method updateQuitLoc.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
*/
|
||||
boolean updateQuitLoc(PlayerAuth auth);
|
||||
|
||||
/**
|
||||
* Method getIps.
|
||||
* @param ip String
|
||||
* @return int
|
||||
*/
|
||||
int getIps(String ip);
|
||||
|
||||
/**
|
||||
* Method getAllAuthsByName.
|
||||
* @param auth PlayerAuth
|
||||
* @return List<String>
|
||||
*/
|
||||
List<String> getAllAuthsByName(PlayerAuth auth);
|
||||
|
||||
/**
|
||||
* Method getAllAuthsByIp.
|
||||
* @param ip String
|
||||
* @return List<String>
|
||||
* @throws Exception
|
||||
*/
|
||||
List<String> getAllAuthsByIp(String ip) throws Exception;
|
||||
|
||||
/**
|
||||
* Method getAllAuthsByEmail.
|
||||
* @param email String
|
||||
* @return List<String>
|
||||
* @throws Exception
|
||||
*/
|
||||
List<String> getAllAuthsByEmail(String email) throws Exception;
|
||||
|
||||
/**
|
||||
* Method updateEmail.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
*/
|
||||
boolean updateEmail(PlayerAuth auth);
|
||||
|
||||
/**
|
||||
* Method updateSalt.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
*/
|
||||
boolean updateSalt(PlayerAuth auth);
|
||||
|
||||
void close();
|
||||
|
||||
void reload();
|
||||
|
||||
/**
|
||||
* Method purgeBanned.
|
||||
* @param banned List<String>
|
||||
*/
|
||||
void purgeBanned(List<String> banned);
|
||||
|
||||
/**
|
||||
* Method getType.
|
||||
* @return DataSourceType
|
||||
*/
|
||||
DataSourceType getType();
|
||||
|
||||
/**
|
||||
* Method isLogged.
|
||||
* @param user String
|
||||
* @return boolean
|
||||
*/
|
||||
boolean isLogged(String user);
|
||||
|
||||
/**
|
||||
* Method setLogged.
|
||||
* @param user String
|
||||
*/
|
||||
void setLogged(String user);
|
||||
|
||||
/**
|
||||
* Method setUnlogged.
|
||||
* @param user String
|
||||
*/
|
||||
void setUnlogged(String user);
|
||||
|
||||
void purgeLogged();
|
||||
|
||||
/**
|
||||
* Method getAccountsRegistered.
|
||||
* @return int
|
||||
*/
|
||||
int getAccountsRegistered();
|
||||
|
||||
/**
|
||||
* Method updateName.
|
||||
* @param oldone String
|
||||
* @param newone String
|
||||
*/
|
||||
void updateName(String oldone, String newone);
|
||||
|
||||
/**
|
||||
* Method getAllAuths.
|
||||
* @return List<PlayerAuth>
|
||||
*/
|
||||
List<PlayerAuth> getAllAuths();
|
||||
|
||||
/**
|
||||
* Method getLoggedPlayers.
|
||||
* @return List<PlayerAuth>
|
||||
*/
|
||||
List<PlayerAuth> getLoggedPlayers();
|
||||
|
||||
}
|
||||
|
||||
@@ -8,16 +8,28 @@ import java.util.concurrent.Executors;
|
||||
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class DatabaseCalls implements DataSource {
|
||||
|
||||
private DataSource database;
|
||||
private final ExecutorService exec;
|
||||
|
||||
/**
|
||||
* Constructor for DatabaseCalls.
|
||||
* @param database DataSource
|
||||
*/
|
||||
public DatabaseCalls(DataSource database) {
|
||||
this.database = database;
|
||||
this.exec = Executors.newCachedThreadPool();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method isAuthAvailable.
|
||||
* @param user String
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#isAuthAvailable(String)
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean isAuthAvailable(final String user) {
|
||||
try {
|
||||
@@ -31,6 +43,12 @@ public class DatabaseCalls implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getAuth.
|
||||
* @param user String
|
||||
* @return PlayerAuth
|
||||
* @see fr.xephi.authme.datasource.DataSource#getAuth(String)
|
||||
*/
|
||||
@Override
|
||||
public synchronized PlayerAuth getAuth(final String user) {
|
||||
try {
|
||||
@@ -44,6 +62,12 @@ public class DatabaseCalls implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method saveAuth.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#saveAuth(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean saveAuth(final PlayerAuth auth) {
|
||||
try {
|
||||
@@ -57,6 +81,12 @@ public class DatabaseCalls implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method updateSession.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#updateSession(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean updateSession(final PlayerAuth auth) {
|
||||
try {
|
||||
@@ -70,6 +100,12 @@ public class DatabaseCalls implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method updatePassword.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#updatePassword(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean updatePassword(final PlayerAuth auth) {
|
||||
try {
|
||||
@@ -83,6 +119,12 @@ public class DatabaseCalls implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method purgeDatabase.
|
||||
* @param until long
|
||||
* @return int
|
||||
* @see fr.xephi.authme.datasource.DataSource#purgeDatabase(long)
|
||||
*/
|
||||
@Override
|
||||
public synchronized int purgeDatabase(final long until) {
|
||||
try {
|
||||
@@ -96,6 +138,12 @@ public class DatabaseCalls implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method autoPurgeDatabase.
|
||||
* @param until long
|
||||
* @return List<String>
|
||||
* @see fr.xephi.authme.datasource.DataSource#autoPurgeDatabase(long)
|
||||
*/
|
||||
@Override
|
||||
public synchronized List<String> autoPurgeDatabase(final long until) {
|
||||
try {
|
||||
@@ -109,6 +157,12 @@ public class DatabaseCalls implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method removeAuth.
|
||||
* @param user String
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#removeAuth(String)
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean removeAuth(final String user) {
|
||||
try {
|
||||
@@ -122,6 +176,12 @@ public class DatabaseCalls implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method updateQuitLoc.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#updateQuitLoc(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean updateQuitLoc(final PlayerAuth auth) {
|
||||
try {
|
||||
@@ -135,6 +195,12 @@ public class DatabaseCalls implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getIps.
|
||||
* @param ip String
|
||||
* @return int
|
||||
* @see fr.xephi.authme.datasource.DataSource#getIps(String)
|
||||
*/
|
||||
@Override
|
||||
public synchronized int getIps(final String ip) {
|
||||
try {
|
||||
@@ -149,6 +215,12 @@ public class DatabaseCalls implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getAllAuthsByName.
|
||||
* @param auth PlayerAuth
|
||||
* @return List<String>
|
||||
* @see fr.xephi.authme.datasource.DataSource#getAllAuthsByName(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public synchronized List<String> getAllAuthsByName(final PlayerAuth auth) {
|
||||
try {
|
||||
@@ -162,6 +234,12 @@ public class DatabaseCalls implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getAllAuthsByIp.
|
||||
* @param ip String
|
||||
* @return List<String>
|
||||
* @see fr.xephi.authme.datasource.DataSource#getAllAuthsByIp(String)
|
||||
*/
|
||||
@Override
|
||||
public synchronized List<String> getAllAuthsByIp(final String ip) {
|
||||
try {
|
||||
@@ -175,6 +253,12 @@ public class DatabaseCalls implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getAllAuthsByEmail.
|
||||
* @param email String
|
||||
* @return List<String>
|
||||
* @see fr.xephi.authme.datasource.DataSource#getAllAuthsByEmail(String)
|
||||
*/
|
||||
@Override
|
||||
public synchronized List<String> getAllAuthsByEmail(final String email) {
|
||||
try {
|
||||
@@ -188,6 +272,12 @@ public class DatabaseCalls implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method updateEmail.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#updateEmail(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean updateEmail(final PlayerAuth auth) {
|
||||
try {
|
||||
@@ -201,6 +291,12 @@ public class DatabaseCalls implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method updateSalt.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#updateSalt(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean updateSalt(final PlayerAuth auth) {
|
||||
try {
|
||||
@@ -214,17 +310,30 @@ public class DatabaseCalls implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method close.
|
||||
* @see fr.xephi.authme.datasource.DataSource#close()
|
||||
*/
|
||||
@Override
|
||||
public synchronized void close() {
|
||||
exec.shutdown();
|
||||
database.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method reload.
|
||||
* @see fr.xephi.authme.datasource.DataSource#reload()
|
||||
*/
|
||||
@Override
|
||||
public synchronized void reload() {
|
||||
database.reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method purgeBanned.
|
||||
* @param banned List<String>
|
||||
* @see fr.xephi.authme.datasource.DataSource#purgeBanned(List<String>)
|
||||
*/
|
||||
@Override
|
||||
public synchronized void purgeBanned(final List<String> banned) {
|
||||
new Thread(new Runnable() {
|
||||
@@ -234,11 +343,22 @@ public class DatabaseCalls implements DataSource {
|
||||
}).start();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getType.
|
||||
* @return DataSourceType
|
||||
* @see fr.xephi.authme.datasource.DataSource#getType()
|
||||
*/
|
||||
@Override
|
||||
public synchronized DataSourceType getType() {
|
||||
return database.getType();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method isLogged.
|
||||
* @param user String
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#isLogged(String)
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean isLogged(final String user) {
|
||||
try {
|
||||
@@ -252,6 +372,11 @@ public class DatabaseCalls implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method setLogged.
|
||||
* @param user String
|
||||
* @see fr.xephi.authme.datasource.DataSource#setLogged(String)
|
||||
*/
|
||||
@Override
|
||||
public synchronized void setLogged(final String user) {
|
||||
exec.execute(new Runnable() {
|
||||
@@ -261,6 +386,11 @@ public class DatabaseCalls implements DataSource {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Method setUnlogged.
|
||||
* @param user String
|
||||
* @see fr.xephi.authme.datasource.DataSource#setUnlogged(String)
|
||||
*/
|
||||
@Override
|
||||
public synchronized void setUnlogged(final String user) {
|
||||
exec.execute(new Runnable() {
|
||||
@@ -270,6 +400,10 @@ public class DatabaseCalls implements DataSource {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Method purgeLogged.
|
||||
* @see fr.xephi.authme.datasource.DataSource#purgeLogged()
|
||||
*/
|
||||
@Override
|
||||
public synchronized void purgeLogged() {
|
||||
exec.execute(new Runnable() {
|
||||
@@ -279,6 +413,11 @@ public class DatabaseCalls implements DataSource {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getAccountsRegistered.
|
||||
* @return int
|
||||
* @see fr.xephi.authme.datasource.DataSource#getAccountsRegistered()
|
||||
*/
|
||||
@Override
|
||||
public synchronized int getAccountsRegistered() {
|
||||
try {
|
||||
@@ -292,6 +431,12 @@ public class DatabaseCalls implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method updateName.
|
||||
* @param oldone String
|
||||
* @param newone String
|
||||
* @see fr.xephi.authme.datasource.DataSource#updateName(String, String)
|
||||
*/
|
||||
@Override
|
||||
public synchronized void updateName(final String oldone, final String newone) {
|
||||
exec.execute(new Runnable() {
|
||||
@@ -301,6 +446,11 @@ public class DatabaseCalls implements DataSource {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getAllAuths.
|
||||
* @return List<PlayerAuth>
|
||||
* @see fr.xephi.authme.datasource.DataSource#getAllAuths()
|
||||
*/
|
||||
@Override
|
||||
public synchronized List<PlayerAuth> getAllAuths() {
|
||||
try {
|
||||
@@ -314,6 +464,11 @@ public class DatabaseCalls implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getLoggedPlayers.
|
||||
* @return List<PlayerAuth>
|
||||
* @see fr.xephi.authme.datasource.DataSource#getLoggedPlayers()
|
||||
*/
|
||||
@Override
|
||||
public List<PlayerAuth> getLoggedPlayers() {
|
||||
try {
|
||||
|
||||
@@ -16,6 +16,8 @@ import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class FlatFile implements DataSource {
|
||||
|
||||
/*
|
||||
@@ -48,6 +50,12 @@ public class FlatFile implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method isAuthAvailable.
|
||||
* @param user String
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#isAuthAvailable(String)
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean isAuthAvailable(String user) {
|
||||
BufferedReader br = null;
|
||||
@@ -77,6 +85,12 @@ public class FlatFile implements DataSource {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method saveAuth.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#saveAuth(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean saveAuth(PlayerAuth auth) {
|
||||
if (isAuthAvailable(auth.getNickname())) {
|
||||
@@ -100,6 +114,12 @@ public class FlatFile implements DataSource {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method updatePassword.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#updatePassword(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean updatePassword(PlayerAuth auth) {
|
||||
if (!isAuthAvailable(auth.getNickname())) {
|
||||
@@ -159,6 +179,12 @@ public class FlatFile implements DataSource {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method updateSession.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#updateSession(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public boolean updateSession(PlayerAuth auth) {
|
||||
if (!isAuthAvailable(auth.getNickname())) {
|
||||
@@ -218,6 +244,12 @@ public class FlatFile implements DataSource {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method updateQuitLoc.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#updateQuitLoc(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public boolean updateQuitLoc(PlayerAuth auth) {
|
||||
if (!isAuthAvailable(auth.getNickname())) {
|
||||
@@ -256,6 +288,12 @@ public class FlatFile implements DataSource {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getIps.
|
||||
* @param ip String
|
||||
* @return int
|
||||
* @see fr.xephi.authme.datasource.DataSource#getIps(String)
|
||||
*/
|
||||
@Override
|
||||
public int getIps(String ip) {
|
||||
BufferedReader br = null;
|
||||
@@ -286,6 +324,12 @@ public class FlatFile implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method purgeDatabase.
|
||||
* @param until long
|
||||
* @return int
|
||||
* @see fr.xephi.authme.datasource.DataSource#purgeDatabase(long)
|
||||
*/
|
||||
@Override
|
||||
public int purgeDatabase(long until) {
|
||||
BufferedReader br = null;
|
||||
@@ -332,6 +376,12 @@ public class FlatFile implements DataSource {
|
||||
return cleared;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method autoPurgeDatabase.
|
||||
* @param until long
|
||||
* @return List<String>
|
||||
* @see fr.xephi.authme.datasource.DataSource#autoPurgeDatabase(long)
|
||||
*/
|
||||
@Override
|
||||
public List<String> autoPurgeDatabase(long until) {
|
||||
BufferedReader br = null;
|
||||
@@ -378,6 +428,12 @@ public class FlatFile implements DataSource {
|
||||
return cleared;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method removeAuth.
|
||||
* @param user String
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#removeAuth(String)
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean removeAuth(String user) {
|
||||
if (!isAuthAvailable(user)) {
|
||||
@@ -422,6 +478,12 @@ public class FlatFile implements DataSource {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getAuth.
|
||||
* @param user String
|
||||
* @return PlayerAuth
|
||||
* @see fr.xephi.authme.datasource.DataSource#getAuth(String)
|
||||
*/
|
||||
@Override
|
||||
public synchronized PlayerAuth getAuth(String user) {
|
||||
BufferedReader br = null;
|
||||
@@ -464,14 +526,28 @@ public class FlatFile implements DataSource {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method close.
|
||||
* @see fr.xephi.authme.datasource.DataSource#close()
|
||||
*/
|
||||
@Override
|
||||
public synchronized void close() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Method reload.
|
||||
* @see fr.xephi.authme.datasource.DataSource#reload()
|
||||
*/
|
||||
@Override
|
||||
public void reload() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Method updateEmail.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#updateEmail(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public boolean updateEmail(PlayerAuth auth) {
|
||||
if (!isAuthAvailable(auth.getNickname())) {
|
||||
@@ -510,11 +586,23 @@ public class FlatFile implements DataSource {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method updateSalt.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#updateSalt(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public boolean updateSalt(PlayerAuth auth) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getAllAuthsByName.
|
||||
* @param auth PlayerAuth
|
||||
* @return List<String>
|
||||
* @see fr.xephi.authme.datasource.DataSource#getAllAuthsByName(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public List<String> getAllAuthsByName(PlayerAuth auth) {
|
||||
BufferedReader br = null;
|
||||
@@ -545,6 +633,12 @@ public class FlatFile implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getAllAuthsByIp.
|
||||
* @param ip String
|
||||
* @return List<String>
|
||||
* @see fr.xephi.authme.datasource.DataSource#getAllAuthsByIp(String)
|
||||
*/
|
||||
@Override
|
||||
public List<String> getAllAuthsByIp(String ip) {
|
||||
BufferedReader br = null;
|
||||
@@ -575,6 +669,12 @@ public class FlatFile implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getAllAuthsByEmail.
|
||||
* @param email String
|
||||
* @return List<String>
|
||||
* @see fr.xephi.authme.datasource.DataSource#getAllAuthsByEmail(String)
|
||||
*/
|
||||
@Override
|
||||
public List<String> getAllAuthsByEmail(String email) {
|
||||
BufferedReader br = null;
|
||||
@@ -605,6 +705,11 @@ public class FlatFile implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method purgeBanned.
|
||||
* @param banned List<String>
|
||||
* @see fr.xephi.authme.datasource.DataSource#purgeBanned(List<String>)
|
||||
*/
|
||||
@Override
|
||||
public void purgeBanned(List<String> banned) {
|
||||
BufferedReader br = null;
|
||||
@@ -649,28 +754,58 @@ public class FlatFile implements DataSource {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getType.
|
||||
* @return DataSourceType
|
||||
* @see fr.xephi.authme.datasource.DataSource#getType()
|
||||
*/
|
||||
@Override
|
||||
public DataSourceType getType() {
|
||||
return DataSourceType.FILE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method isLogged.
|
||||
* @param user String
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#isLogged(String)
|
||||
*/
|
||||
@Override
|
||||
public boolean isLogged(String user) {
|
||||
return PlayerCache.getInstance().isAuthenticated(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method setLogged.
|
||||
* @param user String
|
||||
* @see fr.xephi.authme.datasource.DataSource#setLogged(String)
|
||||
*/
|
||||
@Override
|
||||
public void setLogged(String user) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Method setUnlogged.
|
||||
* @param user String
|
||||
* @see fr.xephi.authme.datasource.DataSource#setUnlogged(String)
|
||||
*/
|
||||
@Override
|
||||
public void setUnlogged(String user) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Method purgeLogged.
|
||||
* @see fr.xephi.authme.datasource.DataSource#purgeLogged()
|
||||
*/
|
||||
@Override
|
||||
public void purgeLogged() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getAccountsRegistered.
|
||||
* @return int
|
||||
* @see fr.xephi.authme.datasource.DataSource#getAccountsRegistered()
|
||||
*/
|
||||
@Override
|
||||
public int getAccountsRegistered() {
|
||||
BufferedReader br = null;
|
||||
@@ -694,6 +829,12 @@ public class FlatFile implements DataSource {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method updateName.
|
||||
* @param oldone String
|
||||
* @param newone String
|
||||
* @see fr.xephi.authme.datasource.DataSource#updateName(String, String)
|
||||
*/
|
||||
@Override
|
||||
public void updateName(String oldone, String newone) {
|
||||
PlayerAuth auth = this.getAuth(oldone);
|
||||
@@ -702,6 +843,11 @@ public class FlatFile implements DataSource {
|
||||
this.removeAuth(oldone);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getAllAuths.
|
||||
* @return List<PlayerAuth>
|
||||
* @see fr.xephi.authme.datasource.DataSource#getAllAuths()
|
||||
*/
|
||||
@Override
|
||||
public List<PlayerAuth> getAllAuths() {
|
||||
BufferedReader br = null;
|
||||
@@ -749,6 +895,11 @@ public class FlatFile implements DataSource {
|
||||
return auths;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getLoggedPlayers.
|
||||
* @return List<PlayerAuth>
|
||||
* @see fr.xephi.authme.datasource.DataSource#getLoggedPlayers()
|
||||
*/
|
||||
@Override
|
||||
public List<PlayerAuth> getLoggedPlayers() {
|
||||
return new ArrayList<>();
|
||||
|
||||
@@ -19,6 +19,8 @@ import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.security.HashAlgorithm;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class MySQL implements DataSource {
|
||||
|
||||
private String host;
|
||||
@@ -45,6 +47,12 @@ public class MySQL implements DataSource {
|
||||
private String columnRealName;
|
||||
private int maxConnections;
|
||||
|
||||
/**
|
||||
* Constructor for MySQL.
|
||||
* @throws ClassNotFoundException
|
||||
* @throws SQLException
|
||||
* @throws PoolInitializationException
|
||||
*/
|
||||
public MySQL() throws ClassNotFoundException, SQLException, PoolInitializationException {
|
||||
this.host = Settings.getMySQLHost;
|
||||
this.port = Settings.getMySQLPort;
|
||||
@@ -98,6 +106,11 @@ public class MySQL implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method setConnectionArguments.
|
||||
* @throws ClassNotFoundException
|
||||
* @throws IllegalArgumentException
|
||||
*/
|
||||
private synchronized void setConnectionArguments()
|
||||
throws ClassNotFoundException, IllegalArgumentException {
|
||||
HikariConfig config = new HikariConfig();
|
||||
@@ -117,6 +130,11 @@ public class MySQL implements DataSource {
|
||||
ConsoleLogger.info("Connection arguments loaded, Hikari ConnectionPool ready!");
|
||||
}
|
||||
|
||||
/**
|
||||
* Method reloadArguments.
|
||||
* @throws ClassNotFoundException
|
||||
* @throws IllegalArgumentException
|
||||
*/
|
||||
private synchronized void reloadArguments()
|
||||
throws ClassNotFoundException, IllegalArgumentException {
|
||||
if (ds != null) {
|
||||
@@ -126,10 +144,19 @@ public class MySQL implements DataSource {
|
||||
ConsoleLogger.info("Hikari ConnectionPool arguments reloaded!");
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getConnection.
|
||||
* @return Connection
|
||||
* @throws SQLException
|
||||
*/
|
||||
private synchronized Connection getConnection() throws SQLException {
|
||||
return ds.getConnection();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method setupConnection.
|
||||
* @throws SQLException
|
||||
*/
|
||||
private synchronized void setupConnection() throws SQLException {
|
||||
Connection con = null;
|
||||
Statement st = null;
|
||||
@@ -193,6 +220,12 @@ public class MySQL implements DataSource {
|
||||
ConsoleLogger.info("MySQL Setup finished");
|
||||
}
|
||||
|
||||
/**
|
||||
* Method isAuthAvailable.
|
||||
* @param user String
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#isAuthAvailable(String)
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean isAuthAvailable(String user) {
|
||||
Connection con = null;
|
||||
@@ -215,6 +248,12 @@ public class MySQL implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getAuth.
|
||||
* @param user String
|
||||
* @return PlayerAuth
|
||||
* @see fr.xephi.authme.datasource.DataSource#getAuth(String)
|
||||
*/
|
||||
@Override
|
||||
public synchronized PlayerAuth getAuth(String user) {
|
||||
Connection con = null;
|
||||
@@ -268,6 +307,12 @@ public class MySQL implements DataSource {
|
||||
return pAuth;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method saveAuth.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#saveAuth(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean saveAuth(PlayerAuth auth) {
|
||||
Connection con = null;
|
||||
@@ -475,6 +520,12 @@ public class MySQL implements DataSource {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method updatePassword.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#updatePassword(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean updatePassword(PlayerAuth auth) {
|
||||
Connection con = null;
|
||||
@@ -520,6 +571,12 @@ public class MySQL implements DataSource {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method updateSession.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#updateSession(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean updateSession(PlayerAuth auth) {
|
||||
Connection con = null;
|
||||
@@ -543,6 +600,12 @@ public class MySQL implements DataSource {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method purgeDatabase.
|
||||
* @param until long
|
||||
* @return int
|
||||
* @see fr.xephi.authme.datasource.DataSource#purgeDatabase(long)
|
||||
*/
|
||||
@Override
|
||||
public synchronized int purgeDatabase(long until) {
|
||||
Connection con = null;
|
||||
@@ -562,6 +625,12 @@ public class MySQL implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method autoPurgeDatabase.
|
||||
* @param until long
|
||||
* @return List<String>
|
||||
* @see fr.xephi.authme.datasource.DataSource#autoPurgeDatabase(long)
|
||||
*/
|
||||
@Override
|
||||
public synchronized List<String> autoPurgeDatabase(long until) {
|
||||
Connection con = null;
|
||||
@@ -592,6 +661,12 @@ public class MySQL implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method removeAuth.
|
||||
* @param user String
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#removeAuth(String)
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean removeAuth(String user) {
|
||||
Connection con = null;
|
||||
@@ -629,6 +704,12 @@ public class MySQL implements DataSource {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method updateQuitLoc.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#updateQuitLoc(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean updateQuitLoc(PlayerAuth auth) {
|
||||
Connection con = null;
|
||||
@@ -653,6 +734,12 @@ public class MySQL implements DataSource {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getIps.
|
||||
* @param ip String
|
||||
* @return int
|
||||
* @see fr.xephi.authme.datasource.DataSource#getIps(String)
|
||||
*/
|
||||
@Override
|
||||
public synchronized int getIps(String ip) {
|
||||
Connection con = null;
|
||||
@@ -679,6 +766,12 @@ public class MySQL implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method updateEmail.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#updateEmail(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean updateEmail(PlayerAuth auth) {
|
||||
Connection con = null;
|
||||
@@ -701,6 +794,12 @@ public class MySQL implements DataSource {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method updateSalt.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#updateSalt(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean updateSalt(PlayerAuth auth) {
|
||||
if (columnSalt.isEmpty()) {
|
||||
@@ -725,6 +824,10 @@ public class MySQL implements DataSource {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method reload.
|
||||
* @see fr.xephi.authme.datasource.DataSource#reload()
|
||||
*/
|
||||
@Override
|
||||
public void reload() {
|
||||
try {
|
||||
@@ -740,12 +843,20 @@ public class MySQL implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method close.
|
||||
* @see fr.xephi.authme.datasource.DataSource#close()
|
||||
*/
|
||||
@Override
|
||||
public synchronized void close() {
|
||||
if (ds != null && !ds.isClosed())
|
||||
ds.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method close.
|
||||
* @param o AutoCloseable
|
||||
*/
|
||||
private void close(AutoCloseable o) {
|
||||
if (o != null) {
|
||||
try {
|
||||
@@ -757,6 +868,12 @@ public class MySQL implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getAllAuthsByName.
|
||||
* @param auth PlayerAuth
|
||||
* @return List<String>
|
||||
* @see fr.xephi.authme.datasource.DataSource#getAllAuthsByName(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public synchronized List<String> getAllAuthsByName(PlayerAuth auth) {
|
||||
Connection con = null;
|
||||
@@ -783,6 +900,12 @@ public class MySQL implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getAllAuthsByIp.
|
||||
* @param ip String
|
||||
* @return List<String>
|
||||
* @see fr.xephi.authme.datasource.DataSource#getAllAuthsByIp(String)
|
||||
*/
|
||||
@Override
|
||||
public synchronized List<String> getAllAuthsByIp(String ip) {
|
||||
Connection con = null;
|
||||
@@ -809,6 +932,13 @@ public class MySQL implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getAllAuthsByEmail.
|
||||
* @param email String
|
||||
* @return List<String>
|
||||
* @throws SQLException
|
||||
* @see fr.xephi.authme.datasource.DataSource#getAllAuthsByEmail(String)
|
||||
*/
|
||||
@Override
|
||||
public synchronized List<String> getAllAuthsByEmail(String email) throws SQLException {
|
||||
final Connection con = getConnection();
|
||||
@@ -831,6 +961,11 @@ public class MySQL implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method purgeBanned.
|
||||
* @param banned List<String>
|
||||
* @see fr.xephi.authme.datasource.DataSource#purgeBanned(List<String>)
|
||||
*/
|
||||
@Override
|
||||
public synchronized void purgeBanned(List<String> banned) {
|
||||
Connection con = null;
|
||||
@@ -851,11 +986,22 @@ public class MySQL implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getType.
|
||||
* @return DataSourceType
|
||||
* @see fr.xephi.authme.datasource.DataSource#getType()
|
||||
*/
|
||||
@Override
|
||||
public DataSourceType getType() {
|
||||
return DataSourceType.MYSQL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method isLogged.
|
||||
* @param user String
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#isLogged(String)
|
||||
*/
|
||||
@Override
|
||||
public boolean isLogged(String user) {
|
||||
Connection con = null;
|
||||
@@ -880,6 +1026,11 @@ public class MySQL implements DataSource {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method setLogged.
|
||||
* @param user String
|
||||
* @see fr.xephi.authme.datasource.DataSource#setLogged(String)
|
||||
*/
|
||||
@Override
|
||||
public void setLogged(String user) {
|
||||
Connection con = null;
|
||||
@@ -899,6 +1050,11 @@ public class MySQL implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method setUnlogged.
|
||||
* @param user String
|
||||
* @see fr.xephi.authme.datasource.DataSource#setUnlogged(String)
|
||||
*/
|
||||
@Override
|
||||
public void setUnlogged(String user) {
|
||||
Connection con = null;
|
||||
@@ -919,6 +1075,10 @@ public class MySQL implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method purgeLogged.
|
||||
* @see fr.xephi.authme.datasource.DataSource#purgeLogged()
|
||||
*/
|
||||
@Override
|
||||
public void purgeLogged() {
|
||||
Connection con = null;
|
||||
@@ -938,6 +1098,11 @@ public class MySQL implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getAccountsRegistered.
|
||||
* @return int
|
||||
* @see fr.xephi.authme.datasource.DataSource#getAccountsRegistered()
|
||||
*/
|
||||
@Override
|
||||
public int getAccountsRegistered() {
|
||||
int result = 0;
|
||||
@@ -962,6 +1127,12 @@ public class MySQL implements DataSource {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method updateName.
|
||||
* @param oldone String
|
||||
* @param newone String
|
||||
* @see fr.xephi.authme.datasource.DataSource#updateName(String, String)
|
||||
*/
|
||||
@Override
|
||||
public void updateName(String oldone, String newone) {
|
||||
Connection con = null;
|
||||
@@ -981,6 +1152,11 @@ public class MySQL implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getAllAuths.
|
||||
* @return List<PlayerAuth>
|
||||
* @see fr.xephi.authme.datasource.DataSource#getAllAuths()
|
||||
*/
|
||||
@Override
|
||||
public List<PlayerAuth> getAllAuths() {
|
||||
List<PlayerAuth> auths = new ArrayList<>();
|
||||
@@ -1032,6 +1208,11 @@ public class MySQL implements DataSource {
|
||||
return auths;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getLoggedPlayers.
|
||||
* @return List<PlayerAuth>
|
||||
* @see fr.xephi.authme.datasource.DataSource#getLoggedPlayers()
|
||||
*/
|
||||
@Override
|
||||
public List<PlayerAuth> getLoggedPlayers() {
|
||||
List<PlayerAuth> auths = new ArrayList<>();
|
||||
|
||||
@@ -13,6 +13,8 @@ import fr.xephi.authme.ConsoleLogger;
|
||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class SQLite implements DataSource {
|
||||
|
||||
private String database;
|
||||
@@ -33,6 +35,11 @@ public class SQLite implements DataSource {
|
||||
private String columnLogged;
|
||||
private String columnRealName;
|
||||
|
||||
/**
|
||||
* Constructor for SQLite.
|
||||
* @throws ClassNotFoundException
|
||||
* @throws SQLException
|
||||
*/
|
||||
public SQLite() throws ClassNotFoundException, SQLException {
|
||||
this.database = Settings.getMySQLDatabase;
|
||||
this.tableName = Settings.getMySQLTablename;
|
||||
@@ -60,6 +67,11 @@ public class SQLite implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method connect.
|
||||
* @throws ClassNotFoundException
|
||||
* @throws SQLException
|
||||
*/
|
||||
private synchronized void connect() throws ClassNotFoundException, SQLException {
|
||||
Class.forName("org.sqlite.JDBC");
|
||||
ConsoleLogger.info("SQLite driver loaded");
|
||||
@@ -67,6 +79,10 @@ public class SQLite implements DataSource {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Method setup.
|
||||
* @throws SQLException
|
||||
*/
|
||||
private synchronized void setup() throws SQLException {
|
||||
Statement st = null;
|
||||
ResultSet rs = null;
|
||||
@@ -121,6 +137,12 @@ public class SQLite implements DataSource {
|
||||
ConsoleLogger.info("SQLite Setup finished");
|
||||
}
|
||||
|
||||
/**
|
||||
* Method isAuthAvailable.
|
||||
* @param user String
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#isAuthAvailable(String)
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean isAuthAvailable(String user) {
|
||||
PreparedStatement pst = null;
|
||||
@@ -139,6 +161,12 @@ public class SQLite implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getAuth.
|
||||
* @param user String
|
||||
* @return PlayerAuth
|
||||
* @see fr.xephi.authme.datasource.DataSource#getAuth(String)
|
||||
*/
|
||||
@Override
|
||||
public synchronized PlayerAuth getAuth(String user) {
|
||||
PreparedStatement pst = null;
|
||||
@@ -169,6 +197,12 @@ public class SQLite implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method saveAuth.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#saveAuth(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean saveAuth(PlayerAuth auth) {
|
||||
PreparedStatement pst = null;
|
||||
@@ -200,6 +234,12 @@ public class SQLite implements DataSource {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method updatePassword.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#updatePassword(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean updatePassword(PlayerAuth auth) {
|
||||
PreparedStatement pst = null;
|
||||
@@ -217,6 +257,12 @@ public class SQLite implements DataSource {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method updateSession.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#updateSession(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public boolean updateSession(PlayerAuth auth) {
|
||||
PreparedStatement pst = null;
|
||||
@@ -236,6 +282,12 @@ public class SQLite implements DataSource {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method purgeDatabase.
|
||||
* @param until long
|
||||
* @return int
|
||||
* @see fr.xephi.authme.datasource.DataSource#purgeDatabase(long)
|
||||
*/
|
||||
@Override
|
||||
public int purgeDatabase(long until) {
|
||||
PreparedStatement pst = null;
|
||||
@@ -252,6 +304,12 @@ public class SQLite implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method autoPurgeDatabase.
|
||||
* @param until long
|
||||
* @return List<String>
|
||||
* @see fr.xephi.authme.datasource.DataSource#autoPurgeDatabase(long)
|
||||
*/
|
||||
@Override
|
||||
public List<String> autoPurgeDatabase(long until) {
|
||||
PreparedStatement pst = null;
|
||||
@@ -274,6 +332,12 @@ public class SQLite implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method removeAuth.
|
||||
* @param user String
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#removeAuth(String)
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean removeAuth(String user) {
|
||||
PreparedStatement pst = null;
|
||||
@@ -290,6 +354,12 @@ public class SQLite implements DataSource {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method updateQuitLoc.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#updateQuitLoc(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public boolean updateQuitLoc(PlayerAuth auth) {
|
||||
PreparedStatement pst = null;
|
||||
@@ -310,6 +380,12 @@ public class SQLite implements DataSource {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getIps.
|
||||
* @param ip String
|
||||
* @return int
|
||||
* @see fr.xephi.authme.datasource.DataSource#getIps(String)
|
||||
*/
|
||||
@Override
|
||||
public int getIps(String ip) {
|
||||
PreparedStatement pst = null;
|
||||
@@ -332,6 +408,12 @@ public class SQLite implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method updateEmail.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#updateEmail(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public boolean updateEmail(PlayerAuth auth) {
|
||||
PreparedStatement pst = null;
|
||||
@@ -349,6 +431,12 @@ public class SQLite implements DataSource {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method updateSalt.
|
||||
* @param auth PlayerAuth
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#updateSalt(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public boolean updateSalt(PlayerAuth auth) {
|
||||
if (columnSalt.isEmpty()) {
|
||||
@@ -369,6 +457,10 @@ public class SQLite implements DataSource {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method close.
|
||||
* @see fr.xephi.authme.datasource.DataSource#close()
|
||||
*/
|
||||
@Override
|
||||
public synchronized void close() {
|
||||
try {
|
||||
@@ -378,10 +470,18 @@ public class SQLite implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method reload.
|
||||
* @see fr.xephi.authme.datasource.DataSource#reload()
|
||||
*/
|
||||
@Override
|
||||
public void reload() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Method close.
|
||||
* @param st Statement
|
||||
*/
|
||||
private void close(Statement st) {
|
||||
if (st != null) {
|
||||
try {
|
||||
@@ -392,6 +492,10 @@ public class SQLite implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method close.
|
||||
* @param rs ResultSet
|
||||
*/
|
||||
private void close(ResultSet rs) {
|
||||
if (rs != null) {
|
||||
try {
|
||||
@@ -402,6 +506,12 @@ public class SQLite implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getAllAuthsByName.
|
||||
* @param auth PlayerAuth
|
||||
* @return List<String>
|
||||
* @see fr.xephi.authme.datasource.DataSource#getAllAuthsByName(PlayerAuth)
|
||||
*/
|
||||
@Override
|
||||
public List<String> getAllAuthsByName(PlayerAuth auth) {
|
||||
PreparedStatement pst = null;
|
||||
@@ -426,6 +536,12 @@ public class SQLite implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getAllAuthsByIp.
|
||||
* @param ip String
|
||||
* @return List<String>
|
||||
* @see fr.xephi.authme.datasource.DataSource#getAllAuthsByIp(String)
|
||||
*/
|
||||
@Override
|
||||
public List<String> getAllAuthsByIp(String ip) {
|
||||
PreparedStatement pst = null;
|
||||
@@ -450,6 +566,12 @@ public class SQLite implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getAllAuthsByEmail.
|
||||
* @param email String
|
||||
* @return List<String>
|
||||
* @see fr.xephi.authme.datasource.DataSource#getAllAuthsByEmail(String)
|
||||
*/
|
||||
@Override
|
||||
public List<String> getAllAuthsByEmail(String email) {
|
||||
PreparedStatement pst = null;
|
||||
@@ -474,6 +596,11 @@ public class SQLite implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method purgeBanned.
|
||||
* @param banned List<String>
|
||||
* @see fr.xephi.authme.datasource.DataSource#purgeBanned(List<String>)
|
||||
*/
|
||||
@Override
|
||||
public void purgeBanned(List<String> banned) {
|
||||
PreparedStatement pst = null;
|
||||
@@ -490,11 +617,22 @@ public class SQLite implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getType.
|
||||
* @return DataSourceType
|
||||
* @see fr.xephi.authme.datasource.DataSource#getType()
|
||||
*/
|
||||
@Override
|
||||
public DataSourceType getType() {
|
||||
return DataSourceType.SQLITE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method isLogged.
|
||||
* @param user String
|
||||
* @return boolean
|
||||
* @see fr.xephi.authme.datasource.DataSource#isLogged(String)
|
||||
*/
|
||||
@Override
|
||||
public boolean isLogged(String user) {
|
||||
PreparedStatement pst = null;
|
||||
@@ -515,6 +653,11 @@ public class SQLite implements DataSource {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method setLogged.
|
||||
* @param user String
|
||||
* @see fr.xephi.authme.datasource.DataSource#setLogged(String)
|
||||
*/
|
||||
@Override
|
||||
public void setLogged(String user) {
|
||||
PreparedStatement pst = null;
|
||||
@@ -530,6 +673,11 @@ public class SQLite implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method setUnlogged.
|
||||
* @param user String
|
||||
* @see fr.xephi.authme.datasource.DataSource#setUnlogged(String)
|
||||
*/
|
||||
@Override
|
||||
public void setUnlogged(String user) {
|
||||
PreparedStatement pst = null;
|
||||
@@ -546,6 +694,10 @@ public class SQLite implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method purgeLogged.
|
||||
* @see fr.xephi.authme.datasource.DataSource#purgeLogged()
|
||||
*/
|
||||
@Override
|
||||
public void purgeLogged() {
|
||||
PreparedStatement pst = null;
|
||||
@@ -561,6 +713,11 @@ public class SQLite implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getAccountsRegistered.
|
||||
* @return int
|
||||
* @see fr.xephi.authme.datasource.DataSource#getAccountsRegistered()
|
||||
*/
|
||||
@Override
|
||||
public int getAccountsRegistered() {
|
||||
int result = 0;
|
||||
@@ -581,6 +738,12 @@ public class SQLite implements DataSource {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method updateName.
|
||||
* @param oldone String
|
||||
* @param newone String
|
||||
* @see fr.xephi.authme.datasource.DataSource#updateName(String, String)
|
||||
*/
|
||||
@Override
|
||||
public void updateName(String oldone, String newone) {
|
||||
PreparedStatement pst = null;
|
||||
@@ -596,6 +759,11 @@ public class SQLite implements DataSource {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getAllAuths.
|
||||
* @return List<PlayerAuth>
|
||||
* @see fr.xephi.authme.datasource.DataSource#getAllAuths()
|
||||
*/
|
||||
@Override
|
||||
public List<PlayerAuth> getAllAuths() {
|
||||
List<PlayerAuth> auths = new ArrayList<>();
|
||||
@@ -626,6 +794,11 @@ public class SQLite implements DataSource {
|
||||
return auths;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getLoggedPlayers.
|
||||
* @return List<PlayerAuth>
|
||||
* @see fr.xephi.authme.datasource.DataSource#getLoggedPlayers()
|
||||
*/
|
||||
@Override
|
||||
public List<PlayerAuth> getLoggedPlayers() {
|
||||
List<PlayerAuth> auths = new ArrayList<>();
|
||||
|
||||
Reference in New Issue
Block a user