mirror of
https://github.com/plexusorg/Plex.git
synced 2024-12-22 09:07:37 +00:00
lol i forgot to add coins to player data
This commit is contained in:
parent
5400581b3d
commit
9dfc351ebe
@ -50,6 +50,7 @@ public class MongoPlayerData
|
||||
updateOps.set("prefix", player.getPrefix());
|
||||
updateOps.set("rank", player.getRank() == null ? "" : player.getRank().name().toLowerCase());
|
||||
updateOps.set("ips", player.getIps());
|
||||
updateOps.set("coins", player.getCoins());
|
||||
plexPlayerDAO.update(filter, updateOps);
|
||||
}
|
||||
|
||||
|
@ -17,8 +17,8 @@ public class SQLPlayerData
|
||||
{
|
||||
|
||||
private final String SELECT = "SELECT * FROM `players` WHERE uuid=?";
|
||||
private final String UPDATE = "UPDATE `players` SET name=?, login_msg=?, prefix=?, rank=?, ips=? WHERE uuid=?";
|
||||
private final String INSERT = "INSERT INTO `players` (`uuid`, `name`, `login_msg`, `prefix`, `rank`, `ips`) VALUES (?, ?, ?, ?, ?, ?);";
|
||||
private final String UPDATE = "UPDATE `players` SET name=?, login_msg=?, prefix=?, rank=?, ips=?, coins=? WHERE uuid=?";
|
||||
private final String INSERT = "INSERT INTO `players` (`uuid`, `name`, `login_msg`, `prefix`, `rank`, `ips`, `coins`) VALUES (?, ?, ?, ?, ?, ?, ?);";
|
||||
|
||||
public boolean exists(UUID uuid)
|
||||
{
|
||||
@ -54,6 +54,7 @@ public class SQLPlayerData
|
||||
String loginMSG = set.getString("login_msg");
|
||||
String prefix = set.getString("prefix");
|
||||
String rankName = set.getString("rank").toUpperCase();
|
||||
long coins = set.getLong("coins");
|
||||
Rank rank = Rank.valueOf(rankName);
|
||||
List<String> ips = new Gson().fromJson(set.getString("ips"), new TypeToken<List<String>>(){}.getType());
|
||||
plexPlayer.setName(name);
|
||||
@ -61,6 +62,7 @@ public class SQLPlayerData
|
||||
plexPlayer.setPrefix(prefix);
|
||||
plexPlayer.setRank(rankName.isEmpty() ? null : rank);
|
||||
plexPlayer.setIps(ips);
|
||||
plexPlayer.setCoins(coins);
|
||||
}
|
||||
return plexPlayer;
|
||||
}
|
||||
@ -80,7 +82,8 @@ public class SQLPlayerData
|
||||
statement.setString(3, player.getPrefix());
|
||||
statement.setString(4, player.getRank() == null ? "" : player.getRank().name().toLowerCase());
|
||||
statement.setString(5, new Gson().toJson(player.getIps()));
|
||||
statement.setString(6, player.getUuid());
|
||||
statement.setLong(6, player.getCoins());
|
||||
statement.setString(7, player.getUuid());
|
||||
statement.executeUpdate();
|
||||
}
|
||||
catch (SQLException throwables) {
|
||||
|
@ -33,6 +33,8 @@ public class PlexPlayer
|
||||
private String loginMSG;
|
||||
private String prefix;
|
||||
|
||||
private long coins;
|
||||
|
||||
private Rank rank;
|
||||
|
||||
private List<String> ips;
|
||||
@ -50,6 +52,8 @@ public class PlexPlayer
|
||||
this.loginMSG = "";
|
||||
this.prefix = "";
|
||||
|
||||
this.coins = 0;
|
||||
|
||||
this.ips = new ArrayList<>();
|
||||
|
||||
this.rank = null;
|
||||
|
@ -44,6 +44,7 @@ public class SQLConnection
|
||||
"\t`prefix` VARCHAR(30),\n" +
|
||||
"\t`rank` VARCHAR(256),\n" +
|
||||
"\t`ips` VARCHAR(65535),\n" +
|
||||
"\t`coins` BIGINT,\n" +
|
||||
"\tPRIMARY KEY (`uuid`)\n" +
|
||||
");").execute();
|
||||
} catch (SQLException throwables) {
|
||||
|
Loading…
Reference in New Issue
Block a user