First steps towards a full account system (multiple Character with one Player); added the Player-level methods.
This commit is contained in:
parent
91281e6bb8
commit
261454ff0a
2 changed files with 90 additions and 10 deletions
|
|
@ -228,12 +228,15 @@ class ServerSessionHandler(SessionHandler):
|
|||
"""
|
||||
return len(set(session.uid for session in self.sessions.values() if session.logged_in))
|
||||
|
||||
def sessions_from_player(self, player):
|
||||
def sessions_from_player(self, player, sessid=None):
|
||||
"""
|
||||
Given a player, return any matching sessions.
|
||||
"""
|
||||
uid = player.uid
|
||||
return [session for session in self.sessions.values() if session.logged_in and session.uid == uid]
|
||||
if sessid:
|
||||
return [session for session in self.sessions.values() if session.logged_in and session.sessid == sessid and session.uid == uid]
|
||||
else
|
||||
return [session for session in self.sessions.values() if session.logged_in and session.uid == uid]
|
||||
|
||||
def sessions_from_character(self, character):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue