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