Run Migrations! Added a is_connected field to Players to be able to more conveniently access online status from out-of-process (resolves issue 251). Also cleaned up and added features to the default website.

This commit is contained in:
Griatch 2012-09-17 19:19:20 +02:00
parent c53a9b5770
commit 21137cc830
10 changed files with 189 additions and 75 deletions

View file

@ -71,6 +71,12 @@ class ServerSession(Session):
player - the connected player
"""
# we have to check this first before uid has been assigned
# this session.
if not self.sessionhandler.sessions_from_player(player):
player.is_connected = True
# actually do the login by assigning session data
self.player = player
@ -134,6 +140,8 @@ class ServerSession(Session):
uaccount.save()
self.logged_in = False
self.sessionhandler.disconnect(self)
if not self.sessionhandler.sessions_from_player(player):
player.is_connected = False
def get_player(self):
"""