From 87abb0a9641bd4a98433662acb8de0968e8f9b22 Mon Sep 17 00:00:00 2001 From: spacerocket62 Date: Fri, 6 Nov 2020 10:19:38 -0800 Subject: [PATCH] add to central data class add vanished variable to plexplayers finish admin cmd except msgs aren't done fix command source and plexcommand add sender source to admin events add admin listener register admin listener simplify playerlistener fix sql syntax on sqlconnection --- .../me/totalfreedom/plex/cache/DataUtils.java | 10 +++ .../plex/cache/MongoPlayerData.java | 3 +- .../plex/cache/SQLPlayerData.java | 15 ++-- .../plex/command/IPlexCommand.java | 1 + .../plex/command/PlexCommand.java | 19 +++-- .../plex/command/impl/AdminCMD.java | 79 ++++++++++++++----- .../plex/command/source/CommandSource.java | 2 + .../plex/event/AdminAddEvent.java | 16 +++- .../plex/event/AdminRemoveEvent.java | 16 +++- .../plex/event/AdminSetRankEvent.java | 16 +++- .../plex/handlers/ListenerHandler.java | 7 +- .../plex/listener/impl/AdminListener.java | 44 +++++++++++ .../plex/listener/impl/PlayerListener.java | 19 ++++- .../totalfreedom/plex/player/PlexPlayer.java | 4 + .../plex/storage/SQLConnection.java | 7 +- 15 files changed, 205 insertions(+), 53 deletions(-) create mode 100644 src/main/java/me/totalfreedom/plex/listener/impl/AdminListener.java diff --git a/src/main/java/me/totalfreedom/plex/cache/DataUtils.java b/src/main/java/me/totalfreedom/plex/cache/DataUtils.java index 2e70789..df3b7c2 100644 --- a/src/main/java/me/totalfreedom/plex/cache/DataUtils.java +++ b/src/main/java/me/totalfreedom/plex/cache/DataUtils.java @@ -54,4 +54,14 @@ public class DataUtils } } + public static void insert(PlexPlayer plexPlayer) + { + if (Plex.get().getStorageType() == StorageType.MONGO) + { + Plex.get().getMongoPlayerData().save(plexPlayer); + } else { + Plex.get().getSqlPlayerData().insert(plexPlayer); + } + } + } diff --git a/src/main/java/me/totalfreedom/plex/cache/MongoPlayerData.java b/src/main/java/me/totalfreedom/plex/cache/MongoPlayerData.java index 1349d1b..ed29e78 100644 --- a/src/main/java/me/totalfreedom/plex/cache/MongoPlayerData.java +++ b/src/main/java/me/totalfreedom/plex/cache/MongoPlayerData.java @@ -49,7 +49,8 @@ public class MongoPlayerData UpdateOperators.set("prefix", player.getPrefix()), UpdateOperators.set("rank", player.getRank().toLowerCase()), UpdateOperators.set("ips", player.getIps()), - UpdateOperators.set("coins", player.getCoins())); + UpdateOperators.set("coins", player.getCoins()), + UpdateOperators.set("vanished", player.isVanished())); updateOps.execute(); } diff --git a/src/main/java/me/totalfreedom/plex/cache/SQLPlayerData.java b/src/main/java/me/totalfreedom/plex/cache/SQLPlayerData.java index e282f8d..0477bf3 100644 --- a/src/main/java/me/totalfreedom/plex/cache/SQLPlayerData.java +++ b/src/main/java/me/totalfreedom/plex/cache/SQLPlayerData.java @@ -14,8 +14,8 @@ import me.totalfreedom.plex.player.PlexPlayer; 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=?, coins=? WHERE uuid=?"; - private final String INSERT = "INSERT INTO `players` (`uuid`, `name`, `login_msg`, `prefix`, `rank`, `ips`, `coins`) VALUES (?, ?, ?, ?, ?, ?, ?);"; + private final String UPDATE = "UPDATE `players` SET name=?, login_msg=?, prefix=?, rank=?, ips=?, coins=?, vanished=? WHERE uuid=?"; + private final String INSERT = "INSERT INTO `players` (`uuid`, `name`, `login_msg`, `prefix`, `rank`, `ips`, `coins`, `vanished`) VALUES (?, ?, ?, ?, ?, ?, ?, ?);"; public boolean exists(UUID uuid) { @@ -53,15 +53,15 @@ public class SQLPlayerData String prefix = set.getString("prefix"); String rankName = set.getString("rank").toUpperCase(); long coins = set.getLong("coins"); - List ips = new Gson().fromJson(set.getString("ips"), new TypeToken>() - { - }.getType()); + boolean vanished = set.getBoolean("vanished"); + List ips = new Gson().fromJson(set.getString("ips"), new TypeToken>(){}.getType()); plexPlayer.setName(name); plexPlayer.setLoginMSG(loginMSG); plexPlayer.setPrefix(prefix); plexPlayer.setRank(rankName); plexPlayer.setIps(ips); plexPlayer.setCoins(coins); + plexPlayer.setVanished(vanished); } return plexPlayer; } @@ -83,7 +83,8 @@ public class SQLPlayerData statement.setString(4, player.getRank().toLowerCase()); statement.setString(5, new Gson().toJson(player.getIps())); statement.setLong(6, player.getCoins()); - statement.setString(7, player.getUuid()); + statement.setBoolean(7, player.isVanished()); + statement.setString(8, player.getUuid()); statement.executeUpdate(); } catch (SQLException throwables) @@ -103,6 +104,8 @@ public class SQLPlayerData statement.setString(4, player.getPrefix()); statement.setString(5, player.getRank().toLowerCase()); statement.setString(6, new Gson().toJson(player.getIps())); + statement.setLong(7, player.getCoins()); + statement.setBoolean(8, player.isVanished()); statement.execute(); } catch (SQLException throwables) diff --git a/src/main/java/me/totalfreedom/plex/command/IPlexCommand.java b/src/main/java/me/totalfreedom/plex/command/IPlexCommand.java index 624d726..70b75f8 100644 --- a/src/main/java/me/totalfreedom/plex/command/IPlexCommand.java +++ b/src/main/java/me/totalfreedom/plex/command/IPlexCommand.java @@ -2,6 +2,7 @@ package me.totalfreedom.plex.command; import java.util.List; import me.totalfreedom.plex.command.source.CommandSource; +import org.bukkit.command.CommandSender; public interface IPlexCommand { diff --git a/src/main/java/me/totalfreedom/plex/command/PlexCommand.java b/src/main/java/me/totalfreedom/plex/command/PlexCommand.java index 29288f2..3b771de 100644 --- a/src/main/java/me/totalfreedom/plex/command/PlexCommand.java +++ b/src/main/java/me/totalfreedom/plex/command/PlexCommand.java @@ -74,11 +74,7 @@ public abstract class PlexCommand extends Command implements TabExecutor, IPlexC { return false; } - if (this.sender == null) - { - this.sender = new CommandSource(sender); - } - PlexLog.log(this.sender.getSender().getName()); + if (commandSource == RequiredCommandSource.CONSOLE && sender instanceof Player) { sender.sendMessage(tl("noPermissionInGame")); @@ -92,6 +88,8 @@ public abstract class PlexCommand extends Command implements TabExecutor, IPlexC return true; } Player player = (Player)sender; + + this.sender = new CommandSource(player); PlexPlayer plexPlayer = PlayerCache.getPlexPlayerMap().get(player.getUniqueId()); if (!plexPlayer.getRankFromString().isAtLeast(getLevel())) { @@ -101,6 +99,7 @@ public abstract class PlexCommand extends Command implements TabExecutor, IPlexC } try { + this.sender = new CommandSource(sender); execute(this.sender, args); } catch (CommandArgumentException ex) @@ -121,13 +120,12 @@ public abstract class PlexCommand extends Command implements TabExecutor, IPlexC { return ImmutableList.of(); } - if (this.sender == null) - { - this.sender = new CommandSource(sender); - } if (sender instanceof Player) { Player player = (Player)sender; + + this.sender = new CommandSource(player); + PlexPlayer plexPlayer = PlayerCache.getPlexPlayerMap().get(player.getUniqueId()); if (plexPlayer.getRankFromString().isAtLeast(getLevel())) { @@ -140,6 +138,7 @@ public abstract class PlexCommand extends Command implements TabExecutor, IPlexC } else { + this.sender = new CommandSource(sender); return onTabComplete(this.sender, args); } } @@ -192,7 +191,7 @@ public abstract class PlexCommand extends Command implements TabExecutor, IPlexC protected boolean isConsole() { - return sender instanceof ConsoleCommandSender; + return !(sender instanceof Player); } protected String tl(String s, Object... objects) diff --git a/src/main/java/me/totalfreedom/plex/command/impl/AdminCMD.java b/src/main/java/me/totalfreedom/plex/command/impl/AdminCMD.java index 025a1fd..b4deee1 100644 --- a/src/main/java/me/totalfreedom/plex/command/impl/AdminCMD.java +++ b/src/main/java/me/totalfreedom/plex/command/impl/AdminCMD.java @@ -20,10 +20,12 @@ import me.totalfreedom.plex.util.PlexUtils; import org.apache.commons.lang.StringUtils; import org.bukkit.Bukkit; -@CommandPermissions(level = Rank.SENIOR_ADMIN, source = RequiredCommandSource.CONSOLE) +@CommandPermissions(level = Rank.SENIOR_ADMIN, source = RequiredCommandSource.ANY) @CommandParameters(usage = "/ [player] [rank]", aliases = "saconfig,slconfig,adminconfig,adminmanage", description = "Manage all admins") public class AdminCMD extends PlexCommand { + //TODO: Better return messages + public AdminCMD() { super("admin"); @@ -46,23 +48,9 @@ public class AdminCMD extends PlexCommand return; } - UUID targetUUID = PlexUtils.getFromName(args[1]); - - if (targetUUID == null || !DataUtils.hasPlayedBefore(targetUUID)) + if (!sender.isConsoleSender()) { - throw new PlayerNotFoundException(); - } - PlexPlayer plexPlayer = DataUtils.getPlayer(targetUUID); - plexPlayer.setRank(Rank.ADMIN.name()); - DataUtils.update(plexPlayer); - Bukkit.getServer().getPluginManager().callEvent(new AdminAddEvent(plexPlayer)); - return; - } - if (args[0].equalsIgnoreCase("remove")) - { - if (args.length != 2) - { - sender.send(usage("/admin remove ")); + sender.send("Console only"); return; } @@ -73,9 +61,49 @@ public class AdminCMD extends PlexCommand throw new PlayerNotFoundException(); } PlexPlayer plexPlayer = DataUtils.getPlayer(targetUUID); + + if (isAdmin(plexPlayer)) + { + sender.send("Player is an admin"); + return; + } + + plexPlayer.setRank(Rank.ADMIN.name()); + DataUtils.update(plexPlayer); + Bukkit.getServer().getPluginManager().callEvent(new AdminAddEvent(sender, plexPlayer)); + return; + } + if (args[0].equalsIgnoreCase("remove")) + { + if (args.length != 2) + { + sender.send(usage("/admin remove ")); + return; + } + + if (!sender.isConsoleSender()) + { + sender.send("Console only"); + return; + } + + UUID targetUUID = PlexUtils.getFromName(args[1]); + + if (targetUUID == null || !DataUtils.hasPlayedBefore(targetUUID)) + { + throw new PlayerNotFoundException(); + } + PlexPlayer plexPlayer = DataUtils.getPlayer(targetUUID); + + if (!isAdmin(plexPlayer)) + { + sender.send("Player is not an admin"); + return; + } + plexPlayer.setRank(""); DataUtils.update(plexPlayer); - Bukkit.getServer().getPluginManager().callEvent(new AdminRemoveEvent(plexPlayer)); + Bukkit.getServer().getPluginManager().callEvent(new AdminRemoveEvent(sender, plexPlayer)); return; } @@ -87,6 +115,12 @@ public class AdminCMD extends PlexCommand return; } + if (!sender.isConsoleSender()) + { + sender.send("Console only"); + return; + } + UUID targetUUID = PlexUtils.getFromName(args[1]); if (targetUUID == null || !DataUtils.hasPlayedBefore(targetUUID)) @@ -109,10 +143,17 @@ public class AdminCMD extends PlexCommand } PlexPlayer plexPlayer = DataUtils.getPlayer(targetUUID); + + if (!isAdmin(plexPlayer)) + { + sender.send("Player is not an admin"); + return; + } + plexPlayer.setRank(rank.name().toLowerCase()); DataUtils.update(plexPlayer); - Bukkit.getServer().getPluginManager().callEvent(new AdminSetRankEvent(plexPlayer, rank)); + Bukkit.getServer().getPluginManager().callEvent(new AdminSetRankEvent(sender, plexPlayer, rank)); return; } diff --git a/src/main/java/me/totalfreedom/plex/command/source/CommandSource.java b/src/main/java/me/totalfreedom/plex/command/source/CommandSource.java index 3330453..e8eed87 100644 --- a/src/main/java/me/totalfreedom/plex/command/source/CommandSource.java +++ b/src/main/java/me/totalfreedom/plex/command/source/CommandSource.java @@ -13,10 +13,12 @@ public class CommandSource private final CommandSender sender; private final Player player; private final PlexPlayer plexPlayer; + private final boolean isConsoleSender; public CommandSource(CommandSender sender) { this.sender = sender; + this.isConsoleSender = !(sender instanceof Player); this.player = sender instanceof Player ? Bukkit.getPlayer(sender.getName()) : null; this.plexPlayer = sender instanceof Player ? PlayerCache.getPlexPlayerMap().get(((Player)sender).getUniqueId()) : null; } diff --git a/src/main/java/me/totalfreedom/plex/event/AdminAddEvent.java b/src/main/java/me/totalfreedom/plex/event/AdminAddEvent.java index 9782308..8c2309b 100644 --- a/src/main/java/me/totalfreedom/plex/event/AdminAddEvent.java +++ b/src/main/java/me/totalfreedom/plex/event/AdminAddEvent.java @@ -1,17 +1,20 @@ package me.totalfreedom.plex.event; +import me.totalfreedom.plex.command.source.CommandSource; import me.totalfreedom.plex.player.PlexPlayer; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; public class AdminAddEvent extends Event { - private final HandlerList handlers = new HandlerList(); + private static final HandlerList handlers = new HandlerList(); + private CommandSource sender; private PlexPlayer plexPlayer; - public AdminAddEvent(PlexPlayer plexPlayer) + public AdminAddEvent(CommandSource sender, PlexPlayer plexPlayer) { + this.sender = sender; this.plexPlayer = plexPlayer; } @@ -21,8 +24,17 @@ public class AdminAddEvent extends Event return handlers; } + public static HandlerList getHandlerList() + { + return handlers; + } + public PlexPlayer getPlexPlayer() { return plexPlayer; } + + public CommandSource getSender() { + return sender; + } } diff --git a/src/main/java/me/totalfreedom/plex/event/AdminRemoveEvent.java b/src/main/java/me/totalfreedom/plex/event/AdminRemoveEvent.java index 9451640..45058ae 100644 --- a/src/main/java/me/totalfreedom/plex/event/AdminRemoveEvent.java +++ b/src/main/java/me/totalfreedom/plex/event/AdminRemoveEvent.java @@ -1,17 +1,20 @@ package me.totalfreedom.plex.event; +import me.totalfreedom.plex.command.source.CommandSource; import me.totalfreedom.plex.player.PlexPlayer; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; public class AdminRemoveEvent extends Event { - private final HandlerList handlers = new HandlerList(); + private static final HandlerList handlers = new HandlerList(); private PlexPlayer plexPlayer; + private CommandSource sender; - public AdminRemoveEvent(PlexPlayer plexPlayer) + public AdminRemoveEvent(CommandSource sender, PlexPlayer plexPlayer) { + this.sender = sender; this.plexPlayer = plexPlayer; } @@ -21,8 +24,17 @@ public class AdminRemoveEvent extends Event return handlers; } + public static HandlerList getHandlerList() + { + return handlers; + } + public PlexPlayer getPlexPlayer() { return plexPlayer; } + + public CommandSource getSender() { + return sender; + } } diff --git a/src/main/java/me/totalfreedom/plex/event/AdminSetRankEvent.java b/src/main/java/me/totalfreedom/plex/event/AdminSetRankEvent.java index 245ec9d..a1ea779 100644 --- a/src/main/java/me/totalfreedom/plex/event/AdminSetRankEvent.java +++ b/src/main/java/me/totalfreedom/plex/event/AdminSetRankEvent.java @@ -1,5 +1,6 @@ package me.totalfreedom.plex.event; +import me.totalfreedom.plex.command.source.CommandSource; import me.totalfreedom.plex.player.PlexPlayer; import me.totalfreedom.plex.rank.enums.Rank; import org.bukkit.event.Event; @@ -7,13 +8,15 @@ import org.bukkit.event.HandlerList; public class AdminSetRankEvent extends Event { - private final HandlerList handlers = new HandlerList(); + private static final HandlerList handlers = new HandlerList(); + private CommandSource sender; private PlexPlayer plexPlayer; private Rank rank; - public AdminSetRankEvent(PlexPlayer plexPlayer, Rank rank) + public AdminSetRankEvent(CommandSource sender, PlexPlayer plexPlayer, Rank rank) { + this.sender = sender; this.plexPlayer = plexPlayer; this.rank = rank; } @@ -24,6 +27,11 @@ public class AdminSetRankEvent extends Event return handlers; } + public static HandlerList getHandlerList() + { + return handlers; + } + public PlexPlayer getPlexPlayer() { return plexPlayer; @@ -33,4 +41,8 @@ public class AdminSetRankEvent extends Event { return rank; } + + public CommandSource getSender() { + return sender; + } } diff --git a/src/main/java/me/totalfreedom/plex/handlers/ListenerHandler.java b/src/main/java/me/totalfreedom/plex/handlers/ListenerHandler.java index 4d50dd9..ef7a141 100644 --- a/src/main/java/me/totalfreedom/plex/handlers/ListenerHandler.java +++ b/src/main/java/me/totalfreedom/plex/handlers/ListenerHandler.java @@ -3,11 +3,7 @@ package me.totalfreedom.plex.handlers; import com.google.common.collect.Lists; import java.util.List; import me.totalfreedom.plex.listener.PlexListener; -import me.totalfreedom.plex.listener.impl.ChatListener; -import me.totalfreedom.plex.listener.impl.FreezeListener; -import me.totalfreedom.plex.listener.impl.PlayerListener; -import me.totalfreedom.plex.listener.impl.ServerListener; -import me.totalfreedom.plex.listener.impl.WorldListener; +import me.totalfreedom.plex.listener.impl.*; import me.totalfreedom.plex.util.PlexLog; public class ListenerHandler @@ -21,6 +17,7 @@ public class ListenerHandler listeners.add(new PlayerListener()); listeners.add(new WorldListener()); listeners.add(new FreezeListener()); + listeners.add(new AdminListener()); PlexLog.log(String.format("Registered %s listeners!", listeners.size())); } } diff --git a/src/main/java/me/totalfreedom/plex/listener/impl/AdminListener.java b/src/main/java/me/totalfreedom/plex/listener/impl/AdminListener.java new file mode 100644 index 0000000..a60db9d --- /dev/null +++ b/src/main/java/me/totalfreedom/plex/listener/impl/AdminListener.java @@ -0,0 +1,44 @@ +package me.totalfreedom.plex.listener.impl; + +import me.totalfreedom.plex.event.AdminAddEvent; +import me.totalfreedom.plex.event.AdminRemoveEvent; +import me.totalfreedom.plex.event.AdminSetRankEvent; +import me.totalfreedom.plex.listener.PlexListener; +import me.totalfreedom.plex.player.PlexPlayer; +import me.totalfreedom.plex.rank.enums.Rank; +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.event.EventHandler; + +public class AdminListener extends PlexListener +{ + + @EventHandler + public void onAdminAdd(AdminAddEvent event) + { + String userSender = event.getSender().getName(); + PlexPlayer target = event.getPlexPlayer(); + + Bukkit.broadcastMessage(String.format(ChatColor.RED + "%s - Adding %s to the admin list!", userSender, target.getName())); + } + + @EventHandler + public void onAdminRemove(AdminRemoveEvent event) + { + String userSender = event.getSender().getName(); + PlexPlayer target = event.getPlexPlayer(); + + Bukkit.broadcastMessage(String.format(ChatColor.RED + "%s - Removing %s from the admin list!", userSender, target.getName())); + } + + @EventHandler + public void onAdminSetrank(AdminSetRankEvent event) + { + String userSender = event.getSender().getName(); + PlexPlayer target = event.getPlexPlayer(); + Rank newRank = event.getRank(); + + Bukkit.broadcastMessage(String.format(ChatColor.RED + "%s - Setting %s's rank to %s!", userSender, target.getName(), newRank.name().toUpperCase())); + } + +} diff --git a/src/main/java/me/totalfreedom/plex/listener/impl/PlayerListener.java b/src/main/java/me/totalfreedom/plex/listener/impl/PlayerListener.java index 0c59379..909dc05 100644 --- a/src/main/java/me/totalfreedom/plex/listener/impl/PlayerListener.java +++ b/src/main/java/me/totalfreedom/plex/listener/impl/PlayerListener.java @@ -3,6 +3,7 @@ package me.totalfreedom.plex.listener.impl; import java.util.Arrays; import java.util.UUID; import me.totalfreedom.plex.admin.Admin; +import me.totalfreedom.plex.cache.DataUtils; import me.totalfreedom.plex.cache.MongoPlayerData; import me.totalfreedom.plex.cache.PlayerCache; import me.totalfreedom.plex.cache.SQLPlayerData; @@ -30,9 +31,21 @@ public class PlayerListener extends PlexListener { Player player = event.getPlayer(); - PlexPlayer plexPlayer = null; + PlexPlayer plexPlayer; - if (mongoPlayerData != null) // Alright, check if we're saving with Mongo first + if (!DataUtils.hasPlayedBefore(player.getUniqueId())) + { + PlexLog.log("AYO THIS MAN DONT EXIST"); // funi msg + plexPlayer = new PlexPlayer(player.getUniqueId()); //it doesn't! okay so now create the object + plexPlayer.setName(player.getName()); //set the name of the player + plexPlayer.setIps(Arrays.asList(player.getAddress().getAddress().getHostAddress().trim())); //set the arraylist of ips + + DataUtils.insert(plexPlayer); // insert data in some wack db + } else { + plexPlayer = DataUtils.getPlayer(player.getUniqueId()); + } + + /*if (mongoPlayerData != null) // Alright, check if we're saving with Mongo first { if (!mongoPlayerData.exists(player.getUniqueId())) //okay, we're saving with mongo! now check if the player's document exists { @@ -64,7 +77,7 @@ public class PlayerListener extends PlexListener plexPlayer = sqlPlayerData.getByUUID(player.getUniqueId()); //oh they do exist! plexPlayer.setName(plexPlayer.getName()); //set the name! } - } + }*/ PlayerCache.getPlexPlayerMap().put(player.getUniqueId(), plexPlayer); //put them into the cache PlayerCache.getPunishedPlayerMap().put(player.getUniqueId(), new PunishedPlayer(player.getUniqueId())); diff --git a/src/main/java/me/totalfreedom/plex/player/PlexPlayer.java b/src/main/java/me/totalfreedom/plex/player/PlexPlayer.java index 3dd3a8b..59b85a3 100644 --- a/src/main/java/me/totalfreedom/plex/player/PlexPlayer.java +++ b/src/main/java/me/totalfreedom/plex/player/PlexPlayer.java @@ -33,6 +33,8 @@ public class PlexPlayer private String loginMSG; private String prefix; + private boolean vanished; + private long coins; private String rank; @@ -54,6 +56,8 @@ public class PlexPlayer this.loginMSG = ""; this.prefix = ""; + this.vanished = false; + this.coins = 0; this.ips = new ArrayList<>(); diff --git a/src/main/java/me/totalfreedom/plex/storage/SQLConnection.java b/src/main/java/me/totalfreedom/plex/storage/SQLConnection.java index 5c072bd..2e4380a 100644 --- a/src/main/java/me/totalfreedom/plex/storage/SQLConnection.java +++ b/src/main/java/me/totalfreedom/plex/storage/SQLConnection.java @@ -42,14 +42,15 @@ public class SQLConnection extends PlexBase if (connection != null) { connection.prepareStatement("CREATE TABLE IF NOT EXISTS `players` (\n" + - "\t`uuid` VARCHAR(46),\n" + + "\t`uuid` VARCHAR(46) NOT NULL,\n" + "\t`name` VARCHAR(18),\n" + "\t`login_msg` VARCHAR,\n" + "\t`prefix` VARCHAR,\n" + "\t`rank` VARCHAR,\n" + "\t`ips` VARCHAR,\n" + - "\t`coins` INT\n" + - //"\tPRIMARY KEY (`uuid`)\n" + + "\t`coins` BIGINT,\n" + + "\t`vanished` BOOLEAN,\n" + + "\tPRIMARY KEY (`uuid`)\n" + ");").execute(); } }