mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-06-11 13:33:54 +00:00
yeah
This commit is contained in:
@ -1,53 +0,0 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.playerverification.VPlayer;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.OP, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Change your default chat color.", usage = "/<command> <color>")
|
||||
public class Command_chatcolor extends FreedomCommand
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
if (args.length != 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
VPlayer vPlayer = plugin.pv.getVerificationPlayer(playerSender);
|
||||
|
||||
if (args[0].equals("clear"))
|
||||
{
|
||||
vPlayer.setColor(null);
|
||||
msg("Default chat color cleared.");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args[0].equalsIgnoreCase("k")
|
||||
|| args[0].equalsIgnoreCase("0")
|
||||
|| args[0].equalsIgnoreCase("m"))
|
||||
{
|
||||
msg("You are not allowed to use that color as default.");
|
||||
return true;
|
||||
}
|
||||
|
||||
ChatColor color = ChatColor.getByChar(args[0]);
|
||||
if (color == null)
|
||||
{
|
||||
msg("Please enter a valid color. Example: a, 2, e");
|
||||
return true;
|
||||
}
|
||||
|
||||
vPlayer.setColor(color);
|
||||
msg("Default chat color set to \"" + args[0] + ".\"");
|
||||
return true;
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.SENIOR_ADMIN, source = SourceType.ONLY_CONSOLE)
|
||||
@CommandParameters(description = "Clear the discord message queue", usage = "/<command>")
|
||||
public class Command_cleardiscordqueue extends FreedomCommand
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
plugin.dc.clearQueue();
|
||||
msg("Cleared the discord message queue.");
|
||||
return true;
|
||||
}
|
||||
}
|
@ -1,26 +1,106 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import me.totalfreedom.totalfreedommod.util.Groups;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Remove various server entities that may cause lag, such as dropped items, minecarts, and boats.", usage = "/<command>", aliases = "ew,rd")
|
||||
@CommandParameters(description = "Remove various server entities that may cause lag, such as dropped items, minecarts, and boats.", usage = "/<command> [name | -a]", aliases = "ew,rd")
|
||||
public class Command_entitywipe extends FreedomCommand
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
FUtil.adminAction(sender.getName(), "Removing all server entities", true);
|
||||
int removed = plugin.ew.wipe();
|
||||
msg(removed + " entities removed.");
|
||||
EntityType type = null;
|
||||
String entityName = null;
|
||||
boolean bypassBlacklist = false;
|
||||
if (args.length > 0)
|
||||
{
|
||||
if (args[0].equals("-a"))
|
||||
{
|
||||
bypassBlacklist = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
type = EntityType.valueOf(args[0].toUpperCase());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
msg(args[0] + " is not a valid entity type.", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!getAllEntities().contains(type))
|
||||
{
|
||||
msg(FUtil.formatName(type.name()) + " is an entity, however: it is a mob.", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (type != null)
|
||||
{
|
||||
entityName = FUtil.formatName(type.name());
|
||||
}
|
||||
|
||||
FUtil.adminAction(sender.getName(), "Purging all " + (type != null ? entityName + "s" : "entities"), true);
|
||||
int count;
|
||||
if (type != null)
|
||||
{
|
||||
count = plugin.ew.wipeEntities(type);
|
||||
}
|
||||
else
|
||||
{
|
||||
count = plugin.ew.wipeEntities(bypassBlacklist);
|
||||
}
|
||||
msg(count + " " + (type != null ? entityName : "entities") + FUtil.showS(count) + " removed.");
|
||||
return true;
|
||||
}
|
||||
|
||||
public static List<EntityType> getAllEntities()
|
||||
{
|
||||
List<EntityType> entityTypes = new ArrayList<>();
|
||||
for (EntityType entityType : EntityType.values())
|
||||
{
|
||||
if (!Groups.MOB_TYPES.contains(entityType))
|
||||
{
|
||||
entityTypes.add(entityType);
|
||||
}
|
||||
}
|
||||
return entityTypes;
|
||||
}
|
||||
|
||||
public static List<String> getAllEntityNames()
|
||||
{
|
||||
List<String> names = new ArrayList<>();
|
||||
for (EntityType entityType : getAllEntities())
|
||||
{
|
||||
names.add(entityType.name());
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
||||
{
|
||||
List<String> names = getAllEntityNames();
|
||||
names.add("-a");
|
||||
if (args.length == 1)
|
||||
{
|
||||
return names;
|
||||
}
|
||||
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.util.Random;
|
||||
import me.totalfreedom.totalfreedommod.admin.Admin;
|
||||
import me.totalfreedom.totalfreedommod.discord.Discord;
|
||||
import me.totalfreedom.totalfreedommod.masterbuilder.MasterBuilder;
|
||||
import me.totalfreedom.totalfreedommod.playerverification.VPlayer;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import org.bukkit.ChatColor;
|
||||
@ -24,6 +24,8 @@ public class Command_linkdiscord extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
String code;
|
||||
|
||||
if (plugin.al.isAdmin(playerSender))
|
||||
{
|
||||
Admin admin = plugin.al.getAdmin(playerSender);
|
||||
@ -33,20 +35,33 @@ public class Command_linkdiscord extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Discord.LINK_CODES.containsValue(admin))
|
||||
if (Discord.ADMIN_LINK_CODES.containsValue(admin))
|
||||
{
|
||||
msg("Your linking code is " + ChatColor.GREEN + Discord.getCodeForAdmin(admin), ChatColor.AQUA);
|
||||
code = Discord.getCodeForAdmin(admin);
|
||||
}
|
||||
else
|
||||
{
|
||||
String code = "";
|
||||
Random random = new Random();
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
code += random.nextInt(10);
|
||||
}
|
||||
Discord.LINK_CODES.put(code, admin);
|
||||
msg("Your linking code is " + ChatColor.GREEN + code, ChatColor.AQUA);
|
||||
code = plugin.dc.generateCode(5);
|
||||
Discord.ADMIN_LINK_CODES.put(code, admin);
|
||||
}
|
||||
}
|
||||
else if (plugin.mbl.isMasterBuilder(playerSender))
|
||||
{
|
||||
MasterBuilder masterBuilder = plugin.mbl.getMasterBuilder(playerSender);
|
||||
if (masterBuilder.getDiscordID() != null)
|
||||
{
|
||||
msg("Your Minecraft account is already linked to a Discord account.", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Discord.MASTER_BUILDER_LINK_CODES.containsValue(masterBuilder))
|
||||
{
|
||||
code = Discord.getCodeForMasterBuilder(masterBuilder);
|
||||
}
|
||||
else
|
||||
{
|
||||
code = plugin.dc.generateCode(5);
|
||||
Discord.MASTER_BUILDER_LINK_CODES.put(code, masterBuilder);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -60,21 +75,16 @@ public class Command_linkdiscord extends FreedomCommand
|
||||
|
||||
if (Discord.PLAYER_LINK_CODES.containsValue(data))
|
||||
{
|
||||
msg("Your linking code is " + ChatColor.GREEN + Discord.getCodeForPlayer(data), ChatColor.AQUA);
|
||||
msg("Take this code and DM the server bot (" + plugin.dc.formatBotTag() + ") the code (do not put anything else in the message, only the code)");
|
||||
code = Discord.getCodeForPlayer(data);
|
||||
}
|
||||
else
|
||||
{
|
||||
String code = "";
|
||||
Random random = new Random();
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
code += random.nextInt(10);
|
||||
}
|
||||
code = plugin.dc.generateCode(5);
|
||||
Discord.PLAYER_LINK_CODES.put(code, data);
|
||||
msg("Your linking code is " + ChatColor.GREEN + code, ChatColor.AQUA);
|
||||
}
|
||||
}
|
||||
msg("Your linking code is " + ChatColor.AQUA + code, ChatColor.GREEN);
|
||||
msg("Take this code and DM the server bot (" + plugin.dc.formatBotTag() + ") the code (do not put anything else in the message, only the code)");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -6,15 +6,10 @@ import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import me.totalfreedom.totalfreedommod.util.Groups;
|
||||
import org.apache.commons.lang.WordUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@ -41,43 +36,22 @@ public class Command_mobpurge extends FreedomCommand
|
||||
|
||||
if (!Groups.MOB_TYPES.contains(type))
|
||||
{
|
||||
msg(WordUtils.capitalizeFully(type.name().replace("_", " ")) + " is an entity, however it is not a mob.", ChatColor.RED);
|
||||
msg(FUtil.formatName(type.name()) + " is an entity, however it is not a mob.", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (type != null)
|
||||
{
|
||||
mobName = WordUtils.capitalizeFully(type.name().replace("_", " "));
|
||||
mobName = FUtil.formatName(type.name());
|
||||
}
|
||||
|
||||
FUtil.adminAction(sender.getName(), "Purging all " + (type != null ? mobName + "s" : "mobs"), true);
|
||||
msg(purgeMobs(type) + " " + (type != null ? mobName : "mob") + "s removed.");
|
||||
FUtil.adminAction(sender.getName(), "Purging all " + (type != null ? mobName + "s" : "mobs"), true);
|
||||
int count = plugin.ew.purgeMobs(type);
|
||||
msg(count + " " + (type != null ? mobName : "mob") + FUtil.showS(count) + " removed.");
|
||||
return true;
|
||||
}
|
||||
|
||||
public static int purgeMobs(EntityType type)
|
||||
{
|
||||
int removed = 0;
|
||||
for (World world : Bukkit.getWorlds())
|
||||
{
|
||||
for (Entity ent : world.getLivingEntities())
|
||||
{
|
||||
if (ent instanceof LivingEntity && !(ent instanceof Player))
|
||||
{
|
||||
if (type != null && !ent.getType().equals(type))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
ent.remove();
|
||||
removed++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return removed;
|
||||
}
|
||||
|
||||
public static List<String> getAllMobNames()
|
||||
{
|
||||
List<String> names = new ArrayList<>();
|
||||
|
@ -1,6 +1,9 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.admin.Admin;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
@ -12,17 +15,14 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.OP, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Manage my admin entry", usage = "/<command> [-o <admin>] <clearips | clearip <ip> | setlogin <message> | clearlogin | setacformat <format> | clearacformat> | oldtags | logstick | syncroles>")
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Manage my admin entry", usage = "/<command> [-o <admin>] <clearips | clearip <ip> | setlogin <message> | clearlogin | setacformat <format> | clearacformat> | oldtags | logstick | syncroles | genbackupcodes>")
|
||||
public class Command_myadmin extends FreedomCommand
|
||||
{
|
||||
|
||||
@Override
|
||||
protected boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
checkPlayer();
|
||||
checkRank(Rank.SUPER_ADMIN);
|
||||
|
||||
if (args.length < 1)
|
||||
{
|
||||
return false;
|
||||
@ -47,7 +47,7 @@ public class Command_myadmin extends FreedomCommand
|
||||
target = getAdmin(targetPlayer);
|
||||
if (target == null)
|
||||
{
|
||||
msg("That player is not admin", ChatColor.RED);
|
||||
msg("That player is not an admin", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -84,6 +84,7 @@ public class Command_myadmin extends FreedomCommand
|
||||
target.addIp(targetIp);
|
||||
|
||||
plugin.al.save();
|
||||
plugin.al.updateTables();
|
||||
|
||||
msg(counter + " IPs removed.");
|
||||
msg(targetPlayer, target.getIps().get(0) + " is now your only IP address");
|
||||
@ -240,10 +241,97 @@ public class Command_myadmin extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
case "genbackupcodes":
|
||||
if (!plugin.dc.enabled)
|
||||
{
|
||||
msg("The Discord verification system is currently disabled.", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
else if (target.getDiscordID() == null || target.getDiscordID().isEmpty())
|
||||
{
|
||||
msg("Discord verification is not enabled for you.", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
|
||||
msg("Generating backup codes...", ChatColor.GREEN);
|
||||
|
||||
boolean generated = plugin.dc.sendBackupCodes(target);
|
||||
|
||||
if (generated)
|
||||
{
|
||||
msg("Your backup codes have been sent to your discord account. They can be re-generated at anytime.", ChatColor.GREEN);
|
||||
}
|
||||
else
|
||||
{
|
||||
msg("Failed to generate backup codes, please contact a developer (preferably Seth)", ChatColor.RED);
|
||||
}
|
||||
return true;
|
||||
|
||||
default:
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
||||
{
|
||||
if (!plugin.al.isAdmin(sender))
|
||||
{
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
List<String> singleArguments = Arrays.asList("clearips", "setlogin", "setacformat");
|
||||
List<String> doubleArguments = Arrays.asList("clearip", "clearlogin", "clearacformat", "oldtags", "logstick", "syncroles", "genbackupcodes");
|
||||
if (args.length == 1)
|
||||
{
|
||||
List<String> options = new ArrayList<>();
|
||||
options.add("-o");
|
||||
options.addAll(singleArguments);
|
||||
options.addAll(doubleArguments);
|
||||
return options;
|
||||
}
|
||||
else if (args.length == 2)
|
||||
{
|
||||
if (args[0].equals("-o"))
|
||||
{
|
||||
return FUtil.getPlayerList();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (doubleArguments.contains(args[0]))
|
||||
{
|
||||
if (args[0].equals("clearip"))
|
||||
{
|
||||
List<String> ips = plugin.al.getAdmin(sender).getIps();
|
||||
ips.remove(Ips.getIp(playerSender));
|
||||
return ips;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (args.length == 3)
|
||||
{
|
||||
if (args[0].equals("-o"))
|
||||
{
|
||||
List<String> options = new ArrayList<>();
|
||||
options.addAll(singleArguments);
|
||||
options.addAll(doubleArguments);
|
||||
return options;
|
||||
}
|
||||
}
|
||||
else if (args.length == 4)
|
||||
{
|
||||
if (args[0].equals("-o") && args[2].equals("clearip"))
|
||||
{
|
||||
Admin admin = plugin.al.getEntryByName(args[1]);
|
||||
if (admin != null)
|
||||
{
|
||||
return admin.getIps();
|
||||
}
|
||||
}
|
||||
}
|
||||
return FUtil.getPlayerList();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,237 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.masterbuilder.MasterBuilder;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.pravian.aero.util.Ips;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.OP, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Manage my Master Builder entry", usage = "/<command> [-o <masterbuilder>] <clearips | clearip <ip> | genbackupcodes>", aliases = "mymb")
|
||||
public class Command_mymasterbuilder extends FreedomCommand
|
||||
{
|
||||
|
||||
@Override
|
||||
protected boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
if (args.length < 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Player init = null;
|
||||
MasterBuilder target = plugin.mbl.getMasterBuilder(playerSender);
|
||||
Player targetPlayer = playerSender;
|
||||
|
||||
// -o switch
|
||||
if (args[0].equals("-o"))
|
||||
{
|
||||
if (!FUtil.canManageMasterBuilders(playerSender.getName()))
|
||||
{
|
||||
return noPerms();
|
||||
}
|
||||
init = playerSender;
|
||||
targetPlayer = getPlayer(args[1]);
|
||||
if (targetPlayer == null)
|
||||
{
|
||||
msg(FreedomCommand.PLAYER_NOT_FOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
target = plugin.mbl.getMasterBuilder(playerSender);
|
||||
if (target == null)
|
||||
{
|
||||
msg("That player is not a Master Builder", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Shift 2
|
||||
args = Arrays.copyOfRange(args, 2, args.length);
|
||||
if (args.length < 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
final String targetIp = Ips.getIp(targetPlayer);
|
||||
|
||||
switch (args[0])
|
||||
{
|
||||
case "clearips":
|
||||
{
|
||||
if (args.length != 1)
|
||||
{
|
||||
return false; // Double check: the player might mean "clearip"
|
||||
}
|
||||
|
||||
if (init == null)
|
||||
{
|
||||
FUtil.adminAction(sender.getName(), "Clearing my IPs", false);
|
||||
}
|
||||
else
|
||||
{
|
||||
FUtil.adminAction(sender.getName(), "Clearing " + target.getName() + "' IPs", true);
|
||||
}
|
||||
|
||||
int counter = target.getIps().size() - 1;
|
||||
target.clearIPs();
|
||||
target.addIp(targetIp);
|
||||
|
||||
plugin.mbl.save();
|
||||
plugin.mbl.updateTables();
|
||||
|
||||
msg(counter + " IPs removed.");
|
||||
msg(targetPlayer, target.getIps().get(0) + " is now your only IP address");
|
||||
return true;
|
||||
}
|
||||
|
||||
case "clearip":
|
||||
{
|
||||
if (args.length != 2)
|
||||
{
|
||||
return false; // Double check: the player might mean "clearips"
|
||||
}
|
||||
|
||||
if (!target.getIps().contains(args[1]))
|
||||
{
|
||||
if (init == null)
|
||||
{
|
||||
msg("That IP is not registered to you.");
|
||||
}
|
||||
else
|
||||
{
|
||||
msg("That IP does not belong to that player.");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (targetIp.equals(args[1]))
|
||||
{
|
||||
if (init == null)
|
||||
{
|
||||
msg("You cannot remove your current IP.");
|
||||
}
|
||||
else
|
||||
{
|
||||
msg("You cannot remove that Master Builders's current IP.");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
FUtil.adminAction(sender.getName(), "Removing an IP" + (init == null ? "" : " from " + targetPlayer.getName() + "'s IPs"), true);
|
||||
|
||||
target.removeIp(args[1]);
|
||||
plugin.mbl.save();
|
||||
plugin.mbl.updateTables();
|
||||
|
||||
msg("Removed IP " + args[1]);
|
||||
msg("Current IPs: " + StringUtils.join(target.getIps(), ", "));
|
||||
return true;
|
||||
}
|
||||
|
||||
case "genbackupcodes":
|
||||
if (!plugin.dc.enabled)
|
||||
{
|
||||
msg("The Discord verification system is currently disabled.", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
else if (target.getDiscordID() == null || target.getDiscordID().isEmpty())
|
||||
{
|
||||
msg("Discord verification is not enabled for you.", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
|
||||
msg("Generating backup codes...", ChatColor.GREEN);
|
||||
|
||||
boolean generated = plugin.dc.sendBackupCodes(target);
|
||||
|
||||
if (generated)
|
||||
{
|
||||
msg("Your backup codes have been sent to your discord account. They can be re-generated at anytime.", ChatColor.GREEN);
|
||||
}
|
||||
else
|
||||
{
|
||||
msg("Failed to generate backup codes, please contact a developer (preferably Seth)", ChatColor.RED);
|
||||
}
|
||||
return true;
|
||||
|
||||
default:
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
||||
{
|
||||
|
||||
if (!plugin.mbl.isMasterBuilder(playerSender) && !FUtil.canManageMasterBuilders(playerSender.getName()))
|
||||
{
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
List<String> singleArguments = Arrays.asList("clearips");
|
||||
List<String> doubleArguments = Arrays.asList("clearip", "genbackupcodes");
|
||||
if (args.length == 1)
|
||||
{
|
||||
List<String> options = new ArrayList<>();
|
||||
options.add("-o");
|
||||
options.addAll(singleArguments);
|
||||
options.addAll(doubleArguments);
|
||||
return options;
|
||||
}
|
||||
else if (args.length == 2)
|
||||
{
|
||||
if (args[0].equals("-o"))
|
||||
{
|
||||
return FUtil.getPlayerList();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (doubleArguments.contains(args[0]))
|
||||
{
|
||||
if (args[0].equals("clearip"))
|
||||
{
|
||||
if (args[0].equals("clearip"))
|
||||
{
|
||||
List<String> ips = plugin.mbl.getMasterBuilder(sender).getIps();
|
||||
ips.remove(Ips.getIp(playerSender));
|
||||
return ips;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (args.length == 3)
|
||||
{
|
||||
if (args[0].equals("-o"))
|
||||
{
|
||||
List<String> options = new ArrayList<>();
|
||||
options.addAll(singleArguments);
|
||||
options.addAll(doubleArguments);
|
||||
return options;
|
||||
}
|
||||
}
|
||||
else if (args.length == 4)
|
||||
{
|
||||
if (args[0].equals("-o") && args[2].equals("clearip"))
|
||||
{
|
||||
MasterBuilder masterBuilder = plugin.mbl.getEntryByName(args[1]);
|
||||
if (masterBuilder != null)
|
||||
{
|
||||
return masterBuilder.getIps();
|
||||
}
|
||||
}
|
||||
}
|
||||
return FUtil.getPlayerList();
|
||||
}
|
||||
}
|
@ -0,0 +1,135 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import me.totalfreedom.totalfreedommod.player.PlayerData;
|
||||
import me.totalfreedom.totalfreedommod.playerverification.VPlayer;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Manage notes for a player", usage = "/<command> <name> <list | add <note> | remove <id> | clear>")
|
||||
public class Command_notes extends FreedomCommand
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
if (args.length < 2)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
VPlayer vPlayer;
|
||||
|
||||
final Player player = getPlayer(args[0]);
|
||||
if (player == null)
|
||||
{
|
||||
final PlayerData entry = plugin.pl.getData(args[0]);
|
||||
|
||||
if (entry == null)
|
||||
{
|
||||
msg("Can't find that user. If target is not logged in, make sure that you spelled the name exactly.");
|
||||
return true;
|
||||
}
|
||||
|
||||
vPlayer = plugin.pv.getVerificationPlayer(entry.getUsername());
|
||||
}
|
||||
else
|
||||
{
|
||||
vPlayer = plugin.pv.getVerificationPlayer(player);
|
||||
}
|
||||
|
||||
if (args[1].equals("list"))
|
||||
{
|
||||
final StringBuilder noteList = new StringBuilder();
|
||||
noteList.append(ChatColor.GREEN + "Player notes for " + vPlayer.getName() + ":");
|
||||
int id = 1;
|
||||
for (Map<?, ?> noteMap : vPlayer.getNotes())
|
||||
{
|
||||
String admin = String.valueOf(noteMap.keySet().toArray()[0]);
|
||||
String note = String.valueOf(noteMap.get(admin));
|
||||
String noteLine = id + ". " + admin + ": " + note;
|
||||
noteList.append("\n" + ChatColor.GOLD + noteLine);
|
||||
id++;
|
||||
}
|
||||
msg(noteList.toString());
|
||||
return true;
|
||||
}
|
||||
else if (args[1].equals("add"))
|
||||
{
|
||||
if (args.length < 3)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
String note = StringUtils.join(ArrayUtils.subarray(args, 2, args.length), " ");
|
||||
vPlayer.addNote(sender.getName(), note);
|
||||
plugin.pv.saveVerificationData(vPlayer);
|
||||
msg("Note added.", ChatColor.GREEN);
|
||||
return true;
|
||||
}
|
||||
else if (args[1].equals("remove"))
|
||||
{
|
||||
if (args.length < 3)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
int id;
|
||||
try
|
||||
{
|
||||
id = Integer.valueOf(args[2]);
|
||||
}
|
||||
catch (NumberFormatException e)
|
||||
{
|
||||
msg("Invalid number: " + args[2], ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
id--;
|
||||
if (vPlayer.removeNote(id))
|
||||
{
|
||||
plugin.pv.saveVerificationData(vPlayer);
|
||||
msg("Note removed.");
|
||||
}
|
||||
else
|
||||
{
|
||||
msg("No note with the ID of " + args[2] + "exists.", ChatColor.RED);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else if (args[1].equals("clear"))
|
||||
{
|
||||
int count = vPlayer.getNotes().size();
|
||||
vPlayer.clearNotes();
|
||||
plugin.pv.saveVerificationData(vPlayer);
|
||||
msg("Cleared " + count + " notes.", ChatColor.GREEN);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
||||
{
|
||||
if (args.length == 1)
|
||||
{
|
||||
return FUtil.getPlayerList();
|
||||
}
|
||||
else if (args.length == 2)
|
||||
{
|
||||
return Arrays.asList("list", "add", "remove", "clear");
|
||||
}
|
||||
else if (args.length > 2 && (args[1].equals("add")))
|
||||
{
|
||||
return FUtil.getPlayerList();
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
@ -13,7 +13,7 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.OP, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Manage your verification", usage = "/<command> <<enable | disable | clearips | status>", aliases = "playerverification,pv")
|
||||
@CommandParameters(description = "Manage your verification", usage = "/<command> <enable | disable | clearips | status | genbackupcodes>", aliases = "playerverification,pv")
|
||||
public class Command_playerverify extends FreedomCommand
|
||||
{
|
||||
@Override
|
||||
@ -66,21 +66,19 @@ public class Command_playerverify extends FreedomCommand
|
||||
msg("The Discord verification system is currently disabled.", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
if (data.getEnabled())
|
||||
else if (data.getEnabled())
|
||||
{
|
||||
msg("Discord verification is already enabled for you.", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
else if (data.getDiscordId() == null)
|
||||
{
|
||||
msg("Please link a discord account with /linkdiscord.", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
data.setEnabled(true);
|
||||
plugin.pv.saveVerificationData(data);
|
||||
if (data.getDiscordId() != null)
|
||||
{
|
||||
msg("Re-enabled Discord verification.", ChatColor.GREEN);
|
||||
}
|
||||
else
|
||||
{
|
||||
msg("Enabled Discord verification. Please type /linkdiscord to link a Discord account.", ChatColor.GREEN);
|
||||
}
|
||||
msg("Re-enabled Discord verification.", ChatColor.GREEN);
|
||||
return true;
|
||||
|
||||
case "disable":
|
||||
@ -99,7 +97,33 @@ public class Command_playerverify extends FreedomCommand
|
||||
boolean specified = target.getDiscordId() != null;
|
||||
msg(ChatColor.GRAY + "Discord Verification Enabled: " + (enabled ? ChatColor.GREEN + "true" : ChatColor.RED + "false"));
|
||||
msg(ChatColor.GRAY + "Discord ID: " + (specified ? ChatColor.GREEN + target.getDiscordId() : ChatColor.RED + "not set"));
|
||||
msg(ChatColor.GRAY + "Backup Codes: " + data.getBackupCodes().size() + "/" + "10");
|
||||
return true;
|
||||
|
||||
case "genbackupcodes":
|
||||
if (!plugin.dc.enabled)
|
||||
{
|
||||
msg("The Discord verification system is currently disabled.", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
else if (!data.getEnabled())
|
||||
{
|
||||
msg("Discord verification is not enabled for you.", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean generated = plugin.dc.sendBackupCodes(data);
|
||||
|
||||
if (generated)
|
||||
{
|
||||
msg("Your backup codes have been sent to your discord account. They can be re-generated at anytime.", ChatColor.GREEN);
|
||||
}
|
||||
else
|
||||
{
|
||||
msg("Failed to generate backup codes, please contact a developer (preferably Seth)", ChatColor.RED);
|
||||
}
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
@ -109,7 +133,7 @@ public class Command_playerverify extends FreedomCommand
|
||||
{
|
||||
if (args.length == 1)
|
||||
{
|
||||
return Arrays.asList("enable", "disable", "status", "clearips");
|
||||
return Arrays.asList("enable", "disable", "status", "clearips", "genbackupcodes");
|
||||
}
|
||||
|
||||
return Collections.emptyList();
|
||||
|
@ -78,7 +78,7 @@ public class Command_purgeall extends FreedomCommand
|
||||
plugin.fm.setGlobalFreeze(false);
|
||||
|
||||
// Remove all mobs
|
||||
Command_mobpurge.purgeMobs(null);
|
||||
plugin.ew.purgeMobs(null);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ public class Command_realtime extends FreedomCommand
|
||||
player.setUtcOffset(tz);
|
||||
player.setRealTime(true);
|
||||
plugin.rt.enable(playerSender);
|
||||
plugin.pv.save();
|
||||
plugin.pv.saveVerificationData(player);
|
||||
msg("Your in-game time is now synced with real time.");
|
||||
return true;
|
||||
}
|
||||
@ -56,7 +56,7 @@ public class Command_realtime extends FreedomCommand
|
||||
player.setRealTime(false);
|
||||
msg("Your in-game time is no longer synced with real time.");
|
||||
plugin.rt.disable(playerSender);
|
||||
plugin.pv.save();
|
||||
plugin.pv.saveVerificationData(player);
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
|
@ -1,12 +1,11 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Random;
|
||||
import me.totalfreedom.totalfreedommod.admin.Admin;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.discord.Discord;
|
||||
import me.totalfreedom.totalfreedommod.masterbuilder.MasterBuilder;
|
||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||
import me.totalfreedom.totalfreedommod.playerverification.VPlayer;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.pravian.aero.util.Ips;
|
||||
@ -44,7 +43,7 @@ public class Command_verify extends FreedomCommand
|
||||
plugin.pl.getPlayer(player).getFreezeData().setFrozen(false);
|
||||
player.sendMessage(ChatColor.GRAY + "You have been unfrozen.");
|
||||
}
|
||||
plugin.pv.verifyPlayer(player);
|
||||
plugin.pv.verifyPlayer(player, null);
|
||||
plugin.rm.updateDisplay(player);
|
||||
return true;
|
||||
}
|
||||
@ -62,7 +61,7 @@ public class Command_verify extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!plugin.pv.isPlayerImpostor(playerSender) && !plugin.al.isAdminImpostor(playerSender))
|
||||
if (!plugin.pv.isPlayerImpostor(playerSender) && !plugin.al.isAdminImpostor(playerSender) && !plugin.mbl.isMasterBuilderImpostor(playerSender))
|
||||
{
|
||||
msg("You are not an impostor, therefore you do not need to verify.", ChatColor.RED);
|
||||
return true;
|
||||
@ -70,7 +69,17 @@ public class Command_verify extends FreedomCommand
|
||||
|
||||
String discordId = "";
|
||||
|
||||
if (plugin.al.isAdminImpostor(playerSender))
|
||||
if (plugin.pv.isPlayerImpostor(playerSender))
|
||||
{
|
||||
VPlayer vPlayer = plugin.pv.getVerificationPlayer(playerSender);
|
||||
if (vPlayer.getDiscordId() == null)
|
||||
{
|
||||
msg("You do not have a Discord account linked to your Minecraft account, please verify the manual way.", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
discordId = vPlayer.getDiscordId();
|
||||
}
|
||||
else if (plugin.al.isAdminImpostor(playerSender))
|
||||
{
|
||||
Admin admin = plugin.al.getEntryByName(playerSender.getName());
|
||||
if (admin.getDiscordID() == null)
|
||||
@ -80,48 +89,109 @@ public class Command_verify extends FreedomCommand
|
||||
}
|
||||
discordId = admin.getDiscordID();
|
||||
}
|
||||
|
||||
if (plugin.pv.isPlayerImpostor(playerSender))
|
||||
else if (plugin.mbl.isMasterBuilderImpostor(playerSender))
|
||||
{
|
||||
if (plugin.pv.getVerificationPlayer(playerSender).getDiscordId() == null)
|
||||
MasterBuilder masterBuilder = plugin.mbl.getEntryByName(playerSender.getName());
|
||||
if (masterBuilder.getDiscordID() == null)
|
||||
{
|
||||
msg("You do not have a Discord account linked to your Minecraft account, please verify the manual way.", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
discordId = plugin.pv.getVerificationPlayer(playerSender).getDiscordId();
|
||||
discordId = masterBuilder.getDiscordID();
|
||||
}
|
||||
|
||||
if (args.length < 1)
|
||||
{
|
||||
String code = "";
|
||||
Random random = new Random();
|
||||
for (int i = 0; i < 10; i++)
|
||||
String code = plugin.dc.generateCode(10);
|
||||
if (plugin.pv.isPlayerImpostor(playerSender))
|
||||
{
|
||||
code += random.nextInt(10);
|
||||
VPlayer vPlayer = plugin.pv.getVerificationPlayer(playerSender);
|
||||
plugin.dc.addPlayerVerificationCode(code, vPlayer);
|
||||
}
|
||||
Discord.VERIFY_CODES.add(code);
|
||||
Discord.bot.getUserById(discordId).openPrivateChannel().complete().sendMessage("A user with the IP `" + Ips.getIp(playerSender) + "` has sent a verification request. Please run the following in-game command: `/verify " + code + "`").complete();
|
||||
else if (plugin.al.isAdminImpostor(playerSender))
|
||||
{
|
||||
Admin admin = plugin.al.getEntryByName(playerSender.getName());
|
||||
plugin.dc.addAdminVerificationCode(code, admin);
|
||||
}
|
||||
else if (plugin.mbl.isMasterBuilderImpostor(playerSender))
|
||||
{
|
||||
MasterBuilder masterBuilder = plugin.mbl.getEntryByName(playerSender.getName());
|
||||
plugin.dc.addMasterBuilderVerificationCode(code, masterBuilder);
|
||||
}
|
||||
plugin.dc.bot.getUserById(discordId).openPrivateChannel().complete().sendMessage("A user with the IP `" + Ips.getIp(playerSender) + "` has sent a verification request. Please run the following in-game command: `/verify " + code + "`").complete();
|
||||
msg("A verification code has been sent to your account, please copy the code and run /verify <code>", ChatColor.GREEN);
|
||||
}
|
||||
else
|
||||
{
|
||||
String code = args[0];
|
||||
if (!Discord.VERIFY_CODES.contains(code))
|
||||
String backupCode = null;
|
||||
|
||||
if (plugin.pv.isPlayerImpostor(playerSender))
|
||||
{
|
||||
msg("You have entered an invalid verification code", ChatColor.RED);
|
||||
VPlayer vPlayer = plugin.pv.getVerificationPlayer(playerSender);
|
||||
VPlayer mapPlayer = plugin.dc.getPlayerVerificationCodes().get(code);
|
||||
if (mapPlayer == null)
|
||||
{
|
||||
if (!vPlayer.getBackupCodes().contains(plugin.dc.getMD5(code)))
|
||||
{
|
||||
msg("You have entered an invalid verification code", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
backupCode = plugin.dc.getMD5(code);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
plugin.dc.removePlayerVerificationCode(code);
|
||||
}
|
||||
|
||||
final FPlayer fPlayer = plugin.pl.getPlayer(playerSender);
|
||||
FUtil.bcastMsg(playerSender.getName() + " has verified!", ChatColor.GOLD);
|
||||
plugin.rm.updateDisplay(playerSender);
|
||||
playerSender.setOp(true);
|
||||
msg(YOU_ARE_OP);
|
||||
if (fPlayer.getFreezeData().isFrozen())
|
||||
{
|
||||
fPlayer.getFreezeData().setFrozen(false);
|
||||
msg("You have been unfrozen.");
|
||||
}
|
||||
plugin.pv.verifyPlayer(playerSender, backupCode);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (plugin.al.isAdminImpostor(playerSender))
|
||||
else if (plugin.al.isAdminImpostor(playerSender))
|
||||
{
|
||||
Admin admin = plugin.al.getEntryByName(playerSender.getName());
|
||||
Discord.VERIFY_CODES.remove(code);
|
||||
Admin mapAdmin = plugin.dc.getAdminVerificationCodes().get(code);
|
||||
if (mapAdmin == null)
|
||||
{
|
||||
if (!admin.getBackupCodes().contains(plugin.dc.getMD5(code)))
|
||||
{
|
||||
msg("You have entered an invalid verification code", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
backupCode = plugin.dc.getMD5(code);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
plugin.dc.removeAdminVerificationCode(code);
|
||||
}
|
||||
|
||||
FUtil.bcastMsg(playerSender.getName() + " has verified!", ChatColor.GOLD);
|
||||
FUtil.adminAction(ConfigEntry.SERVER_NAME.getString(), "Re-adding " + admin.getName() + " to the admin list", true);
|
||||
|
||||
admin.setName(playerSender.getName());
|
||||
admin.addIp(Ips.getIp(playerSender));
|
||||
|
||||
if (backupCode != null)
|
||||
{
|
||||
admin.removeBackupCode(backupCode);
|
||||
}
|
||||
|
||||
if (!plugin.mbl.isMasterBuilder(playerSender))
|
||||
{
|
||||
MasterBuilder masterBuilder = null;
|
||||
@ -161,11 +231,38 @@ public class Command_verify extends FreedomCommand
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (plugin.pv.isPlayerImpostor(playerSender))
|
||||
else if (plugin.mbl.isMasterBuilderImpostor(playerSender))
|
||||
{
|
||||
MasterBuilder masterBuilder = plugin.mbl.getEntryByName(playerSender.getName());
|
||||
MasterBuilder mapMasterBuilder = plugin.dc.getMasterBuilderVerificationCodes().get(code);
|
||||
if (mapMasterBuilder == null)
|
||||
{
|
||||
if (!masterBuilder.getBackupCodes().contains(plugin.dc.getMD5(code)))
|
||||
{
|
||||
msg("You have entered an invalid verification code", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
backupCode = plugin.dc.getMD5(code);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
plugin.dc.removeMasterBuilderVerificationCode(code);
|
||||
}
|
||||
|
||||
if (backupCode != null)
|
||||
{
|
||||
masterBuilder.removeBackupCode(backupCode);
|
||||
}
|
||||
|
||||
final FPlayer fPlayer = plugin.pl.getPlayer(playerSender);
|
||||
FUtil.bcastMsg(playerSender.getName() + " has verified!", ChatColor.GOLD);
|
||||
masterBuilder.setLastLogin(new Date());
|
||||
masterBuilder.addIp(Ips.getIp(playerSender));
|
||||
plugin.mbl.save();
|
||||
plugin.mbl.updateTables();
|
||||
plugin.rm.updateDisplay(playerSender);
|
||||
playerSender.setOp(true);
|
||||
msg(YOU_ARE_OP);
|
||||
@ -174,7 +271,6 @@ public class Command_verify extends FreedomCommand
|
||||
fPlayer.getFreezeData().setFrozen(false);
|
||||
msg("You have been unfrozen.");
|
||||
}
|
||||
plugin.pv.verifyPlayer(playerSender);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user