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:
Griatch 2013-09-14 23:18:36 +02:00
parent 4a5de04956
commit d74cce4dfe
7 changed files with 293 additions and 288 deletions

View file

@ -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