Remove Case dependance, auto-update name on join into database (care

forums users!)
This commit is contained in:
Xephi
2014-08-27 07:03:11 +02:00
parent 0d8ce9e3d8
commit 6cfd3f0a0b
37 changed files with 243 additions and 202 deletions
@@ -57,7 +57,7 @@ public class CrazyLoginConverter implements Converter {
continue;
if (args[0].equalsIgnoreCase("name"))
continue;
String player = args[0].toLowerCase();
String player = args[0];
String psw = args[1];
try {
if (player != null && psw != null) {
@@ -31,7 +31,7 @@ public class RoyalAuthConverter implements Converter {
if (!file.exists())
continue;
RoyalAuthYamlReader ra = new RoyalAuthYamlReader(file);
PlayerAuth auth = new PlayerAuth(name, ra.getHash(), "127.0.0.1", ra.getLastLogin(), "your@email.com", o.getName());
PlayerAuth auth = new PlayerAuth(o.getName(), ra.getHash(), "127.0.0.1", ra.getLastLogin(), "your@email.com");
data.saveAuth(auth);
} catch (Exception e) {
ConsoleLogger.showError("Error while trying to import " + o.getName() + " RoyalAuth datas");
@@ -51,7 +51,7 @@ public class newxAuthToFlat {
String pl = getIdPlayer(id);
String psw = getPassword(id);
if (psw != null && !psw.isEmpty() && pl != null) {
PlayerAuth auth = new PlayerAuth(pl, psw, "198.18.0.1", 0, "your@email.com", API.getPlayerRealName(pl));
PlayerAuth auth = new PlayerAuth(pl, psw, "198.18.0.1", 0, "your@email.com");
database.saveAuth(auth);
}
}
@@ -74,7 +74,7 @@ public class newxAuthToFlat {
rs = ps.executeQuery();
if (!rs.next())
return null;
realPass = rs.getString("playername").toLowerCase();
realPass = rs.getString("playername");
} catch (SQLException e) {
xAuthLog.severe("Failed to retrieve name for account: " + id, e);
return null;
@@ -55,7 +55,7 @@ public class oldxAuthToFlat {
String pl = getIdPlayer(id);
String psw = getPassword(id);
if (psw != null && !psw.isEmpty() && pl != null) {
PlayerAuth auth = new PlayerAuth(pl, psw, "198.18.0.1", 0, "your@email.com", API.getPlayerRealName(pl));
PlayerAuth auth = new PlayerAuth(pl, psw, "198.18.0.1", 0, "your@email.com");
database.saveAuth(auth);
}
}
@@ -78,7 +78,7 @@ public class oldxAuthToFlat {
rs = ps.executeQuery();
if (!rs.next())
return null;
realPass = rs.getString("playername").toLowerCase();
realPass = rs.getString("playername");
} catch (SQLException e) {
xAuthLog.severe("Failed to retrieve name for account: " + id, e);
return null;
@@ -48,9 +48,9 @@ public class vAuthFileReader {
}
if (pname == null)
continue;
auth = new PlayerAuth(pname.toLowerCase(), password, "127.0.0.1", System.currentTimeMillis(), "your@email.com", pname);
auth = new PlayerAuth(pname, password, "127.0.0.1", System.currentTimeMillis(), "your@email.com");
} else {
auth = new PlayerAuth(name, password, "127.0.0.1", System.currentTimeMillis(), "your@email.com", API.getPlayerRealName(name));
auth = new PlayerAuth(name, password, "127.0.0.1", System.currentTimeMillis(), "your@email.com");
}
if (auth != null)
database.saveAuth(auth);