Package crow.game.omnisrv
Class InMemoryActiveUserCollection
java.lang.Object
crow.game.omnisrv.InMemoryActiveUserCollection
- All Implemented Interfaces:
ActiveUserCollection
Implementation of
ActiveUserCollection that stores the list of active users in memory.-
Method Summary
Modifier and TypeMethodDescriptionintbooleanisActive(int userID) voidmarkActive(int userID) Mark the user as activevoidMark every user as inactive, essentially clearing this collection.voidmarkInactive(int userID) Mark the user as inactive.
-
Method Details
-
markActive
public void markActive(int userID) Description copied from interface:ActiveUserCollectionMark the user as active- Specified by:
markActivein interfaceActiveUserCollection- Parameters:
userID- The user identifier that will be marked active
-
markInactive
public void markInactive(int userID) Description copied from interface:ActiveUserCollectionMark the user as inactive.- Specified by:
markInactivein interfaceActiveUserCollection- Parameters:
userID- The user identifier that will be marked inactive.
-
isActive
public boolean isActive(int userID) - Specified by:
isActivein interfaceActiveUserCollection- Parameters:
userID- The user identifier to query- Returns:
- True if the user is active, false otherwise.
-
activeCount
public int activeCount()- Specified by:
activeCountin interfaceActiveUserCollection- Returns:
- The number of active users in the server.
-
markAllInactive
public void markAllInactive()Description copied from interface:ActiveUserCollectionMark every user as inactive, essentially clearing this collection.- Specified by:
markAllInactivein interfaceActiveUserCollection
-