Ranked #333
@ -23,10 +23,7 @@ import com.google.common.io.ByteArrayDataInput;
|
||||
import de.steamwar.bungeecore.ArenaMode;
|
||||
import de.steamwar.bungeecore.comms.SpigotHandler;
|
||||
import de.steamwar.bungeecore.comms.packets.FightEndsPacket;
|
||||
import de.steamwar.bungeecore.sql.SchemElo;
|
||||
import de.steamwar.bungeecore.sql.SchematicNode;
|
||||
import de.steamwar.bungeecore.sql.SchematicType;
|
||||
import de.steamwar.bungeecore.sql.UserElo;
|
||||
import de.steamwar.bungeecore.sql.*;
|
||||
import net.md_5.bungee.api.config.ServerInfo;
|
||||
|
||||
import java.util.List;
|
||||
@ -66,6 +63,8 @@ public class FightEndsHandler implements SpigotHandler {
|
||||
blueResult = 0;
|
||||
}
|
||||
|
||||
// TODO: Implement hourly unranked when against same team maybe half hourly
|
||||
|
||||
int blueSchemElo = SchemElo.getElo(fightEndsPacket.getBlueSchem());
|
||||
int redSchemElo = SchemElo.getElo(fightEndsPacket.getRedSchem());
|
||||
|
||||
@ -84,6 +83,7 @@ public class FightEndsHandler implements SpigotHandler {
|
||||
double winTeamExpectation = 1 / (1 + Math.pow(10, (eloTeamEnemy - eloTeamOwn) / 600f));
|
||||
for (int player : players) {
|
||||
int playerElo = UserElo.getEloOrDefault(player, gameMode);
|
||||
int fights = UserElo.getFightsOfSeason(player, gameMode);
|
||||
UserElo.setElo(player, gameMode, (int) Math.round(playerElo + K * (result - winTeamExpectation)));
|
||||
}
|
||||
YoyoNow markierte diese Unterhaltung als gelöst
Veraltet
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ public class UserElo {
|
||||
}, userID, gameMode, Season.getSeason()));
|
||||
}
|
||||
|
||||
private static int getFightsOfSeason(int userID, String gameMode) {
|
||||
public static int getFightsOfSeason(int userID, String gameMode) {
|
||||
return fightsOfSeason.select(rs -> {
|
||||
if (rs.next())
|
||||
return rs.getInt("Fights");
|
||||
|
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.