mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-02-11 16:50:21 +08:00
Changes to TPS serverOccupied calculation
- Ignored downtime that started when players were online from the calculation
This commit is contained in:
parent
d10aaa46d0
commit
56ebf0d3f8
@ -140,14 +140,15 @@ public class TPSMutator {
|
|||||||
tpsData.sort(new TPSComparator());
|
tpsData.sort(new TPSComparator());
|
||||||
for (TPS tps : tpsData) {
|
for (TPS tps : tpsData) {
|
||||||
long date = tps.getDate();
|
long date = tps.getDate();
|
||||||
int players = tps.getPlayers();
|
|
||||||
if (lastDate == -1) {
|
if (lastDate == -1) {
|
||||||
lastDate = date;
|
lastDate = date;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (players > 0) {
|
int players = tps.getPlayers();
|
||||||
activeTime += date - lastDate;
|
long diff = date - lastDate;
|
||||||
|
if (players > 0 && diff <= TimeUnit.MINUTES.toMillis(3L)) {
|
||||||
|
activeTime += diff;
|
||||||
}
|
}
|
||||||
|
|
||||||
lastDate = date;
|
lastDate = date;
|
||||||
|
Loading…
Reference in New Issue
Block a user