@classmethod
    @postonly
    @multiplayer_service
    @jsonify
    def join_any(cls, slug):
        params = request.params
        try:
            _ = params['gameSessionId'] # Check for compatibility with gamesite API which does use this
        except __HOLE__:
            response.status_int = 400
            return {'ok': False, 'msg': 'Missing game information.'}

        game = get_game_by_slug(slug)
        if not game:
            response.status_int = 404
            return {'ok': False, 'msg': 'Unknown game.'}

        with cls.lock:

            cls.last_player_id += 1
            player_id = str(cls.last_player_id)

            sessions = cls.sessions
            session = session_id = None
            for existing_session in sessions.itervalues():
                if existing_session.game == slug:
                    existing_session.update_status()
                    if existing_session.can_join(player_id):
                        session = existing_session
                        session_id = existing_session.session_id
                        break

            if session is not None:
                request_ip = get_remote_addr(request)

                session.add_player(player_id, request_ip)

                LOG.info('Player %s joins session %s', player_id, session_id)

                info = {'server': session.get_player_address(request.host, request_ip, player_id),
                        'sessionid': session_id,
                        'playerid': player_id,
                        'numplayers': session.get_num_players()}
            else:
                # No session to join
                info = {}
            return {'ok': True, 'data': info}
dataset/ETHPy150Open turbulenz/turbulenz_local/turbulenz_local/controllers/apiv1/multiplayer.py/MultiplayerController.join_any