mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
Added /lockdown
This commit is contained in:
parent
56493adcae
commit
bac25258b0
@ -1,5 +1,5 @@
|
||||
#Mon, 12 Aug 2013 17:57:31 +0200
|
||||
#Mon, 12 Aug 2013 20:45:53 +0200
|
||||
|
||||
program.VERSION=2.22
|
||||
program.BUILDNUM=406
|
||||
program.BUILDDATE=08/12/2013 05\:57 PM
|
||||
program.BUILDNUM=409
|
||||
program.BUILDDATE=08/12/2013 08\:45 PM
|
||||
|
@ -1,3 +1,3 @@
|
||||
#Build Number for ANT. Do not edit!
|
||||
#Mon Aug 12 17:57:31 CEST 2013
|
||||
build.number=407
|
||||
#Mon Aug 12 20:45:53 CEST 2013
|
||||
build.number=410
|
||||
|
@ -0,0 +1,34 @@
|
||||
package me.StevenLawson.TotalFreedomMod.Commands;
|
||||
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_Util;
|
||||
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Prevents new players from joining the server", usage = "/<command> <on | off>")
|
||||
public class Command_lockdown extends TFM_Command
|
||||
{
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
if (args.length != 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (TFM_Util.isStopCommand(args[0]))
|
||||
{
|
||||
TFM_Util.adminAction(sender.getName(), "De-activating server lockdown", true);
|
||||
TotalFreedomMod.lockdownEnabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
TFM_Util.adminAction(sender.getName(), "Activating server lockdown", true);
|
||||
TotalFreedomMod.lockdownEnabled = true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
@ -16,12 +16,7 @@ public class Command_tag extends TFM_Command
|
||||
{
|
||||
public static final List<String> FORBIDDEN_WORDS = Arrays.asList(new String[]
|
||||
{
|
||||
"admin", "owner", "moderator", "developer"
|
||||
});
|
||||
|
||||
public static final List<String> FORBIDDEN_CODE = Arrays.asList(new String[]
|
||||
{
|
||||
"&k"
|
||||
"admin", "owner", "moderator", "developer", "&k"
|
||||
});
|
||||
|
||||
@Override
|
||||
@ -38,6 +33,7 @@ public class Command_tag extends TFM_Command
|
||||
return true;
|
||||
}
|
||||
|
||||
TFM_Util.adminAction(sender.getName(), "Removing all tags", false);
|
||||
int count = 0;
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
{
|
||||
@ -79,24 +75,19 @@ public class Command_tag extends TFM_Command
|
||||
{
|
||||
if (args[0].toLowerCase().contains(word))
|
||||
{
|
||||
playerMsg("That tag contains a forbidden word.");
|
||||
if (word.contains("&"))
|
||||
{
|
||||
playerMsg("That tag contains a forbidden color-code.");
|
||||
}
|
||||
else
|
||||
{
|
||||
playerMsg("That tag contains a forbidden word.");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!TFM_SuperadminList.isUserSuperadmin(sender))
|
||||
{
|
||||
for (String word : FORBIDDEN_CODE)
|
||||
{
|
||||
if (args[0].toLowerCase().contains(word))
|
||||
{
|
||||
playerMsg("You may not include the colour code you have attempted to use in your tag")
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
TFM_PlayerData.getPlayerData(sender_p).setTag(args[0]);
|
||||
playerMsg("Tag set.");
|
||||
|
@ -253,6 +253,12 @@ public class TFM_ServerInterface
|
||||
return;
|
||||
}
|
||||
|
||||
if (TotalFreedomMod.lockdownEnabled)
|
||||
{
|
||||
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, "Server is currently in lockdown mode.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (player_list.hasWhitelist)
|
||||
{
|
||||
if (!player_list.getWhitelisted().contains(player_name.toLowerCase()))
|
||||
@ -295,6 +301,11 @@ public class TFM_ServerInterface
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (TotalFreedomMod.lockdownEnabled)
|
||||
{
|
||||
TFM_Util.playerMsg(p, "Warning: Server is currenty in lockdown-mode, new players will not be able to join!", ChatColor.RED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,6 +49,7 @@ public class TotalFreedomMod extends JavaPlugin
|
||||
public static boolean allPlayersFrozen = false;
|
||||
public static BukkitTask freezePurgeTask = null;
|
||||
public static BukkitTask mutePurgeTask = null;
|
||||
public static boolean lockdownEnabled = false;
|
||||
public static Map<Player, Double> fuckoffEnabledFor = new HashMap<Player, Double>();
|
||||
//
|
||||
public static String pluginVersion = "";
|
||||
|
Loading…
Reference in New Issue
Block a user