mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-24 10:11:53 +01:00
Fixed world change not applying world playtime to sessions properly
This commit is contained in:
parent
fb8c381466
commit
335778d9af
@ -50,12 +50,14 @@ public class ActiveSession {
|
||||
}
|
||||
|
||||
public FinishedSession toFinishedSessionFromStillActive() {
|
||||
updateState();
|
||||
FinishedSession finishedSession = toFinishedSession(System.currentTimeMillis());
|
||||
finishedSession.getExtraData().put(ActiveSession.class, this);
|
||||
return finishedSession;
|
||||
}
|
||||
|
||||
public FinishedSession toFinishedSession(long end) {
|
||||
updateState(end);
|
||||
return new FinishedSession(playerUUID, serverUUID, start, end, afkTime, extraData.copy());
|
||||
}
|
||||
|
||||
@ -98,7 +100,11 @@ public class ActiveSession {
|
||||
}
|
||||
|
||||
public void updateState() {
|
||||
extraData.get(WorldTimes.class).ifPresent(times -> times.updateState(System.currentTimeMillis()));
|
||||
updateState(System.currentTimeMillis());
|
||||
}
|
||||
|
||||
public void updateState(long time) {
|
||||
extraData.get(WorldTimes.class).ifPresent(times -> times.updateState(time));
|
||||
}
|
||||
|
||||
public void changeState(String world, String gameMode, long time) {
|
||||
|
Loading…
Reference in New Issue
Block a user