Merge branch 'features/elo' of github.com:Mineplex-LLC/Minecraft-PC into alex/elofix

This commit is contained in:
AlexTheCoder 2016-04-22 02:06:55 -04:00
commit 2d2c8858e6

View File

@ -11,7 +11,7 @@ import org.bukkit.plugin.java.JavaPlugin;
public class EloRepository extends MinecraftRepository public class EloRepository extends MinecraftRepository
{ {
private static String INSERT_ELO = "INSERT INTO eloRating (accountId, gameType) VALUES (?, ?);"; private static String INSERT_ELO = "INSERT INTO eloRating (accountId, gameType, elo) VALUES (?, ?, ?);";
private static String UPDATE_ELO = "UPDATE eloRating SET elo=? WHERE accountId = ? AND gameType = ?;"; private static String UPDATE_ELO = "UPDATE eloRating SET elo=? WHERE accountId = ? AND gameType = ?;";
public EloRepository(JavaPlugin plugin) public EloRepository(JavaPlugin plugin)
@ -27,7 +27,7 @@ public class EloRepository extends MinecraftRepository
{ {
if (executeUpdate(UPDATE_ELO, new ColumnInt("elo", elo), new ColumnInt("accountId", accountId), new ColumnInt("gameType", gameType)) > 0) if (executeUpdate(UPDATE_ELO, new ColumnInt("elo", elo), new ColumnInt("accountId", accountId), new ColumnInt("gameType", gameType)) > 0)
return true; return true;
else if (executeUpdate(INSERT_ELO, new ColumnInt("elo", elo), new ColumnInt("accountId", accountId), new ColumnInt("gameType", gameType)) > 0) else if (executeUpdate(INSERT_ELO, new ColumnInt("accountId", accountId), new ColumnInt("gameType", gameType), new ColumnInt("elo", elo)) > 0)
return true; return true;
return false; return false;