BizHawkClient: Avoid error launching BizHawkClient via Launcher CLI (#3554)
* Core, BizHawkClient: Support launching BizHawkClient via Launcher command line * Revert changes to LauncherComponents.py
This commit is contained in:
parent
db5d9fbf70
commit
0d35cd4679
|
@ -1,9 +1,10 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import sys
|
||||||
import ModuleUpdate
|
import ModuleUpdate
|
||||||
ModuleUpdate.update()
|
ModuleUpdate.update()
|
||||||
|
|
||||||
from worlds._bizhawk.context import launch
|
from worlds._bizhawk.context import launch
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
launch()
|
launch(*sys.argv[1:])
|
||||||
|
|
|
@ -15,7 +15,7 @@ if TYPE_CHECKING:
|
||||||
|
|
||||||
def launch_client(*args) -> None:
|
def launch_client(*args) -> None:
|
||||||
from .context import launch
|
from .context import launch
|
||||||
launch_subprocess(launch, name="BizHawkClient")
|
launch_subprocess(launch, name="BizHawkClient", args=args)
|
||||||
|
|
||||||
|
|
||||||
component = Component("BizHawk Client", "BizHawkClient", component_type=Type.CLIENT, func=launch_client,
|
component = Component("BizHawk Client", "BizHawkClient", component_type=Type.CLIENT, func=launch_client,
|
||||||
|
|
|
@ -239,11 +239,11 @@ async def _patch_and_run_game(patch_file: str):
|
||||||
logger.exception(exc)
|
logger.exception(exc)
|
||||||
|
|
||||||
|
|
||||||
def launch() -> None:
|
def launch(*launch_args) -> None:
|
||||||
async def main():
|
async def main():
|
||||||
parser = get_base_parser()
|
parser = get_base_parser()
|
||||||
parser.add_argument("patch_file", default="", type=str, nargs="?", help="Path to an Archipelago patch file")
|
parser.add_argument("patch_file", default="", type=str, nargs="?", help="Path to an Archipelago patch file")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args(launch_args)
|
||||||
|
|
||||||
ctx = BizHawkClientContext(args.connect, args.password)
|
ctx = BizHawkClientContext(args.connect, args.password)
|
||||||
ctx.server_task = asyncio.create_task(server_loop(ctx), name="ServerLoop")
|
ctx.server_task = asyncio.create_task(server_loop(ctx), name="ServerLoop")
|
||||||
|
|
Loading…
Reference in New Issue