Create a mapped entry between the user's session and a user's character.
Create a mapped entry between the user's session and a user's character. Neither the player nor the session may exist in the current mappings if this is to work.
the session
the character
true
, if the session was association was made; false
, otherwise
Remove all entries related to the given session identifier from the mappings.
Remove all entries related to the given session identifier from the mappings. The character no longer counts as "online."
the session
any character that was afffected by the mapping removal
Hastily remove all mappings and ids.
Hastily remove all mappings and ids.
an unsorted list of the characters that were still online
Given some criteria, examine the mapping of user characters and find the ones that fulfill the requirements.
Note the signature carefully.
Given some criteria, examine the mapping of user characters and find the ones that fulfill the requirements.
Note the signature carefully.
A two-element tuple is checked, but only the second element of that tuple - a Player
- is eligible for being queried.
The first element is ignored.
Even a predicate as simple as { case ((x : Long, _)) => x > 0 }
will not work for that reason.
the conditions for filtering the live Player
s
a list of users's Player
s that fit the criteria
A class for storing
Player
mappings for users that are currently online. The mapping system is tightly coupled between theAvatar
class and to an instance ofWorldSessionActor
.Use:
1) When a users logs in during
WorldSessionActor
, associate that user's session id and their character (avatar).LivePlayerList.Add(session, avatar)
2) In between the previous two steps, a range of characters may be queried based on provided statistics.
LivePlayerList.WorldPopulation(...)
3) When the user leaves the game entirely, his character's entry is removed from the mapping.
LivePlayerList.Remove(session)