Merge branch 'develop' of github.com:Mineplex-LLC/Minecraft-PC into alex-compvanilla

This commit is contained in:
AlexTheCoder 2016-04-22 06:04:33 -04:00
commit 2f94b8cebc

View File

@ -36,7 +36,7 @@ public class EloManager extends MiniDbClientPlugin<EloClientData>
public int getElo(Player player, int gameType)
{
if (!Get(player).Elos.containsKey(gameType))
Get(player).Elos.put(gameType, 1000);
return 1000;
return Get(player).Elos.get(gameType);
}
@ -190,12 +190,24 @@ public class EloManager extends MiniDbClientPlugin<EloClientData>
// Use teams to calculate Elo
for (EloPlayer eloPlayer : teamWinnerNew.getPlayers())
{
saveElo(eloPlayer.getPlayer(), eloPlayer.getAccountId(), gameId, teamWinner.getPlayer(eloPlayer.getPlayer().getUniqueId().toString()).getRating(), eloPlayer.getRating());
int oldElo = teamWinner.getPlayer(eloPlayer.getPlayer().getUniqueId().toString()).getRating();
// If this is the first time.
if (!Get(eloPlayer.getPlayer()).Elos.containsKey(gameId))
oldElo = eloPlayer.getRating();
saveElo(eloPlayer.getPlayer(), eloPlayer.getAccountId(), gameId, oldElo, eloPlayer.getRating());
}
for (EloPlayer eloPlayer : teamLoserNew.getPlayers())
{
saveElo(eloPlayer.getPlayer(), eloPlayer.getAccountId(), gameId, teamLoser.getPlayer(eloPlayer.getPlayer().getUniqueId().toString()).getRating(), eloPlayer.getRating());
int oldElo = teamLoser.getPlayer(eloPlayer.getPlayer().getUniqueId().toString()).getRating();
// If this is the first time.
if (!Get(eloPlayer.getPlayer()).Elos.containsKey(gameId))
oldElo = eloPlayer.getRating();
saveElo(eloPlayer.getPlayer(), eloPlayer.getAccountId(), gameId, oldElo, eloPlayer.getRating());
}
_eloTeams.clear();