mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-11 19:02:16 +01:00
Fixes #346
This commit is contained in:
parent
99bd4fed06
commit
8d8946287c
@ -72,14 +72,14 @@ public class ShutdownHook extends Thread {
|
||||
}
|
||||
|
||||
private void saveFirstSessionInformation(long now) {
|
||||
try {
|
||||
for (Map.Entry<UUID, Integer> entry : dataCache.getFirstSessionMsgCounts().entrySet()) {
|
||||
for (Map.Entry<UUID, Integer> entry : dataCache.getFirstSessionMsgCounts().entrySet()) {
|
||||
try {
|
||||
UUID uuid = entry.getKey();
|
||||
int messagesSent = entry.getValue();
|
||||
db.getActionsTable().insertAction(uuid, new Action(now, Actions.FIRST_LOGOUT, "Messages sent: " + messagesSent));
|
||||
} catch (SQLException e) {
|
||||
Log.toLog(this.getClass().getName(), e);
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
Log.toLog(this.getClass().getName(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -154,4 +154,8 @@ public class WorldTimes {
|
||||
b.append("}");
|
||||
return b.toString();
|
||||
}
|
||||
|
||||
public String getCurrentWorld() {
|
||||
return currentWorld;
|
||||
}
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ public class UserInfoTable extends UserIDTable {
|
||||
public boolean isRegistered(UUID uuid, UUID serverUUID) throws SQLException {
|
||||
String sql = Select.from(tableName, "COUNT(" + columnUserID + ") as c")
|
||||
.where(columnUserID + "=" + usersTable.statementSelectID)
|
||||
.where(columnServerID + "=" + serverTable.statementSelectServerID)
|
||||
.and(columnServerID + "=" + serverTable.statementSelectServerID)
|
||||
.toString();
|
||||
|
||||
return query(new QueryStatement<Boolean>(sql) {
|
||||
|
@ -91,6 +91,10 @@ public class SessionsTableCreator {
|
||||
}
|
||||
|
||||
private static String getLongestWorldPlayed(Session session) {
|
||||
if (session.getSessionEnd() == -1) {
|
||||
return "Current: " + session.getWorldTimes().getCurrentWorld();
|
||||
}
|
||||
|
||||
WorldTimes worldTimes = session.getWorldTimes();
|
||||
long total = worldTimes.getTotal();
|
||||
long longest = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user