Ranked #333
@ -82,19 +82,26 @@ public class FightEndsHandler implements SpigotHandler {
|
||||
}
|
||||
|
||||
private void calculateEloOfTeam(int schemId, int eloSchemOwn, int eloSchemEnemy, int eloTeamOwn, int eloTeamEnemy, double result, List<Integer> players, String gameMode, boolean noPlayerRank) {
|
||||
double winSchemExpectation = 1 / (1 + Math.pow(10, (eloSchemEnemy - eloSchemOwn) / 600f));
|
||||
double winSchemExpectation = calsWinExpectation(eloSchemOwn, eloSchemEnemy);
|
||||
SchemElo.setElo(schemId, (int) Math.round(eloSchemOwn + K * (result - winSchemExpectation)));
|
||||
|
||||
if (noPlayerRank) return;
|
||||
YoyoNow markierte diese Unterhaltung als gelöst
Veraltet
|
||||
double winTeamExpectation = 1 / (1 + Math.pow(10, (eloTeamEnemy - eloTeamOwn) / 600f));
|
||||
double winTeamExpectation = calsWinExpectation(eloTeamOwn, eloTeamEnemy);
|
||||
for (int player : players) {
|
||||
int playerElo = UserElo.getEloOrDefault(player, gameMode);
|
||||
int fights = UserElo.getFightsOfSeason(player, gameMode);
|
||||
double multiplier = Math.max(1.2 - (fights / 200.0), 0.8);
|
||||
UserElo.setElo(player, gameMode, (int) Math.round(playerElo + K * (result - winTeamExpectation) * multiplier));
|
||||
UserElo.setElo(player, gameMode, (int) Math.round(playerElo + getK(fights) * (result - winTeamExpectation)));
|
||||
}
|
||||
}
|
||||
|
||||
private double calsWinExpectation(int eloOwn, int eloEnemy) {
|
||||
return 1 / (1 + Math.pow(10, (eloEnemy - eloOwn) / 600f));
|
||||
}
|
||||
|
||||
private double getK(int fights) {
|
||||
return K * Math.max(1.2 - (fights / 200.0), 0.8);
|
||||
}
|
||||
|
||||
private boolean teamComboExistedAlready(List<Integer> bluePlayers, List<Integer> redPlayers, String gameMode) {
|
||||
long time = Timestamp.from(Instant.now()).getTime() - fightRange;
|
||||
int page = 0;
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren
Da hier häufig Einträge zu Beginn der Liste entfernt werden, wäre eine LinkedList wahrscheinlich die bessere Datenstruktur
Das removeIf sollte ich dann aber auch noch einmal optimieren, weil ich ja die Reihenfolge kenne. Und damit nur immer über den Anfang der List drüber gehen muss.