diff --git a/src/de/steamwar/bungeecore/network/handlers/EloPlayerHandler.java b/src/de/steamwar/bungeecore/network/handlers/EloPlayerHandler.java index 273acf4c..70f57523 100644 --- a/src/de/steamwar/bungeecore/network/handlers/EloPlayerHandler.java +++ b/src/de/steamwar/bungeecore/network/handlers/EloPlayerHandler.java @@ -43,7 +43,8 @@ import java.util.stream.Collectors; 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 Map> gameModeGames = new HashMap<>(); @@ -120,9 +121,12 @@ public class EloPlayerHandler extends PacketHandler { // Calculate division factor 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 - int blueEloGain = (int) Math.round(MEDIAN_ELO_GAIN * bluePlayerFactor * timeFactor * blueEloFactor * rematchFactor * blueWinFactor * divisionFactor); - int redEloGain = (int) Math.round(MEDIAN_ELO_GAIN * redPlayerFactor * timeFactor * redEloFactor * rematchFactor * redWinFactor * divisionFactor); + int blueEloGain = (int) Math.round((blueFactor < 0 ? MEDIAN_ELO_LOSE : MEDIAN_ELO_GAIN) * blueFactor); + 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("Red: " + fightEndsPacket.getRedPlayers() + " " + redTeamSize + " " + redPlayerFactor + " " + timeFactor + " " + redEloFactor + " " + rematchFactor + " " + redWinFactor + " " + divisionFactor + " " + redEloGain);