Class IdleUsersService
Object
IdleUsersService
Keeps a registration on when which user has last issued a command.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetIdleTime
(String name) Retrieves the idle time in minutes, i,e.Returns the time that a user was inactive.Returns a list of users that have been idle for more than one hour.boolean
This method is mostly used to get the game to not do anything if nobody is playing, it's a good idea for efficiency reasons.removeUser
(String name) void
-
Constructor Details
-
IdleUsersService
public IdleUsersService()
-
-
Method Details
-
resetUser
-
removeUser
-
getIdleTime
-
getIdleTimeInMinAndSeconds
Returns the time that a user was inactive.- Parameters:
name
- the name of the user to check- Returns:
- String the number of minutes and seconds that the player has been idle in the following format: "(<min> min, <sec> sec idle)". Or empty string if user is not playing.
-
getIdleUsers
-
isNobodyPlaying
public boolean isNobodyPlaying()This method is mostly used to get the game to not do anything if nobody is playing, it's a good idea for efficiency reasons.- Returns:
- If nobody is playing the game, will return true, otherwise false.
-