Archiviert
1
0

Update EloPlayerHandler.MEDIAN_ELO_GAIN and add EloPlayerHandler.MEDIAN_ELO_LOSE

Dieser Commit ist enthalten in:
yoyosource 2023-06-26 21:42:51 +02:00
Ursprung 4385cd3589
Commit 4dad89ec34

Datei anzeigen

@ -43,7 +43,8 @@ import java.util.stream.Collectors;
public class EloPlayerHandler extends PacketHandler { public class EloPlayerHandler extends PacketHandler {
private static final int MEDIAN_ELO_GAIN = 20; private static final int MEDIAN_ELO_GAIN = 40;
private static final int MEDIAN_ELO_LOSE = 20;
private static final long REMATCH_LIFETIME = 1L * 60 * 60 * 1000; private static final long REMATCH_LIFETIME = 1L * 60 * 60 * 1000;
private Map<String, LinkedList<Game>> gameModeGames = new HashMap<>(); private Map<String, LinkedList<Game>> gameModeGames = new HashMap<>();
@ -120,9 +121,12 @@ public class EloPlayerHandler extends PacketHandler {
// Calculate division factor // Calculate division factor
double divisionFactor = 1D / Math.max(blueTeamSize, redTeamSize); double divisionFactor = 1D / Math.max(blueTeamSize, redTeamSize);
double blueFactor = bluePlayerFactor * timeFactor * blueEloFactor * rematchFactor * blueWinFactor * divisionFactor;
double redFactor = redPlayerFactor * timeFactor * redEloFactor * rematchFactor * redWinFactor * divisionFactor;
// Calculate the elo gain for each player // Calculate the elo gain for each player
int blueEloGain = (int) Math.round(MEDIAN_ELO_GAIN * bluePlayerFactor * timeFactor * blueEloFactor * rematchFactor * blueWinFactor * divisionFactor); int blueEloGain = (int) Math.round((blueFactor < 0 ? MEDIAN_ELO_LOSE : MEDIAN_ELO_GAIN) * blueFactor);
int redEloGain = (int) Math.round(MEDIAN_ELO_GAIN * redPlayerFactor * timeFactor * redEloFactor * rematchFactor * redWinFactor * divisionFactor); int redEloGain = (int) Math.round((redFactor < 0 ? MEDIAN_ELO_LOSE : MEDIAN_ELO_GAIN) * redFactor);
// BungeeCore.get().getLogger().info("Blue: " + fightEndsPacket.getBluePlayers() + " " + blueTeamSize + " " + bluePlayerFactor + " " + timeFactor + " " + blueEloFactor + " " + rematchFactor + " " + blueWinFactor + " " + divisionFactor + " " + blueEloGain); // BungeeCore.get().getLogger().info("Blue: " + fightEndsPacket.getBluePlayers() + " " + blueTeamSize + " " + bluePlayerFactor + " " + timeFactor + " " + blueEloFactor + " " + rematchFactor + " " + blueWinFactor + " " + divisionFactor + " " + blueEloGain);
// BungeeCore.get().getLogger().info("Red: " + fightEndsPacket.getRedPlayers() + " " + redTeamSize + " " + redPlayerFactor + " " + timeFactor + " " + redEloFactor + " " + rematchFactor + " " + redWinFactor + " " + divisionFactor + " " + redEloGain); // BungeeCore.get().getLogger().info("Red: " + fightEndsPacket.getRedPlayers() + " " + redTeamSize + " " + redPlayerFactor + " " + timeFactor + " " + redEloFactor + " " + rematchFactor + " " + redWinFactor + " " + divisionFactor + " " + redEloGain);