예제 #1
0
 def next_begin(self, data):
     room_id = data.get('room_id', None)
     game_type = RoomTool.room_by(room_id)['game_type']
     if game_type == 'draw':
         self.draw_handler.next_begin(self.client, self.clients)
     elif game_type == 'chess':
         self.chess_handler.next_begin(self.client, self.clients)
예제 #2
0
    def current_topic(r_id):

        room = RoomTool.room_by(r_id)

        if room['status'] != RoomStatus.playing:
            return None

        users = UserTool.room_users(r_id)

        for user in users:
            if user:
                if user.get('status', None) == Status.action:
                    return user['topic']

        return None