Update active session state on inspect request

This commit is contained in:
Rsl1122 2017-09-26 18:48:19 +03:00
parent 4214e33070
commit bd83868094
2 changed files with 15 additions and 1 deletions

View File

@ -3,6 +3,7 @@ package main.java.com.djrapitops.plan.systems.cache;
import main.java.com.djrapitops.plan.Log;
import main.java.com.djrapitops.plan.Plan;
import main.java.com.djrapitops.plan.data.Session;
import main.java.com.djrapitops.plan.utilities.MiscUtils;
import java.sql.SQLException;
import java.util.HashMap;
@ -47,6 +48,12 @@ public class SessionCache {
}
}
public void refreshActiveSessionsState() {
for (Session session : activeSessions.values()) {
session.getWorldTimes().updateState(MiscUtils.getTime());
}
}
/**
* Used to get the Session of the player in the sessionCache.
*

View File

@ -6,8 +6,10 @@ package main.java.com.djrapitops.plan.systems.processing.info;
import com.djrapitops.plugin.command.CommandUtils;
import com.djrapitops.plugin.command.ISender;
import main.java.com.djrapitops.plan.api.IPlan;
import main.java.com.djrapitops.plan.locale.Locale;
import main.java.com.djrapitops.plan.locale.Msg;
import main.java.com.djrapitops.plan.systems.cache.DataCache;
import main.java.com.djrapitops.plan.systems.processing.player.PlayerProcessor;
import main.java.com.djrapitops.plan.utilities.MiscUtils;
import main.java.com.djrapitops.plan.utilities.html.HtmlUtils;
@ -32,7 +34,12 @@ public class InspectCacheRequestProcessor extends PlayerProcessor {
@Override
public void process() {
MiscUtils.getIPlan().getInfoManager().cachePlayer(getUUID());
IPlan plugin = MiscUtils.getIPlan();
plugin.getInfoManager().cachePlayer(getUUID());
DataCache dataCache = plugin.getInfoManager().getDataCache();
if (dataCache != null) {
dataCache.refreshActiveSessionsState();
}
sendInspectMsg(sender, playerName);
}