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:
parent
c53a9b5770
commit
21137cc830
10 changed files with 189 additions and 75 deletions
|
|
@ -96,7 +96,7 @@ class PlayerManager(TypedObjectManager):
|
|||
"""
|
||||
Returns a list of player objects with currently connected users/players.
|
||||
"""
|
||||
return [player for player in self.all() if player.sessions]
|
||||
return self.filter(db_is_connected=True)
|
||||
|
||||
@returns_typeclass_list
|
||||
@returns_player_list
|
||||
|
|
@ -116,6 +116,8 @@ class PlayerManager(TypedObjectManager):
|
|||
"""
|
||||
Returns a QuerySet containing the player User accounts that have been
|
||||
connected within the last <days> days.
|
||||
|
||||
days - number of days backwards to check
|
||||
"""
|
||||
end_date = datetime.datetime.now()
|
||||
tdelta = datetime.timedelta(days)
|
||||
|
|
@ -166,7 +168,6 @@ class PlayerManager(TypedObjectManager):
|
|||
return matches
|
||||
return self.filter(user__username__iexact=ostring)
|
||||
|
||||
|
||||
def swap_character(self, player, new_character, delete_old_character=False):
|
||||
"""
|
||||
This disconnects a player from the current character (if any) and connects
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue