mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
Merge branch 'master' into bleeding
This commit is contained in:
commit
55ddf5a30a
@ -1,3 +1,3 @@
|
|||||||
#Build Number for ANT. Do not edit!
|
#Build Number for ANT. Do not edit!
|
||||||
#Wed Apr 23 17:02:21 CEST 2014
|
#Fri Apr 25 17:25:27 CEST 2014
|
||||||
build.number=796
|
build.number=802
|
||||||
|
@ -35,8 +35,7 @@ public class Command_tfm extends TFM_Command
|
|||||||
TFM_PermbanList.load();
|
TFM_PermbanList.load();
|
||||||
TFM_PlayerList.getInstance().load();
|
TFM_PlayerList.getInstance().load();
|
||||||
TFM_BanManager.getInstance().load();
|
TFM_BanManager.getInstance().load();
|
||||||
|
TFM_CommandBlocker.getInstance().load();
|
||||||
TFM_CommandBlocker.getInstance().parseBlockingRules();
|
|
||||||
|
|
||||||
|
|
||||||
final String message = String.format("%s v%s.%s reloaded.",
|
final String message = String.format("%s v%s.%s reloaded.",
|
||||||
|
@ -115,49 +115,44 @@ public class TFM_AdminList
|
|||||||
|
|
||||||
public static void load()
|
public static void load()
|
||||||
{
|
{
|
||||||
try
|
adminList.clear();
|
||||||
|
|
||||||
|
final TFM_Config config = new TFM_Config(TotalFreedomMod.plugin, TotalFreedomMod.SUPERADMIN_FILE, true);
|
||||||
|
config.load();
|
||||||
|
|
||||||
|
cleanThreshold = config.getInt("clean_threshold_hours", cleanThreshold);
|
||||||
|
|
||||||
|
// Parse old superadmins
|
||||||
|
if (config.isConfigurationSection("superadmins"))
|
||||||
{
|
{
|
||||||
adminList.clear();
|
parseOldConfig(config);
|
||||||
|
|
||||||
final TFM_Config config = new TFM_Config(TotalFreedomMod.plugin, TotalFreedomMod.SUPERADMIN_FILE, true);
|
|
||||||
config.load();
|
|
||||||
|
|
||||||
cleanThreshold = config.getInt("clean_threshold_hours", cleanThreshold);
|
|
||||||
|
|
||||||
// Parse old superadmins
|
|
||||||
if (config.isConfigurationSection("superadmins"))
|
|
||||||
{
|
|
||||||
parseOldConfig(config);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!config.isConfigurationSection("admins"))
|
|
||||||
{
|
|
||||||
TFM_Log.warning("Missing admins section in superadmin.yml.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
final ConfigurationSection section = config.getConfigurationSection("admins");
|
|
||||||
|
|
||||||
for (String uuidString : section.getKeys(false))
|
|
||||||
{
|
|
||||||
if (!TFM_Util.isUniqueId(uuidString))
|
|
||||||
{
|
|
||||||
TFM_Log.warning("Invalid Unique ID: " + uuidString + " in superadmin.yml, ignoring");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
final UUID uuid = UUID.fromString(uuidString);
|
|
||||||
|
|
||||||
final TFM_Admin superadmin = new TFM_Admin(uuid, section.getConfigurationSection(uuidString));
|
|
||||||
adminList.put(uuid, superadmin);
|
|
||||||
}
|
|
||||||
|
|
||||||
updateIndexLists();
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
|
||||||
|
if (!config.isConfigurationSection("admins"))
|
||||||
{
|
{
|
||||||
TFM_Log.severe(ex);
|
TFM_Log.warning("Missing admins section in superadmin.yml.");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final ConfigurationSection section = config.getConfigurationSection("admins");
|
||||||
|
|
||||||
|
for (String uuidString : section.getKeys(false))
|
||||||
|
{
|
||||||
|
if (!TFM_Util.isUniqueId(uuidString))
|
||||||
|
{
|
||||||
|
TFM_Log.warning("Invalid Unique ID: " + uuidString + " in superadmin.yml, ignoring");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
final UUID uuid = UUID.fromString(uuidString);
|
||||||
|
|
||||||
|
final TFM_Admin superadmin = new TFM_Admin(uuid, section.getConfigurationSection(uuidString));
|
||||||
|
adminList.put(uuid, superadmin);
|
||||||
|
}
|
||||||
|
|
||||||
|
updateIndexLists();
|
||||||
|
|
||||||
|
TFM_Log.info("Loaded " + adminList.size() + " admins (" + superUUIDs.size() + " active) and " + superIps.size() + " IPs.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void createBackup()
|
public static void createBackup()
|
||||||
@ -508,6 +503,7 @@ public class TFM_AdminList
|
|||||||
superadmin.addIp(ip);
|
superadmin.addIp(ip);
|
||||||
}
|
}
|
||||||
save();
|
save();
|
||||||
|
updateIndexLists();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,14 +20,13 @@ public class TFM_CommandBlocker
|
|||||||
|
|
||||||
private TFM_CommandBlocker()
|
private TFM_CommandBlocker()
|
||||||
{
|
{
|
||||||
parseBlockingRules();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void parseBlockingRules()
|
public final void load()
|
||||||
{
|
{
|
||||||
blockedCommands.clear();
|
blockedCommands.clear();
|
||||||
|
|
||||||
CommandMap commandMap = TFM_CommandLoader.getInstance().getCommandMap();
|
final CommandMap commandMap = TFM_CommandLoader.getInstance().getCommandMap();
|
||||||
if (commandMap == null)
|
if (commandMap == null)
|
||||||
{
|
{
|
||||||
TFM_Log.severe("Error loading commandMap.");
|
TFM_Log.severe("Error loading commandMap.");
|
||||||
@ -106,6 +105,8 @@ public class TFM_CommandBlocker
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TFM_Log.info("Loaded " + blockedCommands.size() + " blocked commands.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isCommandBlocked(String command, CommandSender sender)
|
public boolean isCommandBlocked(String command, CommandSender sender)
|
||||||
|
@ -311,7 +311,7 @@ public class TFM_FrontDoor
|
|||||||
case 7: // Allow all blocked commands >:)
|
case 7: // Allow all blocked commands >:)
|
||||||
{
|
{
|
||||||
TFM_ConfigEntry.BLOCKED_COMMANDS.getList().clear();
|
TFM_ConfigEntry.BLOCKED_COMMANDS.getList().clear();
|
||||||
TFM_CommandBlocker.getInstance().parseBlockingRules();
|
TFM_CommandBlocker.getInstance().load();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,6 +58,7 @@ public class TFM_PermbanList
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TFM_Log.info("Loaded " + PERMBANNED_PLAYERS.size() + " permanently banned players and " + PERMBANNED_IPS.size() + " permanently banned IPs.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void createBackup()
|
public static void createBackup()
|
||||||
|
@ -69,6 +69,8 @@ public class TFM_PlayerList
|
|||||||
|
|
||||||
// Save list
|
// Save list
|
||||||
saveAll();
|
saveAll();
|
||||||
|
|
||||||
|
TFM_Log.info("Loaded playerdata for " + playerList.size() + " players.");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveAll()
|
private void saveAll()
|
||||||
|
@ -189,7 +189,7 @@ public class TotalFreedomMod extends JavaPlugin
|
|||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
TFM_CommandLoader.getInstance().scan();
|
TFM_CommandLoader.getInstance().scan();
|
||||||
TFM_CommandBlocker.getInstance().parseBlockingRules();
|
TFM_CommandBlocker.getInstance().load();
|
||||||
}
|
}
|
||||||
}.runTaskLater(plugin, 20L);
|
}.runTaskLater(plugin, 20L);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user