Fixed InspectCommand not updating inspect page

Possibly fixed Shutdown hook leaving traces of old sessions
This commit is contained in:
Rsl1122 2017-09-26 18:42:16 +03:00
parent 52ec9594ee
commit ec7b5d0aa5
5 changed files with 5 additions and 20 deletions

View File

@ -93,5 +93,6 @@ public class ShutdownHook extends Thread {
Log.toLog(this.getClass().getName(), e);
}
}
activeSessions.clear();
}
}

View File

@ -15,7 +15,6 @@ import main.java.com.djrapitops.plan.locale.Msg;
import main.java.com.djrapitops.plan.systems.processing.info.InspectCacheRequestProcessor;
import main.java.com.djrapitops.plan.utilities.Check;
import main.java.com.djrapitops.plan.utilities.MiscUtils;
import main.java.com.djrapitops.plan.utilities.html.HtmlUtils;
import main.java.com.djrapitops.plan.utilities.uuid.UUIDUtility;
import org.bukkit.ChatColor;
@ -76,7 +75,6 @@ public class InspectCommand extends SubCommand {
if (!Check.isTrue(plugin.getDB().wasSeenBefore(uuid), Locale.get(Msg.CMD_FAIL_USERNAME_NOT_KNOWN).toString(), sender)) {
return;
}
sender.sendMessage(Locale.get(Msg.CMD_INFO_FETCH_DATA).toString());
if (CommandUtils.isPlayer(sender) && plugin.getWebServer().isAuthRequired()) {
boolean senderHasWebUser = plugin.getDB().getSecurityTable().userExists(sender.getName());
if (!senderHasWebUser) {
@ -93,20 +91,4 @@ public class InspectCommand extends SubCommand {
}
}).runTaskAsynchronously();
}
private void sendInspectMsg(ISender sender, String playerName) {
sender.sendMessage(Locale.get(Msg.CMD_HEADER_INSPECT) + " " + playerName);
// Link
String url = HtmlUtils.getInspectUrlWithProtocol(playerName);
String message = Locale.get(Msg.CMD_INFO_LINK).toString();
boolean console = !CommandUtils.isPlayer(sender);
if (console) {
sender.sendMessage(message + url);
} else {
sender.sendMessage(message);
sender.sendLink(" ", Locale.get(Msg.CMD_INFO_CLICK_ME).toString(), url);
}
sender.sendMessage(Locale.get(Msg.CMD_CONSTANT_FOOTER).toString());
}
}

View File

@ -99,7 +99,7 @@ public class BukkitInformationManager extends InformationManager {
cachePlayer(uuid);
}
} else {
PageCache.loadPage("inspectPage: " + uuid, () -> new InspectPageResponse(this, uuid));
PageCache.cachePage("inspectPage: " + uuid, () -> new InspectPageResponse(this, uuid));
}
plugin.addToProcessQueue(new Processor<UUID>(uuid) {
@Override

View File

@ -44,7 +44,7 @@ public class MiscUtils {
}
public static int getTimeZoneOffsetHours() {
return -TimeZone.getDefault().getOffset(MiscUtils.getTime()) / (int) TimeAmount.HOUR.ms();
return TimeZone.getDefault().getOffset(MiscUtils.getTime()) / (int) TimeAmount.HOUR.ms();
}
/**

View File

@ -1,4 +1,6 @@
Placeholders:
worldPie1506439618596
worldPie1506439618596
${}