summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorTeddy <[email protected]>2013-09-02 15:53:00 +0800
committerTeddy <[email protected]>2013-09-02 15:53:00 +0800
commitbbd31e455a23aa353350fe6407fa8c2f6799c06d (patch)
treed4fbeb2197a73d90a24c463c902df78623d69485 /server
parent71cb89b264fe02b131d32a5a497571d70f31197b (diff)
forcing users to logout when a new game started
Diffstat (limited to 'server')
-rw-r--r--server/piztor/game_server.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/server/piztor/game_server.py b/server/piztor/game_server.py
index cc1bd89..60b7015 100644
--- a/server/piztor/game_server.py
+++ b/server/piztor/game_server.py
@@ -885,6 +885,12 @@ class GameStartHandler(RequestHandler):
tunnel.add(PushScoreData(team1.score, team2.score))
tunnel.push()
+ logger.info("Forcing logout...")
+
+ for user in self.session.query(UserModel) \
+ .filter(UserModel.comp_id == u.comp_id):
+ user.regen_token()
+
logger.info("GAME START!")
self.session.commit()
return self.pack(struct.pack("!B", _StatusCode.sucess))