Merge branch 'features/elo' of github.com:Mineplex-LLC/Minecraft-PC into alex/elofix
This commit is contained in:
commit
03bdc8d2db
@ -21,12 +21,12 @@ public class EloManager extends MiniDbClientPlugin<EloClientData>
|
||||
_repository = new EloRepository(plugin);
|
||||
_ratingSystem = new EloRatingSystem
|
||||
(
|
||||
new KFactor(0, 1299, 30),
|
||||
new KFactor(1300, 1899, 25),
|
||||
new KFactor(1900, 2499, 20),
|
||||
new KFactor(2500, 3099, 15),
|
||||
new KFactor(3100, 3699, 10),
|
||||
new KFactor(3700, 5000, 5)
|
||||
new KFactor(0, 1299, 50),
|
||||
new KFactor(1300, 1899, 45),
|
||||
new KFactor(1900, 2499, 40),
|
||||
new KFactor(2500, 3099, 30),
|
||||
new KFactor(3100, 3699, 20),
|
||||
new KFactor(3700, 5000, 10)
|
||||
);
|
||||
}
|
||||
|
||||
@ -42,11 +42,9 @@ public class EloManager extends MiniDbClientPlugin<EloClientData>
|
||||
{
|
||||
EloTeam newTeam = new EloTeam();
|
||||
|
||||
int newTotal = _ratingSystem.getNewRating(teamA.TotalElo / teamA.getPlayers().size(), teamB.TotalElo / teamB.getPlayers().size(), result) * teamA.getPlayers().size();
|
||||
|
||||
for (EloPlayer player : teamA.getPlayers())
|
||||
{
|
||||
int newRating = (int)(player.getRating() + ((double)player.getRating() / (double)teamA.TotalElo) * (newTotal - teamA.TotalElo));
|
||||
int newRating = _ratingSystem.getNewRating(player.getRating(), (teamB.TotalElo / teamB.getPlayers().size()), result);
|
||||
EloPlayer newPlayer = new EloPlayer(player.getPlayer(), newRating);
|
||||
|
||||
newTeam.addPlayer(newPlayer);
|
||||
|
@ -1070,6 +1070,9 @@ public class GameLobbyManager implements Listener
|
||||
}
|
||||
|
||||
int line = 15;
|
||||
|
||||
if (Manager.GetGame() != null && Manager.GetGame().EloRanking && Manager.GetGame().EloSetting.getEloSetting() > 0)
|
||||
line += Manager.GetGame().EloSetting.getEloSetting() * 4;
|
||||
|
||||
objective.getScore(" ").setScore(line--);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user