Many changes for TFM 5.0

Improved admin system
Improved Rank system
Implemented config converter
Improved command handling
Updated Aero
This commit is contained in:
Jerom van der Sar
2016-03-06 16:56:15 +01:00
parent 055973aa37
commit 6edb6be7d9
153 changed files with 1105 additions and 1144 deletions

View File

@ -1,12 +1,5 @@
package me.totalfreedom.totalfreedommod.httpd;
import me.totalfreedom.totalfreedommod.httpd.module.Module_help;
import me.totalfreedom.totalfreedommod.httpd.module.Module_file;
import me.totalfreedom.totalfreedommod.httpd.module.Module_schematic;
import me.totalfreedom.totalfreedommod.httpd.module.Module_permbans;
import me.totalfreedom.totalfreedommod.httpd.module.Module_players;
import me.totalfreedom.totalfreedommod.httpd.module.Module_logs;
import me.totalfreedom.totalfreedommod.httpd.module.Module_list;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
@ -18,6 +11,13 @@ import me.totalfreedom.totalfreedommod.TotalFreedomMod;
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD.HTTPSession;
import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD.Response;
import me.totalfreedom.totalfreedommod.httpd.module.Module_file;
import me.totalfreedom.totalfreedommod.httpd.module.Module_help;
import me.totalfreedom.totalfreedommod.httpd.module.Module_list;
import me.totalfreedom.totalfreedommod.httpd.module.Module_logs;
import me.totalfreedom.totalfreedommod.httpd.module.Module_permbans;
import me.totalfreedom.totalfreedommod.httpd.module.Module_players;
import me.totalfreedom.totalfreedommod.httpd.module.Module_schematic;
import me.totalfreedom.totalfreedommod.util.FLog;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;

View File

@ -4,10 +4,10 @@ import java.io.File;
import java.io.IOException;
import java.util.Iterator;
import java.util.Map;
import me.totalfreedom.totalfreedommod.httpd.HTTPDaemon;
import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD;
import static me.totalfreedom.totalfreedommod.httpd.HTMLGenerationTools.list;
import static me.totalfreedom.totalfreedommod.httpd.HTMLGenerationTools.paragraph;
import me.totalfreedom.totalfreedommod.httpd.HTTPDaemon;
import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD;
import me.totalfreedom.totalfreedommod.util.FLog;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;

View File

@ -10,10 +10,10 @@ import java.util.List;
import java.util.Map;
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
import me.totalfreedom.totalfreedommod.command.FreedomCommand;
import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD;
import static me.totalfreedom.totalfreedommod.httpd.HTMLGenerationTools.heading;
import static me.totalfreedom.totalfreedommod.httpd.HTMLGenerationTools.paragraph;
import me.totalfreedom.totalfreedommod.rank.Rank;
import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD;
import me.totalfreedom.totalfreedommod.rank.RankBase;
import net.pravian.aero.command.CommandReflection;
import static org.apache.commons.lang3.StringEscapeUtils.escapeHtml4;
import org.apache.commons.lang3.StringUtils;
@ -77,7 +77,7 @@ public class Module_help extends HTTPDModule
responseBody.append(heading(pluginName, 2)).append("<ul>\r\n");
Rank lastTfmCommandLevel = null;
RankBase lastTfmCommandLevel = null;
for (Command command : commands)
{
if (!TotalFreedomMod.pluginName.equals(pluginName))
@ -86,7 +86,7 @@ public class Module_help extends HTTPDModule
continue;
}
Rank tfmCommandLevel = FreedomCommand.getFrom(command).getPerms().level();
RankBase tfmCommandLevel = FreedomCommand.getFrom(command).getPerms().level();
if (lastTfmCommandLevel == null || lastTfmCommandLevel != tfmCommandLevel)
{
responseBody.append("</ul>\r\n").append(heading(tfmCommandLevel.getName(), 3)).append("<ul>\r\n");

View File

@ -27,7 +27,7 @@ public class Module_list extends HTTPDModule
for (Player player : onlinePlayers)
{
String tag = TotalFreedomMod.plugin.rm.getDisplayRank(player).getTag();
String tag = TotalFreedomMod.plugin.rm.getDisplay(player).getTag();
body.append("<li>").append(tag).append(player.getName()).append("</li>\r\n");
}

View File

@ -1,9 +1,9 @@
package me.totalfreedom.totalfreedommod.httpd.module;
import me.totalfreedom.totalfreedommod.admin.Admin;
import me.totalfreedom.totalfreedommod.util.FUtil;
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
import me.totalfreedom.totalfreedommod.admin.Admin;
import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD;
import me.totalfreedom.totalfreedommod.util.FUtil;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.json.simple.JSONArray;

View File

@ -9,15 +9,15 @@ import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
import me.totalfreedom.totalfreedommod.admin.Admin;
import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD.Method;
import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD.Response;
import me.totalfreedom.totalfreedommod.util.FLog;
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
import me.totalfreedom.totalfreedommod.admin.Admin;
import me.totalfreedom.totalfreedommod.httpd.HTMLGenerationTools;
import me.totalfreedom.totalfreedommod.httpd.HTTPDPageBuilder;
import me.totalfreedom.totalfreedommod.httpd.HTTPDaemon;
import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD;
import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD.Method;
import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD.Response;
import me.totalfreedom.totalfreedommod.util.FLog;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.lang3.StringUtils;
@ -236,7 +236,7 @@ public class Module_schematic extends HTTPDModule
private boolean isAuthorized(String remoteAddress)
{
Admin entry = TotalFreedomMod.plugin.al.getEntryByIp(remoteAddress);
return entry != null && entry.isActivated();
return entry != null && entry.isActive();
}
private static class SchematicTransferException extends Exception