Fixed Compile issues related to latest commit

This commit is contained in:
Rsl1122 2017-11-20 14:47:11 +02:00
parent b729f00a12
commit 86c4e36176
5 changed files with 10 additions and 13 deletions

View File

@ -45,7 +45,7 @@ public class ListServersCommand extends SubCommand {
String tCol = colorScheme.getTertiaryColor();
try {
sender.sendMessage(Locale.get(Msg.CMD_CONSTANT_FOOTER).toString() + mCol + " Servers");
Map<Integer, String> serverNames = plugin.getDB().getServerTable().getServerNames();
Map<Integer, String> serverNames = plugin.getDB().getServerTable().getServerNamesByID();
for (Map.Entry<Integer, String> entry : serverNames.entrySet()) {
sender.sendMessage(" " + tCol + entry.getKey() + sCol + " : " + entry.getValue());
}

View File

@ -256,7 +256,6 @@ public abstract class SQLDB extends Database {
profile.setSessions(sessions);
profile.setTotalWorldTimes(worldTimesTable.getWorldTimesOfUser(uuid));
return null;
}

View File

@ -286,7 +286,7 @@ public class SessionsTable extends UserIDTable {
* @throws SQLException DB Error
*/
public Map<String, Long> getPlaytimeByServer(UUID uuid, long afterDate) throws SQLException {
Map<Integer, String> serverNames = serverTable.getServerNames();
Map<Integer, String> serverNames = serverTable.getServerNamesByID();
String sql = "SELECT " +
"(SUM(" + columnSessionEnd + ") - SUM(" + columnSessionStart + ")) as playtime, " +
columnServerID +

View File

@ -96,16 +96,16 @@ public class InspectPageParser extends PageParser {
addValue("nicknames", HtmlStructure.createDotList(nicknames.toArray(new String[nicknames.size()])));
addValue("geolocations", HtmlStructure.createDotList(geolocations.toArray(new String[geolocations.size()])));
Map<String, List<Session>> sessions = sessionsTable.getSessions(uuid);
Map<UUID, List<Session>> sessions = sessionsTable.getSessions(uuid);
List<Session> allSessions = sessions.values().stream()
.flatMap(Collection::stream)
.sorted(new SessionStartComparator()) // Sorted Newest first.
.collect(Collectors.toList());
String[] sessionsTabContent = HtmlStructure.createSessionsTabContentInspectPage(sessions, allSessions, uuid);
addValue("contentSessions", sessionsTabContent[0]);
addValue("sessionTabGraphViewFunctions", sessionsTabContent[1]);
addValue("contentServerOverview", HtmlStructure.createServerOverviewColumn(sessions));
// String[] sessionsTabContent = HtmlStructure.createSessionsTabContentInspectPage(sessions, allSessions, uuid);
// addValue("contentSessions", sessionsTabContent[0]);
// addValue("sessionTabGraphViewFunctions", sessionsTabContent[1]);
// addValue("contentServerOverview", HtmlStructure.createServerOverviewColumn(sessions));
long now = MiscUtils.getTime();

View File

@ -416,14 +416,12 @@ public class DatabaseTest {
commitTest();
Map<String, List<Session>> sessions = sessionsTable.getSessions(uuid);
Map<UUID, List<Session>> sessions = sessionsTable.getSessions(uuid);
for (Map.Entry<String, List<Session>> entry : sessions.entrySet()) {
String key = entry.getKey();
for (Map.Entry<UUID, List<Session>> entry : sessions.entrySet()) {
UUID key = entry.getKey();
if (key == null) {
System.out.print("null");
} else if (key.isEmpty()) {
System.out.print("empty");
} else {
System.out.print(key);
}