mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-23 09:37:54 +01:00
Add active session to PlayerContainer when queried
Affects issues: - Fixed #2022
This commit is contained in:
parent
347e945a4c
commit
3f8c18e86f
@ -17,8 +17,6 @@
|
||||
package com.djrapitops.plan.placeholder;
|
||||
|
||||
import com.djrapitops.plan.delivery.domain.container.PlayerContainer;
|
||||
import com.djrapitops.plan.delivery.domain.keys.PlayerKeys;
|
||||
import com.djrapitops.plan.gathering.cache.SessionCache;
|
||||
import com.djrapitops.plan.storage.database.DBSystem;
|
||||
import com.djrapitops.plan.storage.database.queries.containers.ContainerFetchQueries;
|
||||
|
||||
@ -99,7 +97,6 @@ public final class PlanPlaceholders {
|
||||
|
||||
if (uuid != null) {
|
||||
player = dbSystem.getDatabase().query(ContainerFetchQueries.fetchPlayerContainer(uuid));
|
||||
SessionCache.getCachedSession(uuid).ifPresent(session -> player.putRawData(PlayerKeys.ACTIVE_SESSION, session));
|
||||
} else {
|
||||
player = null;
|
||||
}
|
||||
|
@ -22,6 +22,7 @@ import com.djrapitops.plan.delivery.domain.keys.Key;
|
||||
import com.djrapitops.plan.delivery.domain.keys.PlayerKeys;
|
||||
import com.djrapitops.plan.delivery.domain.mutators.PerServerMutator;
|
||||
import com.djrapitops.plan.delivery.domain.mutators.SessionsMutator;
|
||||
import com.djrapitops.plan.gathering.cache.SessionCache;
|
||||
import com.djrapitops.plan.gathering.domain.ActiveSession;
|
||||
import com.djrapitops.plan.gathering.domain.BaseUser;
|
||||
import com.djrapitops.plan.gathering.domain.FinishedSession;
|
||||
@ -91,6 +92,7 @@ public class PlayerContainerQuery implements Query<PlayerContainer> {
|
||||
container.putSupplier(PlayerKeys.MOB_KILL_COUNT, () -> SessionsMutator.forContainer(container).toMobKillCount());
|
||||
container.putSupplier(PlayerKeys.DEATH_COUNT, () -> SessionsMutator.forContainer(container).toDeathCount());
|
||||
|
||||
SessionCache.getCachedSession(uuid).ifPresent(session -> container.putRawData(PlayerKeys.ACTIVE_SESSION, session));
|
||||
return container;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user