From e4a5ed1cc45b4d58ba4ebdf095e5a990581bcee3 Mon Sep 17 00:00:00 2001 From: qwint Date: Sun, 8 Sep 2024 11:40:32 -0500 Subject: [PATCH] CommonClient: Explicitly parse url arg as an archipelago:// url (#3568) * Launcher "Text Client" --connect archipelago.gg:38281 should work, it doesn't, this fixes that * more explicit handling of expected values * removing launcher updates meaning this pr cannot stand alone but will not have merge issues later * add parser failure when an invalid url is found --------- Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> --- CommonClient.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/CommonClient.py b/CommonClient.py index 122de476..911de422 100644 --- a/CommonClient.py +++ b/CommonClient.py @@ -1039,11 +1039,14 @@ def run_as_textclient(*args): if args.url: url = urllib.parse.urlparse(args.url) - 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.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) + else: + parser.error(f"bad url, found {args.url}, expected url in form of archipelago://archipelago.gg:38281") colorama.init()