Klasse PlayerActivityRepository

java.lang.Object
de.delinkedde.areashopreborn.persistence.PlayerActivityRepository

public final class PlayerActivityRepository extends Object
Stores observed player activity and idempotent inactivity warning claims.
  • Konstruktordetails

    • PlayerActivityRepository

      public PlayerActivityRepository(Database database)
      Creates the repository.
      Parameter:
      database - database owner
  • Methodendetails

    • recordSeen

      public void recordSeen(UUID playerId, String name, Instant observedAt) throws SQLException
      Records a player login without changing the original first-seen timestamp.
      Parameter:
      playerId - player identifier
      name - current account name
      observedAt - observation timestamp
      Löst aus:
      SQLException - when persistence fails
    • findInactiveOwners

      public List<InactiveOwner> findInactiveOwners(Instant cutoff, int limit) throws SQLException
      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 cutoff
      limit - 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 player
      thresholdDays - warning threshold in days
      policyVersion - stable version of the active policy
      notifiedAt - claim timestamp
      Gibt zurück:
      whether this call created the claim
      Löst aus:
      SQLException - when persistence fails
    • clearNotices

      public int clearNotices(UUID playerId) throws SQLException
      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

      public List<Integer> findNoticeThresholds(UUID playerId) throws SQLException
      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