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>
This commit is contained in:
qwint 2024-09-08 11:40:32 -05:00 committed by GitHub
parent 5021997df0
commit e4a5ed1cc4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 5 deletions

View File

@ -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()