From be8e76f30b3b393a21814dc63062196e9ece31e8 Mon Sep 17 00:00:00 2001 From: qwint Date: Wed, 19 Jun 2024 11:39:28 -0500 Subject: [PATCH 1/4] Launcher "Text Client" --connect archipelago.gg:38281 should work, it doesn't, this fixes that --- CommonClient.py | 3 ++- Launcher.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CommonClient.py b/CommonClient.py index 19dd44f592a4..b39211d567cc 100644 --- a/CommonClient.py +++ b/CommonClient.py @@ -1034,7 +1034,8 @@ async def main(args): if args.url: url = urllib.parse.urlparse(args.url) - args.connect = url.netloc + if url.netloc: + args.connect = url.netloc if url.username: args.name = urllib.parse.unquote(url.username) if url.password: diff --git a/Launcher.py b/Launcher.py index e4b65be93a68..149c5bfff6f2 100644 --- a/Launcher.py +++ b/Launcher.py @@ -330,7 +330,8 @@ def main(args: Optional[Union[argparse.Namespace, dict]] = None): help="Pass either a patch file, a generated game or the name of a component to run.") run_group.add_argument("args", nargs="*", help="Arguments to pass to component.") - main(parser.parse_args()) + args, unknown_args = parser.parse_known_args() + main(args) from worlds.LauncherComponents import processes for process in processes: From 38e930be205ac2b672bd198d915988a1e0c3c088 Mon Sep 17 00:00:00 2001 From: qwint Date: Thu, 25 Jul 2024 13:55:37 -0500 Subject: [PATCH 2/4] more explicit handling of expected values --- CommonClient.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CommonClient.py b/CommonClient.py index b39211d567cc..fd12aa959f15 100644 --- a/CommonClient.py +++ b/CommonClient.py @@ -1034,12 +1034,12 @@ async def main(args): if args.url: url = urllib.parse.urlparse(args.url) - if url.netloc: + if url.scheme == "archipelago": args.connect = url.netloc - if url.username: - args.name = urllib.parse.unquote(url.username) - if url.password: - args.password = urllib.parse.unquote(url.password) + if url.username: + args.name = urllib.parse.unquote(url.username) + if url.password: + args.password = urllib.parse.unquote(url.password) colorama.init() From 07636b37239fc6548a0723bc656f480c45f1b356 Mon Sep 17 00:00:00 2001 From: qwint Date: Thu, 5 Sep 2024 23:39:30 -0500 Subject: [PATCH 3/4] removing launcher updates meaning this pr cannot stand alone but will not have merge issues later --- Launcher.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Launcher.py b/Launcher.py index 3b688d6c0f14..6b66b2a3a671 100644 --- a/Launcher.py +++ b/Launcher.py @@ -330,8 +330,7 @@ def main(args: Optional[Union[argparse.Namespace, dict]] = None): help="Pass either a patch file, a generated game or the name of a component to run.") run_group.add_argument("args", nargs="*", help="Arguments to pass to component.") - args, unknown_args = parser.parse_known_args() - main(args) + main(parser.parse_args()) from worlds.LauncherComponents import processes for process in processes: From 9d986def4e1e91ed6275320fa3251ea143c1e9af Mon Sep 17 00:00:00 2001 From: qwint Date: Sun, 8 Sep 2024 10:46:11 -0500 Subject: [PATCH 4/4] add parser failure when an invalid url is found --- CommonClient.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CommonClient.py b/CommonClient.py index f51074630bce..57c7cf49c380 100644 --- a/CommonClient.py +++ b/CommonClient.py @@ -1045,6 +1045,8 @@ async def main(args): args.name = urllib.parse.unquote(url.username) if url.password: args.password = urllib.parse.unquote(url.password) + else: + parser.error(f"bad url, found {args.url}, expected url in form of archipelago://archipelago.gg:38281") colorama.init()