mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-27 02:21:30 +01:00
Made ActivityIndex use Active playtime instead of time with AFK #538
This commit is contained in:
parent
2c06662661
commit
5c60558422
@ -438,6 +438,10 @@ public class PlayerProfile {
|
||||
return sessions.mapToLong(Session::getAfkLength).sum();
|
||||
}
|
||||
|
||||
public static long getActivePlaytime(Stream<Session> sessions) {
|
||||
return sessions.mapToLong(Session::getActiveLength).sum();
|
||||
}
|
||||
|
||||
public void calculateWorldTimesPerServer() {
|
||||
if (worldTimesMap.containsKey(ServerInfo.getServerUUID())) {
|
||||
return;
|
||||
|
@ -45,17 +45,17 @@ public class ActivityIndex {
|
||||
// Playtime per week multipliers, max out to avoid too high values.
|
||||
double max = 4.0;
|
||||
|
||||
long playtimeWeek = PlayerProfile.getPlaytime(sessionsWeek.stream());
|
||||
long playtimeWeek = PlayerProfile.getActivePlaytime(sessionsWeek.stream());
|
||||
double weekPlay = (playtimeWeek * 1.0 / activePlayThreshold);
|
||||
if (weekPlay > max) {
|
||||
weekPlay = max;
|
||||
}
|
||||
long playtimeWeek2 = PlayerProfile.getPlaytime(sessionsWeek2.stream());
|
||||
long playtimeWeek2 = PlayerProfile.getActivePlaytime(sessionsWeek2.stream());
|
||||
double week2Play = (playtimeWeek2 * 1.0 / activePlayThreshold);
|
||||
if (week2Play > max) {
|
||||
week2Play = max;
|
||||
}
|
||||
long playtimeWeek3 = PlayerProfile.getPlaytime(sessionsWeek3.stream());
|
||||
long playtimeWeek3 = PlayerProfile.getActivePlaytime(sessionsWeek3.stream());
|
||||
double week3Play = (playtimeWeek3 * 1.0 / activePlayThreshold);
|
||||
if (week3Play > max) {
|
||||
week3Play = max;
|
||||
|
Loading…
Reference in New Issue
Block a user