remove old, empty games

This commit is contained in:
Jannes Höke 2016-06-02 15:51:07 +02:00
parent 8dcd05dbb2
commit 91947abce0

View file

@ -47,6 +47,11 @@ class GameManager(object):
if chat_id not in self.chatid_games: if chat_id not in self.chatid_games:
self.chatid_games[chat_id] = list() self.chatid_games[chat_id] = list()
# remove old games
for game in list(self.chatid_games[chat_id]):
if not game.players:
self.chatid_games[chat_id].remove(game)
self.chatid_games[chat_id].append(game) self.chatid_games[chat_id].append(game)
return game return game