Exemplo n.º 1
0
 def post (self):
     """
     Process the req from a client/player to join a room
     """
     userid = users.get_current_user ().user_id ()
     player = Player.from_id (userid)
     if not player.is_playing:
         return DeathMatch.join_latest_or_new (player)
     return DeathMatch.resume (player)
Exemplo n.º 2
0
 def get (self):
     userid = users.get_current_user ().user_id ()
     player = Player.from_id (userid)
     if player.is_playing:
         self.template_values.update ({'gamekey' : player.game_in })
     clientid_for_channel = player.create_channel ()
     token = channel.create_channel (clientid_for_channel)
     self.template_values.update ({'token' : token,
                                 'userid' : player.keyname})
     return self.render ('index.html')
Exemplo n.º 3
0
 def post (self):
     userid = users.get_current_user ().user_id ()
     message = self.request.get ('m', '')
     logging.info (message)
     Player.from_id (userid).chat (message)