public class SessionsTable extends UserIDTable
columnUserID, usersTable
db, tableName, usingMySQL
Constructor and Description |
---|
SessionsTable(SQLDB db,
boolean usingMySQL) |
Modifier and Type | Method and Description |
---|---|
void |
createTable() |
Map<UUID,Map<UUID,List<Session>>> |
getAllSessions(boolean getKillsAndWorldTimes) |
String |
getColumnID() |
long |
getLastSeen(UUID uuid) |
Map<UUID,Long> |
getLastSeenForAllPlayers() |
long |
getPlaytime(UUID uuid)
Get Total Playtime of a Player on THIS server.
|
long |
getPlaytime(UUID uuid,
long afterDate)
Get Playtime of a Player after Epoch ms on THIS server.
|
long |
getPlaytime(UUID uuid,
UUID serverUUID)
Get Total Playtime of a Player on a server.
|
long |
getPlaytime(UUID uuid,
UUID serverUUID,
long afterDate)
Used to get Playtime after Epoch ms on a server.
|
Map<String,Long> |
getPlaytimeByServer(UUID uuid)
Used to get Totals of Playtime in a Map, sorted by ServerNames.
|
Map<String,Long> |
getPlaytimeByServer(UUID uuid,
long afterDate)
Used to get Playtimes after a date in a Map, sorted by ServerNames.
|
long |
getPlaytimeOfServer()
Used to get the Total Playtime of THIS Server.
|
long |
getPlaytimeOfServer(long afterDate)
Used to get Playtime after a date of THIS Server.
|
long |
getPlaytimeOfServer(UUID serverUUID)
Used to get the Total Playtime of a Server.
|
long |
getPlaytimeOfServer(UUID serverUUID,
long afterDate)
Used to get Playtime after a date of a Server.
|
int |
getSessionCount(UUID uuid)
Used to get total Session count of a Player on THIS server.
|
int |
getSessionCount(UUID uuid,
long afterDate)
Used to get total Session count of a Player on THIS server after a given epoch ms.
|
int |
getSessionCount(UUID uuid,
UUID serverUUID)
Used to get total Session count of a Player on a server.
|
int |
getSessionCount(UUID uuid,
UUID serverUUID,
long afterDate)
Used to get total Session count of a Player on a server after a given epoch ms.
|
Map<UUID,List<Session>> |
getSessionInfoOfServer() |
Map<UUID,List<Session>> |
getSessionInfoOfServer(UUID serverUUID) |
Map<String,List<Session>> |
getSessions(UUID uuid) |
void |
insertSessions(Map<UUID,Map<UUID,List<Session>>> allSessions,
boolean saveKillsAndWorldTimes) |
void |
saveSession(UUID uuid,
Session session)
Used to save a session, with all it's information into the database.
|
removeUser
addColumns, close, commit, createTable, equals, execute, executeUnsafe, getConnection, getDb, getTableName, getVersion, hashCode, removeAllData, removeColumns, toString
public SessionsTable(SQLDB db, boolean usingMySQL)
public void createTable() throws DBCreateTableException
createTable
in class Table
DBCreateTableException
public void saveSession(UUID uuid, Session session) throws SQLException
Also saves WorldTimes and Kills.
uuid
- UUID of the player.session
- Session of the player that has ended (endSession
has been called)SQLException
- DB Errorpublic Map<String,List<Session>> getSessions(UUID uuid) throws SQLException
SQLException
public long getPlaytime(UUID uuid) throws SQLException
uuid
- UUID of the player.SQLException
- DB Errorpublic long getPlaytime(UUID uuid, long afterDate) throws SQLException
uuid
- UUID of the player.afterDate
- Epoch ms (Playtime after this date is calculated)SQLException
- DB Errorpublic long getPlaytime(UUID uuid, UUID serverUUID) throws SQLException
uuid
- UUID of the player.serverUUID
- UUID of the server. @see ServerTableSQLException
- DB Errorpublic long getPlaytime(UUID uuid, UUID serverUUID, long afterDate) throws SQLException
uuid
- UUID of the player.serverUUID
- UUID of the server. @see ServerTableafterDate
- Epoch ms (Playtime after this date is calculated)SQLException
- DB Errorpublic Map<String,Long> getPlaytimeByServer(UUID uuid) throws SQLException
uuid
- UUID of the Player.SQLException
- DB Errorpublic Map<String,Long> getPlaytimeByServer(UUID uuid, long afterDate) throws SQLException
uuid
- UUID of the Player.afterDate
- Epoch ms (Playtime after this date is calculated)SQLException
- DB Errorpublic long getPlaytimeOfServer() throws SQLException
SQLException
- DB Errorpublic long getPlaytimeOfServer(UUID serverUUID) throws SQLException
serverUUID
- UUID of the server.SQLException
- DB Errorpublic long getPlaytimeOfServer(long afterDate) throws SQLException
afterDate
- Epoch ms (Playtime after this date is calculated)SQLException
- DB Errorpublic long getPlaytimeOfServer(UUID serverUUID, long afterDate) throws SQLException
serverUUID
- UUID of the server.afterDate
- Epoch ms (Playtime after this date is calculated)SQLException
- DB Errorpublic int getSessionCount(UUID uuid) throws SQLException
uuid
- UUID of the player.SQLException
- DB Errorpublic int getSessionCount(UUID uuid, long afterDate) throws SQLException
uuid
- UUID of the player.afterDate
- Epoch ms (Session count after this date is calculated)SQLException
- DB Errorpublic int getSessionCount(UUID uuid, UUID serverUUID) throws SQLException
uuid
- UUID of the player.serverUUID
- UUID of the server.SQLException
- DB Errorpublic int getSessionCount(UUID uuid, UUID serverUUID, long afterDate) throws SQLException
uuid
- UUID of the player.serverUUID
- UUID of the server.afterDate
- Epoch ms (Session count after this date is calculated)SQLException
- DB Errorpublic String getColumnID()
public Map<UUID,List<Session>> getSessionInfoOfServer() throws SQLException
SQLException
public Map<UUID,List<Session>> getSessionInfoOfServer(UUID serverUUID) throws SQLException
SQLException
public long getLastSeen(UUID uuid) throws SQLException
SQLException
public Map<UUID,Long> getLastSeenForAllPlayers() throws SQLException
SQLException
public Map<UUID,Map<UUID,List<Session>>> getAllSessions(boolean getKillsAndWorldTimes) throws SQLException
SQLException
public void insertSessions(Map<UUID,Map<UUID,List<Session>>> allSessions, boolean saveKillsAndWorldTimes) throws SQLException
SQLException
Copyright © 2017. All rights reserved.