SuperAwesomeAdmins. Because who are we kidding anyway.

This commit is contained in:
Steven Lawson 2012-10-03 18:50:16 -04:00
parent e7f2ad893c
commit 2a396ca904
5 changed files with 10 additions and 27 deletions

View file

@ -54,8 +54,8 @@ flatlands_generation_params: 16,stone,32,dirt,1,grass
# Admin-Only Mode
admin_only_mode: false
# SuperUsers; telnet users who have the permissions for certain high-profile commands (/doom, /lockup, ect)
superuser_names:
# SuperAwesomeAdmins - Because normal superadmin just isn't awesome enough. These users can do even more awesomey admin shit.
super_awesome_admins:
- markbyron
- mark
- madgeek1450

View file

@ -13,7 +13,7 @@ public class Command_doom extends TFM_Command
@Override
public boolean run(final CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{
if (!(senderIsConsole && TotalFreedomMod.superUsers.contains(sender.getName().toLowerCase())))
if (!(senderIsConsole && TotalFreedomMod.superAwesomeAdmins.contains(sender.getName().toLowerCase())))
{
sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS);
return true;

View file

@ -1,6 +1,5 @@
package me.StevenLawson.TotalFreedomMod.Commands;
import java.util.Arrays;
import me.StevenLawson.TotalFreedomMod.TFM_Util;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import org.bukkit.command.Command;
@ -24,7 +23,7 @@ public class Command_fuckoff extends TFM_Command
return true;
}
if (!Arrays.asList("madgeek1450", "markbyron", "darthsalamon").contains(sender.getName().toLowerCase()))
if (!TotalFreedomMod.superAwesomeAdmins.contains(sender.getName().toLowerCase()))
{
sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS);
return true;

View file

@ -4,7 +4,6 @@ import java.util.Random;
import me.StevenLawson.TotalFreedomMod.TFM_UserInfo;
import me.StevenLawson.TotalFreedomMod.TFM_Util;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
@ -16,7 +15,7 @@ public class Command_lockup extends TFM_Command
@Override
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{
if (!(senderIsConsole && TotalFreedomMod.superUsers.contains(sender.getName().toLowerCase())))
if (!(senderIsConsole && TotalFreedomMod.superAwesomeAdmins.contains(sender.getName().toLowerCase())))
{
sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS);
return true;
@ -26,8 +25,8 @@ public class Command_lockup extends TFM_Command
{
if (args[0].equalsIgnoreCase("all"))
{
TFM_Util.adminAction(sender.getName(), "Locking up all players", true);
TFM_Util.adminAction(sender.getName(), "Locking up all players", true);
for (Player p : server.getOnlinePlayers())
{
startLockup(p);
@ -36,7 +35,7 @@ public class Command_lockup extends TFM_Command
}
else if (args[0].equalsIgnoreCase("purge"))
{
TFM_Util.adminAction(sender.getName(), "Unlocking all players", true);
TFM_Util.adminAction(sender.getName(), "Unlocking all players", true);
for (Player p : server.getOnlinePlayers())
{
cancelLockup(p);

View file

@ -3,15 +3,12 @@ package me.StevenLawson.TotalFreedomMod;
import java.io.File;
import java.io.InputStream;
import java.util.*;
import me.StevenLawson.TotalFreedomMod.Commands.TFM_Command;
import me.StevenLawson.TotalFreedomMod.Listener.TFM_BlockListener;
import me.StevenLawson.TotalFreedomMod.Listener.TFM_EntityListener;
import me.StevenLawson.TotalFreedomMod.Listener.TFM_PlayerListener;
import me.StevenLawson.TotalFreedomMod.Listener.TFM_WeatherListener;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Server;
@ -188,24 +185,12 @@ public class TotalFreedomMod extends JavaPlugin
public static String flatlandsGenerationParams = "16,stone,32,dirt,1,grass";
public static boolean allowFliudSpread = false;
public static boolean adminOnlyMode = false;
public static String[] tempArray =
{
"markbyron",
"mark",
"madgeek1450",
"madgeek",
"darthsalamon",
"darth"
};
public static List<String> superUsers = Arrays.asList(tempArray);
public static List<String> superAwesomeAdmins = Arrays.asList("markbyron", "mark", "madgeek1450", "madgeek", "darthsalamon", "darth");
public void loadMainConfig()
{
try
{
tempArray = null;
TFM_Util.createDefaultConfiguration(CONFIG_FILE, getFile());
FileConfiguration config = YamlConfiguration.loadConfiguration(new File(getDataFolder(), CONFIG_FILE));
@ -238,7 +223,7 @@ public class TotalFreedomMod extends JavaPlugin
flatlandsGenerationParams = config.getString("flatlands_generation_params", flatlandsGenerationParams);
allowFliudSpread = config.getBoolean("allow_fluid_spread", allowFliudSpread);
adminOnlyMode = config.getBoolean("admin_only_mode", adminOnlyMode);
superUsers = config.getStringList("superuser_names");
superAwesomeAdmins = config.getStringList("super_awesome_admins");
}
catch (Exception ex)
{