0neGal / viper

Launcher+Updater for TF|2 Northstar
https://0negal.github.io/viper
GNU General Public License v3.0
152 stars 21 forks source link

bug: Viper doesn't read out ns_startup_args.txt #92

Closed GeckoEidechse closed 2 years ago

GeckoEidechse commented 2 years ago

Describe the bug Technically not so much a bug as unexpected behaviour from a user's perspective. For a while now I was wondering why when launching Northstar from Viper would reset my ns_startup_args.txt even without an update pending. (I usually launch Northstar via the Launcher executable)

Turns out Viper stores the state of the startup args in it's own storage (I think) and overwrites ns_startup_args.txt on launch / when saving settings.

This is problematic when a user manually edits ns_startup_args.txt, as then launching Nortstar with Viper wipes the made changes. When opening the settings, Viper should read out the contents of ns_startup_args.txt and display those.

To Reproduce Steps to reproduce the behavior:

  1. Edit ns_startup_args.txt
  2. Launch Viper and go to settings
  3. Launch options still shows the old options.
  4. Go back out and launch game
  5. Launch options displayed in Viper are used
  6. Check ns_startup_args.txt, file was reset to state displayed in Viper

Expected behavior Viper should read out ns_startup_args.txt when opening settings instead of relying on its own internal save.

Screenshots None

Version: v1.2.4

Additional Info None

0neGal commented 2 years ago

This was actually originally noted down in the release:

Your launch arguments may or may not be reset when first launching Viper after the update.

And yes it is a bug, however the majority of the people using Viper won't edit the startup args separate to Viper, and so I sort of disregarded it, because in my head it would only be a problem for the initial startup after the new release, but nope, it's just every time you edit it outside of Viper then launch Viper.

The reason it happens is because of the fact that we still have to have default startup args, this can be worked around, it was just a quick and dirty solution for the time being, I'll have a look at it when I got the time, possibly tomorrow.

0neGal commented 2 years ago

Ideally #93 should fix this, however I did brief testing only, if you were to edit the nsargs while Viper is running it'll still set them to what Viper thinks is the correct one. But I don't think that's all a big problem. And I haven't found the exact steps to reproduce, I simply wanted to get a PR up, and if you're able to test it that'd be lovely...

I'll also try testing it further tomorrow...

0neGal commented 2 years ago

Did some extra testing, and it seems to work just fine, so I'll merge it and close this issue :)

GeckoEidechse commented 2 years ago

Also just remembered that with the next release with v1.6.0 Northstar will try to register a URI handler for northstar:// URIs and if denied Northstar will add a launch arg to ns_startup_args.txt to prevent re-asking for registering the handler.

So, uhm, good thing this Viper issue was fixed in time ^^

0neGal commented 2 years ago

Very much so, what is this handler meant for? Click to join servers or?

GeckoEidechse commented 2 years ago

Basically yeah. Click a northstar://<some server id, dunno the exact format> link and you join that server.

c.f.: