diff --git a/src/main/java/net/Broken/Tools/UserManager/Stats/GuildStats.java b/src/main/java/net/Broken/Tools/UserManager/Stats/GuildStats.java index fa1d9ba..01d0115 100644 --- a/src/main/java/net/Broken/Tools/UserManager/Stats/GuildStats.java +++ b/src/main/java/net/Broken/Tools/UserManager/Stats/GuildStats.java @@ -2,6 +2,7 @@ package net.Broken.Tools.UserManager.Stats; public class GuildStats{ public String userName; + public int rank; public String avatarUrl; public long voiceTime; @@ -19,13 +20,13 @@ public class GuildStats{ public GuildStats() { } - public GuildStats(String userName, String avatarUrl, long voiceTime, long messageCount, long apiCount) { + public GuildStats(String userName, int rank, String avatarUrl, long voiceTime, long messageCount, long apiCount) { this.userName = userName; this.avatarUrl = avatarUrl; this.voiceTime = voiceTime; this.messageCount = messageCount; this.apiCount = apiCount; - + this.rank = rank; voiceXp = (long) (this.voiceTime * UserStatsUtils.XP_PER_VOICE_TIME); messageXp = (long) (this.messageCount * UserStatsUtils.XP_PER_MESSAGE); diff --git a/src/main/java/net/Broken/Tools/UserManager/Stats/UserStatsUtils.java b/src/main/java/net/Broken/Tools/UserManager/Stats/UserStatsUtils.java index d21b1dc..839e3cb 100644 --- a/src/main/java/net/Broken/Tools/UserManager/Stats/UserStatsUtils.java +++ b/src/main/java/net/Broken/Tools/UserManager/Stats/UserStatsUtils.java @@ -165,13 +165,16 @@ public class UserStatsUtils { List allStats = userStatsRepository.findByGuildId(guildId); List ranked = new ArrayList<>(); + int i = 1; for(UserStats stats : allStats){ String avatar = MainBot.jda.getUserById(stats.getUser().getJdaId()).getAvatarUrl(); - GuildStats temp = new GuildStats(stats.getUser().getName(), avatar, stats.getVocalTime(), stats.getMessageCount(), stats.getApiCommandCount()); + GuildStats temp = new GuildStats(stats.getUser().getName(), i, avatar, stats.getVocalTime(), stats.getMessageCount(), stats.getApiCommandCount()); if(stats.getUser().getId().equals(userEntity.getId())){ selfGuildStats = temp; } ranked.add(temp); + + i++; } ranked.sort((guildStats, t1) -> (int) (t1.total - guildStats.total)); diff --git a/src/main/resources/templates/rank.html b/src/main/resources/templates/rank.html index 456809d..cf5f4ab 100644 --- a/src/main/resources/templates/rank.html +++ b/src/main/resources/templates/rank.html @@ -24,6 +24,11 @@ font-size: 15px; font-weight: normal; } + + td span{ + color: #fbcf40; + font-size: 12px; + } @@ -42,7 +47,7 @@
-
+
-
-
+
+
@@ -72,7 +77,7 @@
-
+
@@ -94,7 +99,7 @@
-
+
@@ -105,9 +110,12 @@ @@ -115,7 +123,7 @@

- H - M - S + H + M + S

-
+
@@ -137,6 +145,50 @@ +
+
+

Ranking

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
RankNameVocal TimeMessage CountTotal XP
H + M + S
+ +
+ + +
+