Class InMemoryActiveUserCollection

java.lang.Object
crow.game.omnisrv.InMemoryActiveUserCollection
All Implemented Interfaces:
ActiveUserCollection

public class InMemoryActiveUserCollection extends Object implements ActiveUserCollection
Implementation of ActiveUserCollection that stores the list of active users in memory.
  • Method Details

    • markActive

      public void markActive(int userID)
      Description copied from interface: ActiveUserCollection
      Mark the user as active
      Specified by:
      markActive in interface ActiveUserCollection
      Parameters:
      userID - The user identifier that will be marked active
    • markInactive

      public void markInactive(int userID)
      Description copied from interface: ActiveUserCollection
      Mark the user as inactive.
      Specified by:
      markInactive in interface ActiveUserCollection
      Parameters:
      userID - The user identifier that will be marked inactive.
    • isActive

      public boolean isActive(int userID)
      Specified by:
      isActive in interface ActiveUserCollection
      Parameters:
      userID - The user identifier to query
      Returns:
      True if the user is active, false otherwise.
    • activeCount

      public int activeCount()
      Specified by:
      activeCount in interface ActiveUserCollection
      Returns:
      The number of active users in the server.
    • markAllInactive

      public void markAllInactive()
      Description copied from interface: ActiveUserCollection
      Mark every user as inactive, essentially clearing this collection.
      Specified by:
      markAllInactive in interface ActiveUserCollection