mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
sql fixes & more
fixes slconfig sql error fixes nickclean npe fixes a few command inconsistensies
This commit is contained in:
parent
495133da1a
commit
6cd995ff52
@ -79,7 +79,7 @@ public class Command_modifyitem extends FreedomCommand
|
||||
Enchantment enchantment = Enchantment.getByName(args[1].toUpperCase());
|
||||
if (enchantment == null)
|
||||
{
|
||||
msg("Invalid enchantment. Please run /enchantments for a list of valid enchantments.");
|
||||
msg("Invalid enchantment. Please run /enchant list for a list of valid enchantments.");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.ADMIN, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Manage your admin entry.", usage = "/<command> [-o <admin name>] <clearips | clearip <ip> | setlogin <message> | clearlogin | setscformat <format> | clearscformat> | oldtags | logstick | syncroles>")
|
||||
@CommandParameters(description = "Manage your admin entry.", usage = "/<command> [-o <admin name>] <clearips | clearip <ip> | setscformat <format> | clearscformat> | syncroles>")
|
||||
public class Command_myadmin extends FreedomCommand
|
||||
{
|
||||
@Override
|
||||
@ -76,7 +76,7 @@ public class Command_myadmin extends FreedomCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
FUtil.staffAction(sender.getName(), "Clearing " + target.getName() + "' IPs", true);
|
||||
FUtil.staffAction(sender.getName(), "Clearing " + target.getName() + "'s IPs", true);
|
||||
}
|
||||
|
||||
int counter = target.getIps().size() - 1;
|
||||
|
@ -72,8 +72,9 @@ public class Command_nickclean extends FreedomCommand
|
||||
final String nickName = plugin.esb.getNickname(playerName);
|
||||
StringBuilder newNick = new StringBuilder();
|
||||
boolean nickChanged = false;
|
||||
|
||||
if(nickName.contains("§x"))
|
||||
if (nickName != null)
|
||||
{
|
||||
if (nickName.contains("§x"))
|
||||
{
|
||||
// Detects colors that are similar to blocked codes.
|
||||
spliterator:
|
||||
@ -140,8 +141,9 @@ public class Command_nickclean extends FreedomCommand
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(nickChanged)
|
||||
if (nickChanged)
|
||||
{
|
||||
msg(ChatColor.RESET + playerName + ": \"" + nickName + ChatColor.RESET + "\" -> \"" + newNick.toString() + ChatColor.RESET + "\".");
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ public class PlayerData
|
||||
.append("- Tag: ").append(FUtil.colorize(tag)).append(ChatColor.GRAY).append("\n")
|
||||
.append("- Ride Mode: ").append(rideMode).append("\n")
|
||||
.append("- Backup Codes: ").append(backupCodes.size()).append("/10").append("\n")
|
||||
.append("- Reddit Username: ").append(redditUsername)
|
||||
.append("- Reddit Username: ").append(redditUsername).append("\n")
|
||||
.append("- Login Message: ").append(loginMessage);
|
||||
|
||||
return output.toString();
|
||||
|
@ -247,16 +247,16 @@ public class SQLite extends FreedomService
|
||||
{
|
||||
try
|
||||
{
|
||||
PreparedStatement statement = connection.prepareStatement("INSERT INTO staff VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
||||
PreparedStatement statement = connection.prepareStatement("INSERT INTO staff VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
||||
statement.setString(1, staffMember.getName());
|
||||
statement.setString(2, FUtil.listToString(staffMember.getIps()));
|
||||
statement.setString(3, staffMember.getRank().toString());
|
||||
statement.setBoolean(4, staffMember.isActive());
|
||||
statement.setLong(5, staffMember.getLastLogin().getTime());
|
||||
statement.setBoolean(7, staffMember.getCommandSpy());
|
||||
statement.setBoolean(8, staffMember.getPotionSpy());
|
||||
statement.setString(9, staffMember.getAcFormat());
|
||||
statement.setString(10, staffMember.getPteroID());
|
||||
statement.setBoolean(6, staffMember.getCommandSpy());
|
||||
statement.setBoolean(7, staffMember.getPotionSpy());
|
||||
statement.setString(8, staffMember.getAcFormat());
|
||||
statement.setString(9, staffMember.getPteroID());
|
||||
statement.executeUpdate();
|
||||
}
|
||||
catch (SQLException e)
|
||||
@ -270,7 +270,7 @@ public class SQLite extends FreedomService
|
||||
{
|
||||
try
|
||||
{
|
||||
PreparedStatement statement = connection.prepareStatement("INSERT INTO players VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
||||
PreparedStatement statement = connection.prepareStatement("INSERT INTO players VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
|
||||
statement.setString(1, player.getName());
|
||||
statement.setString(2, FUtil.listToString(player.getIps()));
|
||||
statement.setString(3, FUtil.listToString(player.getNotes()));
|
||||
@ -281,11 +281,11 @@ public class SQLite extends FreedomService
|
||||
statement.setBoolean(8, player.hasVerification());
|
||||
statement.setString(9, player.getRideMode());
|
||||
statement.setInt(10, player.getCoins());
|
||||
statement.setString(12, FUtil.listToString(player.getItems()));
|
||||
statement.setInt(13, player.getTotalVotes());
|
||||
statement.setBoolean(14, player.doesDisplayDiscord());
|
||||
statement.setString(15, player.getRedditUsername());
|
||||
statement.setString(16, player.getLoginMessage());
|
||||
statement.setString(11, FUtil.listToString(player.getItems()));
|
||||
statement.setInt(12, player.getTotalVotes());
|
||||
statement.setBoolean(13, player.doesDisplayDiscord());
|
||||
statement.setString(14, player.getRedditUsername());
|
||||
statement.setString(15, player.getLoginMessage());
|
||||
statement.executeUpdate();
|
||||
}
|
||||
catch (SQLException e)
|
||||
|
Loading…
Reference in New Issue
Block a user