From 3550e7715797f7d488d399f976476570a10abd5b Mon Sep 17 00:00:00 2001 From: addstar Date: Mon, 11 May 2015 18:19:46 +1000 Subject: [PATCH 1/3] Fix reported issues with BungeeSuite converter and new "firstonline" field --- .../java/net/cubespace/geSuit/database/convert/Converter.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/net/cubespace/geSuit/database/convert/Converter.java b/src/main/java/net/cubespace/geSuit/database/convert/Converter.java index 16b69f7e..4f0c46af 100644 --- a/src/main/java/net/cubespace/geSuit/database/convert/Converter.java +++ b/src/main/java/net/cubespace/geSuit/database/convert/Converter.java @@ -18,7 +18,6 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; -import java.util.Collections; import java.util.List; import java.util.Map; From 7de8f5db4495bddbf3cdc105609066dcd3ab5fe6 Mon Sep 17 00:00:00 2001 From: addstar Date: Mon, 11 May 2015 18:20:47 +1000 Subject: [PATCH 2/3] Fix reported issues with BungeeSuite converter and new "firstonline" field --- src/main/java/net/cubespace/geSuit/database/Players.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/cubespace/geSuit/database/Players.java b/src/main/java/net/cubespace/geSuit/database/Players.java index b14a9c35..9cd0ead1 100644 --- a/src/main/java/net/cubespace/geSuit/database/Players.java +++ b/src/main/java/net/cubespace/geSuit/database/Players.java @@ -154,8 +154,9 @@ public void insertPlayerConvert(String player, String uuid, Timestamp lastonline insertPlayerConvert.setString(1, player); insertPlayerConvert.setString(2, uuid); insertPlayerConvert.setTimestamp(3, lastonline); - insertPlayerConvert.setString(4, ip); - insertPlayerConvert.setBoolean(5, tps); + insertPlayerConvert.setTimestamp(4, lastonline); + insertPlayerConvert.setString(5, ip); + insertPlayerConvert.setBoolean(6, tps); insertPlayerConvert.executeUpdate(); } catch (Exception e) { @@ -413,7 +414,7 @@ public void registerPreparedStatements(ConnectionHandler connection) { connection.addPreparedStatement("getAltPlayer", "SELECT playername, uuid FROM "+ ConfigManager.main.Table_Players +" WHERE ipaddress = ? ORDER BY lastonline DESC LIMIT 2"); connection.addPreparedStatement("matchPlayers", "SELECT playername,uuid FROM "+ ConfigManager.main.Table_Players +" WHERE playername like ? OR uuid like ? ORDER BY lastonline LIMIT 20"); connection.addPreparedStatement("insertPlayer", "INSERT INTO "+ ConfigManager.main.Table_Players +" (playername,uuid,firstonline,lastonline,ipaddress) VALUES (?, ?, NOW(), NOW(), ?)"); - connection.addPreparedStatement("insertPlayerConvert", "INSERT INTO "+ ConfigManager.main.Table_Players +" (playername,uuid,lastonline,ipaddress,tps) VALUES (?, ?, ?, ?, ?)"); + connection.addPreparedStatement("insertPlayerConvert", "INSERT INTO "+ ConfigManager.main.Table_Players +" (playername,uuid,firstonline,lastonline,ipaddress,tps) VALUES (?, ?, ?, ?, ?, ?)"); connection.addPreparedStatement("getPlayers", "SELECT * FROM "+ ConfigManager.main.Table_Players); connection.addPreparedStatement("setUUID", "UPDATE "+ ConfigManager.main.Table_Players +" SET uuid = ? WHERE playername = ?"); connection.addPreparedStatement("updatePlayer", "UPDATE "+ ConfigManager.main.Table_Players +" SET uuid = ?, playername = ?, lastonline = NOW(), ipaddress = ?, tps = ?, newspawn = ? WHERE playername = ? OR uuid = ?"); From 24479cc137b440b441ea5e128a8a15d355164243 Mon Sep 17 00:00:00 2001 From: addstar Date: Mon, 11 May 2015 18:43:56 +1000 Subject: [PATCH 3/3] Ensure new gsPlayers always have a firstOnline/lastOnline (fixes bug with /ontime) --- .../net/cubespace/geSuit/objects/GSPlayer.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/cubespace/geSuit/objects/GSPlayer.java b/src/main/java/net/cubespace/geSuit/objects/GSPlayer.java index 11e56628..6f4b5f77 100644 --- a/src/main/java/net/cubespace/geSuit/objects/GSPlayer.java +++ b/src/main/java/net/cubespace/geSuit/objects/GSPlayer.java @@ -39,7 +39,7 @@ public GSPlayer(String name, String uuid, boolean tps) public GSPlayer(String name, String uuid, boolean tps, String ip) { - this(name, uuid, tps, false, ip, null, null); + this(name, uuid, tps, false, ip, new Timestamp(new Date().getTime()), new Timestamp(new Date().getTime())); } public GSPlayer(String name, String uuid, boolean tps, boolean newspawn, String ip, Timestamp lastOnline, Timestamp firstOnline) @@ -193,12 +193,22 @@ public Timestamp getLastOnline() { return lastOnline; } - + + public void setLastOnline(Timestamp value) + { + lastOnline = value; + } + public Timestamp getFirstOnline() { return firstOnline; } - + + public void setFirstOnline(Timestamp value) + { + firstOnline = value; + } + /** * Is this player a new player (as in the first time they have ever joined the proxy) */