Skip to content

Commit

Permalink
CommonClient: Explicitly parse url arg as an archipelago:// url (#3568)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
qwint and NewSoupVi authored Sep 8, 2024
1 parent 5021997 commit e4a5ed1
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions CommonClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -1039,11 +1039,14 @@ async def main(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()

Expand Down

0 comments on commit e4a5ed1

Please sign in to comment.