mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-26 19:17:43 +01:00
Update active session state on inspect request
This commit is contained in:
parent
4214e33070
commit
bd83868094
@ -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.
|
||||
*
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user