Merge pull request #27 from Xephi/master

Up
This commit is contained in:
Gabriele C. 2015-08-03 18:35:45 +02:00
commit 70da194aad
2 changed files with 22 additions and 18 deletions

View File

@ -21,8 +21,10 @@ public class ForceFlatToSqlite implements Converter {
DataSource sqlite = null;
try {
sqlite = new SQLite();
for (PlayerAuth auth : data.getAllAuths())
for (PlayerAuth auth : data.getAllAuths()) {
auth.setRealName("Player");
sqlite.saveAuth(auth);
}
plugin.getSettings().setValue("DataSource.backend", "sqlite");
ConsoleLogger.info("Database successfully converted to sqlite !");
} catch (Exception e) {

View File

@ -99,26 +99,28 @@ public class AsyncronousJoin {
}
}
final Location spawnLoc = plugin.getSpawnLocation(player);
if (database.getType() != DataSource.DataSourceType.FILE && database.isAuthAvailable(name)) {
PlayerAuth auth = database.getAuth(name);
if (auth.getRealName() != null && !auth.getRealName().isEmpty() && !auth.getRealName().equalsIgnoreCase("Player") && !auth.getRealName().equals(player.getName())) {
final GameMode gM = AuthMePlayerListener.gameMode.get(name);
sched.scheduleSyncDelayedTask(plugin, new Runnable() {
if (database.isAuthAvailable(name)) {
if (database.getType() != DataSource.DataSourceType.FILE) {
PlayerAuth auth = database.getAuth(name);
if (auth.getRealName() != null && !auth.getRealName().isEmpty() && !auth.getRealName().equalsIgnoreCase("Player") && !auth.getRealName().equals(player.getName())) {
final GameMode gM = AuthMePlayerListener.gameMode.get(name);
sched.scheduleSyncDelayedTask(plugin, new Runnable() {
@Override
public void run() {
if (gM != null) {
AuthMePlayerListener.causeByAuthMe.put(name, true);
player.setGameMode(gM);
AuthMePlayerListener.causeByAuthMe.put(name, false);
@Override
public void run() {
if (gM != null) {
AuthMePlayerListener.causeByAuthMe.put(name, true);
player.setGameMode(gM);
AuthMePlayerListener.causeByAuthMe.put(name, false);
}
player.kickPlayer("You are not the Owner of this account, please try another name!");
if (Settings.banUnsafeIp)
plugin.getServer().banIP(ip);
}
player.kickPlayer("You are not the Owner of this account, please try another name!");
if (Settings.banUnsafeIp)
plugin.getServer().banIP(ip);
}
}, 1);
return;
}, 1);
return;
}
}
if (Settings.isForceSurvivalModeEnabled && !Settings.forceOnlyAfterLogin) {
sched.scheduleSyncDelayedTask(plugin, new Runnable() {