Merge branch 'features/elo' of github.com:Mineplex-LLC/Minecraft-PC into alex/elofix
This commit is contained in:
commit
2d2c8858e6
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user