This commit is contained in:
Rsl1122 2017-10-08 10:55:53 +03:00
parent 99bd4fed06
commit 8d8946287c
4 changed files with 13 additions and 5 deletions

View File

@ -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);
}
}

View File

@ -154,4 +154,8 @@ public class WorldTimes {
b.append("}");
return b.toString();
}
public String getCurrentWorld() {
return currentWorld;
}
}

View File

@ -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) {

View File

@ -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;