Fixed odd Html issues on Bungee systems #383 #380

This commit is contained in:
Rsl1122 2017-10-31 19:59:43 +02:00
parent f135c3192f
commit 41d148fc4c
2 changed files with 8 additions and 2 deletions

View File

@ -29,7 +29,11 @@ public class PostHtmlWebAPI extends WebAPI {
@Override
public Response onRequest(IPlan plugin, Map<String, String> variables) {
try {
String html = variables.get("html");
String htmlVariable = variables.get("html");
if (htmlVariable == null) {
return badRequest("Html was null");
}
String html = "<!DOCTYPE html>" + htmlVariable.split("<!DOCTYPE html>", 2)[1];
String target = variables.get("target");
InformationManager infoManager = plugin.getInfoManager();
switch (target) {
@ -60,8 +64,8 @@ public class PostHtmlWebAPI extends WebAPI {
public void sendInspectHtml(String address, UUID uuid, String html) throws WebAPIException {
addVariable("uuid", uuid.toString());
addVariable("html", html);
addVariable("target", "inspectPage");
addVariable("html", html);
super.sendRequest(address);
}

View File

@ -54,6 +54,7 @@ public class WorldPieCreator {
}
private static Map<String, Long> transformToAliases(Map<String, Long> playtimePerWorld) {
// TODO Optimization is possible
WorldAliasSettings aliasSettings = new WorldAliasSettings(Plan.getInstance());
Map<String, String> aliases = aliasSettings.getAliases();
@ -104,6 +105,7 @@ public class WorldPieCreator {
}
private static Map<String, GMTimes> transformToGMAliases(Map<String, GMTimes> gmTimesMap) {
// TODO Optimization is possible
WorldAliasSettings aliasSettings = new WorldAliasSettings(Plan.getInstance());
Map<String, String> aliases = aliasSettings.getAliases();