From bbd31e455a23aa353350fe6407fa8c2f6799c06d Mon Sep 17 00:00:00 2001 From: Teddy Date: Mon, 2 Sep 2013 15:53:00 +0800 Subject: forcing users to logout when a new game started --- server/piztor/game_server.py | 6 ++++++ 1 file changed, 6 insertions(+) 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)) -- cgit v1.2.3-70-g09d2