From 60d5a04d0cb47f9f1b3967ee5049f41985d0fcf9 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Sun, 14 May 2023 12:35:52 +0200 Subject: [PATCH] Add logging --- .../bungeecore/network/handlers/EloPlayerHandler.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/de/steamwar/bungeecore/network/handlers/EloPlayerHandler.java b/src/de/steamwar/bungeecore/network/handlers/EloPlayerHandler.java index 115a9fb..58a5466 100644 --- a/src/de/steamwar/bungeecore/network/handlers/EloPlayerHandler.java +++ b/src/de/steamwar/bungeecore/network/handlers/EloPlayerHandler.java @@ -75,8 +75,8 @@ public class EloPlayerHandler extends PacketHandler { int redTeamSize = fightEndsPacket.getRedPlayers().size(); // Calculate the favored team - double bluePlayerFactor = 1 / (1 + Math.exp(-(fightEndsPacket.getWin() == 2 ? (double) redTeamSize / blueTeamSize : (double) blueTeamSize / redTeamSize) * 3 + 3)) * 2; - double redPlayerFactor = 1 / (1 + Math.exp(-(fightEndsPacket.getWin() == 1 ? (double) blueTeamSize / redTeamSize : (double) redTeamSize / blueTeamSize) * 3 + 3)) * 2; + double bluePlayerFactor = 1 / (1 + Math.exp(0 - (fightEndsPacket.getWin() == 2 ? (double) redTeamSize / blueTeamSize : (double) blueTeamSize / redTeamSize) * 3 + 3)) * 2; + double redPlayerFactor = 1 / (1 + Math.exp(0 - (fightEndsPacket.getWin() == 1 ? (double) blueTeamSize / redTeamSize : (double) redTeamSize / blueTeamSize) * 3 + 3)) * 2; // Calculate the time factor double timeFactor = getTimeFactor(fightEndsPacket.getDuration()); @@ -124,6 +124,9 @@ public class EloPlayerHandler extends PacketHandler { 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); + 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); + update(fightEndsPacket.getBluePlayers(), fightEndsPacket.getGameMode(), blueEloGain); update(fightEndsPacket.getBluePlayers(), fightEndsPacket.getGameMode(), redEloGain); }