mirror of
https://github.com/evennia/evennia.git
synced 2026-03-20 14:56:30 +01:00
First version of OOBHandler put together. Might still have to rework it since it cannot properly handle multiple trackers tracking a single field on a given object.
This commit is contained in:
parent
4a5de04956
commit
d74cce4dfe
7 changed files with 293 additions and 288 deletions
|
|
@ -21,9 +21,6 @@ try:
|
|||
except ImportError:
|
||||
import pickle
|
||||
|
||||
dumps = lambda data: to_str(pickle.dumps(data, pickle.HIGHEST_PROTOCOL))
|
||||
loads = lambda data: pickle.loads(to_str(data))
|
||||
|
||||
# delayed imports
|
||||
_PlayerDB = None
|
||||
_ServerSession = None
|
||||
|
|
@ -327,6 +324,12 @@ class ServerSessionHandler(SessionHandler):
|
|||
"""
|
||||
return len(set(session.uid for session in self.sessions.values() if session.logged_in))
|
||||
|
||||
def session_from_sessid(self, sessid):
|
||||
"""
|
||||
Return session based on sessid, or None if not found
|
||||
"""
|
||||
return self.sessions.get(sessid)
|
||||
|
||||
def session_from_player(self, player, sessid):
|
||||
"""
|
||||
Given a player and a session id, return the actual session object
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue