-
Notifications
You must be signed in to change notification settings - Fork 708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CommonClient: Explicitly parse url arg as an archipelago:// url #3568
Conversation
should work, it doesn't, this fixes that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes are small and function properly. The change in Launcher.py does not cause errors in args to go unnoticed, since the errors are caught somewhere else.
Tested some scenarios with this change on an instance on my end. Everything looks good:
|
Appears to be superceded by #3714. Let me know if this was a mistake. |
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this part is still needed, if that's rolled into a different PR or this PR is reopened removing the Launcher.py changes idc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll reopen this and look at it soon, what exactly does this part do on its own?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currently argparse grabs the first positional arg and throws it into url, that's to be expected but does mean that launcher "text client"
puts the component name in the url block, this causes issues because the highlighted code block only checks if there is a url arg before overriding things
the updated code just confirms that the scheme of the url is correct (i.e. archipelago://blah@blah
) before applying any of the available values to the ctx to stop mishandling of any potential bad data
… not have merge issues later
Hmmm wait, so then wouldn't this break |
Oh I'm stupid |
Oh I see. That just doesn't even work at all. I thought that was something that was supposed to work, but I guess not |
Ok, well, then this change is correct, but now I'm wondering if launching CommonClient is super broken rn |
Ok, after some conversation on Discord, while this doesn't make anything worse or anything, I'm not quite sure whether this is the correct approach or whether it is complete. In my opinion, I would basically add an
at the end here. If we really think that If there are cases where "supported uses" of other components (such as Launcher) pass bad values to CommonClient that shouldn't be interpreted as a url, then we should fix those cases. If it's user error (i.e. they used Launcher args in an incorrect way, which caused something weird to be passed to CommonClient as the url), the most I would do is add warnings. |
What is this fixing or adding?
stops CommonClient from parsing the url arg when the value is not of format
archipelago://localhost:port
including fixing a current issue where the component name could override values in the--connect
arg## What is this fixing or adding?Launcher "Text Client" --connect archipelago.gg:38281should work, it doesn't, this fixes thatI don't particularly love the contents of the fix because I believe the "args" argument in the launcher parser is supposed to do this job, but I got no other input on discord so I'm hoping to get better input here## How was this tested?ranPython Launcher.py "Text Client" --connect archipelago.gg:38281
and saw it open the text client, connect to the address, and ask for slot namealso tested with rooms i had open using slotname:password@server:port and it automatically connected without issue## If this makes graphical changes, please attach screenshots.