Example #1
0
async def qt_main(app: QtWidgets.QApplication, data_dir: Path, args):
    app.network_client = None
    logging.info("Loading server client...")
    from randovania.gui.lib.qt_network_client import QtNetworkClient
    logging.info("Configuring server client...")
    app.network_client = QtNetworkClient(data_dir)
    logging.info("Server client ready.")

    options = _load_options()
    backend = create_backend(args.debug_game_backend, options)

    logging.info("Configuring game connection with the backend...")
    from randovania.game_connection.game_connection import GameConnection
    app.game_connection = GameConnection(backend)

    logging.info("Configuring qasync...")
    import qasync

    @qasync.asyncClose
    async def _on_last_window_closed():
        await app.network_client.disconnect_from_server()
        await app.game_connection.stop()
        logger.info("Last QT window closed")

    app.lastWindowClosed.connect(_on_last_window_closed,
                                 QtCore.Qt.QueuedConnection)

    await asyncio.gather(app.game_connection.start(),
                         display_window_for(app, options, args.command, args))
Example #2
0
async def qt_main(app: QApplication, data_dir: Path, args):
    from randovania.gui.lib.qt_network_client import QtNetworkClient
    from randovania.game_connection.game_connection import GameConnection

    app.network_client = QtNetworkClient(data_dir)

    backend = create_backend(args.debug_game_backend)
    app.game_connection = GameConnection(backend)

    @asyncClose
    async def _on_last_window_closed():
        await app.network_client.disconnect_from_server()
        await app.game_connection.stop()

    app.lastWindowClosed.connect(_on_last_window_closed,
                                 QtCore.Qt.QueuedConnection)

    options = _load_options()

    await asyncio.gather(app.game_connection.start(),
                         display_window_for(app, options, args.command, args))
Example #3
0
async def qt_main(app: QtWidgets.QApplication, data_dir: Path, args):
    from randovania.gui.lib.qt_network_client import QtNetworkClient
    from randovania.game_connection.game_connection import GameConnection

    app.network_client = QtNetworkClient(data_dir)
    options = _load_options()

    backend = create_backend(args.debug_game_backend, options)
    app.game_connection = GameConnection(backend)
    app.game_connection.tracking_inventory = options.tracking_inventory
    app.game_connection.displaying_messages = options.displaying_messages

    @asyncClose
    async def _on_last_window_closed():
        await app.network_client.disconnect_from_server()
        await app.game_connection.stop()
        logger.info("Last QT window closed")

    app.lastWindowClosed.connect(_on_last_window_closed,
                                 QtCore.Qt.QueuedConnection)

    await asyncio.gather(app.game_connection.start(),
                         display_window_for(app, options, args.command, args))