Dieser Commit ist enthalten in:
Ursprung
16af181082
Commit
8f1f267ad7
@ -98,10 +98,18 @@ public class Leaderboard implements Listener {
|
||||
private String calcName(SteamwarUser user, String color, int placement, long time) {
|
||||
StringBuilder st = new StringBuilder();
|
||||
st.append(color);
|
||||
st.append(placement).append(". ").append(user.getUserName());
|
||||
st.append(" §8• ");
|
||||
st.append(color).append(renderTime(time));
|
||||
if (time != bestTime) {
|
||||
if (placement == Integer.MAX_VALUE) {
|
||||
st.append("???").append(". ").append(user.getUserName());
|
||||
} else {
|
||||
st.append(placement).append(". ").append(user.getUserName());
|
||||
}
|
||||
st.append(" §8• ").append(color);
|
||||
if (placement == Integer.MAX_VALUE) {
|
||||
st.append("??:??,???");
|
||||
} else {
|
||||
st.append(renderTime(time));
|
||||
}
|
||||
if (time != bestTime && placement != Integer.MAX_VALUE) {
|
||||
st.append(" §8• ");
|
||||
st.append(color).append("+").append(renderShortTime(time - bestTime));
|
||||
}
|
||||
@ -120,14 +128,18 @@ public class Leaderboard implements Listener {
|
||||
|
||||
private long getPlayerTime(SteamwarUser user) {
|
||||
return PLAYER_TIME.select(resultSet -> {
|
||||
resultSet.next();
|
||||
if (!resultSet.next()) {
|
||||
return Long.MAX_VALUE;
|
||||
}
|
||||
return resultSet.getLong("Time");
|
||||
}, configKey, user.getId());
|
||||
}
|
||||
|
||||
private int getPlayerPlacement(SteamwarUser user) {
|
||||
return PLAYER_PLACEMENT.select(resultSet -> {
|
||||
resultSet.next();
|
||||
if (!resultSet.next()) {
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
return resultSet.getInt("Placement");
|
||||
}, configKey, configKey, user.getId());
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren