forked from SteamWar/SteamWar
Remove first second and third in master rank
This commit is contained in:
@@ -75,15 +75,7 @@ public class UserElo {
|
|||||||
|
|
||||||
public static void setElo(int userId, String gameMode, int elo) {
|
public static void setElo(int userId, String gameMode, int elo) {
|
||||||
emblemCache.remove(userId);
|
emblemCache.remove(userId);
|
||||||
|
|
||||||
int oldPlacement = getPlacement(getElo(userId, gameMode).orElse(0), gameMode);
|
|
||||||
int newPlacement = getPlacement(elo, gameMode);
|
|
||||||
|
|
||||||
gameModeUserEloCache.getOrDefault(gameMode, Collections.emptyMap()).remove(userId);
|
gameModeUserEloCache.getOrDefault(gameMode, Collections.emptyMap()).remove(userId);
|
||||||
if (oldPlacement <= 3 || newPlacement <= 3) {
|
|
||||||
emblemCache.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
setElo.update(Season.getSeason(), gameMode, userId, elo);
|
setElo.update(Season.getSeason(), gameMode, userId, elo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,23 +104,17 @@ public class UserElo {
|
|||||||
public static String getEmblemProgression(String gameMode, int userId) {
|
public static String getEmblemProgression(String gameMode, int userId) {
|
||||||
switch (getProgression(userId, gameMode)) {
|
switch (getProgression(userId, gameMode)) {
|
||||||
case -1:
|
case -1:
|
||||||
return "§f/ §8❱❱❱❱ ❂";
|
return "§8❱❱❱❱ ❂";
|
||||||
case 0:
|
case 0:
|
||||||
return "§8/ §e❱§8❱❱❱ ❂";
|
return "§e❱§8❱❱❱ ❂";
|
||||||
case 1:
|
case 1:
|
||||||
return "§8/ §e❱❱§8❱❱ ❂";
|
return "§e❱❱§8❱❱ ❂";
|
||||||
case 2:
|
case 2:
|
||||||
return "§8/ §e❱❱❱§8❱ ❂";
|
return "§e❱❱❱§8❱ ❂";
|
||||||
case 3:
|
case 3:
|
||||||
return "§8/ §e❱❱❱❱§8 ❂";
|
return "§e❱❱❱❱§8 ❂";
|
||||||
case 4:
|
case 4:
|
||||||
return "§8/ §8❱❱❱❱ §5❂";
|
return "§8❱❱❱❱ §5❂";
|
||||||
case 5:
|
|
||||||
return "§8/ §8❱❱❱❱ §5III";
|
|
||||||
case 6:
|
|
||||||
return "§8/ §8❱❱❱❱ §5II";
|
|
||||||
case 7:
|
|
||||||
return "§8/ §8❱❱❱❱ §5I";
|
|
||||||
default:
|
default:
|
||||||
throw new SecurityException("Progression is not in range");
|
throw new SecurityException("Progression is not in range");
|
||||||
}
|
}
|
||||||
@@ -142,12 +128,6 @@ public class UserElo {
|
|||||||
if (elo < 350) return 1;
|
if (elo < 350) return 1;
|
||||||
if (elo < 600) return 2;
|
if (elo < 600) return 2;
|
||||||
if (elo < 900) return 3;
|
if (elo < 900) return 3;
|
||||||
|
|
||||||
int placement = getPlacement(elo, gameMode);
|
|
||||||
if (placement == 1) return 7;
|
|
||||||
if (placement == 2) return 6;
|
|
||||||
if (placement == 3) return 5;
|
|
||||||
|
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,12 +145,6 @@ public class UserElo {
|
|||||||
return "§e❱❱❱❱ ";
|
return "§e❱❱❱❱ ";
|
||||||
case 4:
|
case 4:
|
||||||
return "§5❂ ";
|
return "§5❂ ";
|
||||||
case 5:
|
|
||||||
return "§5III ";
|
|
||||||
case 6:
|
|
||||||
return "§5II ";
|
|
||||||
case 7:
|
|
||||||
return "§5I ";
|
|
||||||
default:
|
default:
|
||||||
throw new SecurityException("Progression out of range");
|
throw new SecurityException("Progression out of range");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user