Klasse PlayerActivityRepository
java.lang.Object
de.delinkedde.areashopreborn.persistence.PlayerActivityRepository
Stores observed player activity and idempotent inactivity warning claims.
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanclaimNotice(UUID playerId, int thresholdDays, String policyVersion, Instant notifiedAt) Atomically claims a warning so concurrent or repeated scans cannot send it twice.intclearNotices(UUID playerId) Removes old-policy claims for a player after fresh activity.findInactiveOwners(Instant cutoff, int limit) Finds tracked owners last seen before a cutoff.findNoticeThresholds(UUID playerId) Lists warning thresholds waiting for delivery to a player.voidrecordSeen(UUID playerId, String name, Instant observedAt) Records a player login without changing the original first-seen timestamp.
-
Konstruktordetails
-
PlayerActivityRepository
Creates the repository.- Parameter:
database- database owner
-
-
Methodendetails
-
recordSeen
Records a player login without changing the original first-seen timestamp.- Parameter:
playerId- player identifiername- current account nameobservedAt- observation timestamp- Löst aus:
SQLException- when persistence fails
-
findInactiveOwners
Finds tracked owners last seen before a cutoff.Untracked legacy owners are deliberately excluded because their inactivity cannot be proven safely.
- Parameter:
cutoff- exclusive last-seen cutofflimit- maximum number of results- Gibt zurück:
- oldest candidates first
- Löst aus:
SQLException- when persistence fails
-
claimNotice
public boolean claimNotice(UUID playerId, int thresholdDays, String policyVersion, Instant notifiedAt) throws SQLException Atomically claims a warning so concurrent or repeated scans cannot send it twice.- Parameter:
playerId- warned playerthresholdDays- warning threshold in dayspolicyVersion- stable version of the active policynotifiedAt- claim timestamp- Gibt zurück:
- whether this call created the claim
- Löst aus:
SQLException- when persistence fails
-
clearNotices
Removes old-policy claims for a player after fresh activity.- Parameter:
playerId- active player- Gibt zurück:
- number of removed claims
- Löst aus:
SQLException- when persistence fails
-
findNoticeThresholds
Lists warning thresholds waiting for delivery to a player.- Parameter:
playerId- player identifier- Gibt zurück:
- thresholds ordered from earliest to most urgent
- Löst aus:
SQLException- when persistence fails
-