Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull changes #5

Merged
merged 3 commits into from
May 11, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/main/java/net/cubespace/geSuit/database/Players.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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 = ?");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
16 changes: 13 additions & 3 deletions src/main/java/net/cubespace/geSuit/objects/GSPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
*/
Expand Down