bsmg / ModAssistant

Simple Beat Saber Mod Installer
MIT License
2.48k stars 419 forks source link

ModAssistant erroring out when new version of BeatSaber is available, but not installed. #239

Closed EllyKida closed 3 years ago

EllyKida commented 3 years ago

I saw that BeatSaber got updated, but I didn't wanted to update to 1.12.1 because I don't want my mods to break. So I tried changing the manifest to trick steam that I still have the old version which worked. But ModAssistand wouldn't open anymore as can be seen in the error message screenshot..

2020-10-13 21_55_47-Window

At first I thought by changing the manifest I broke ModAssistant, so I checked the config => nothing wrong. Changed the BeatSaber manifest back => Still error. So I read the error message. Thanks to Opensource and great programming by the developers, I found out that the "Game Version:" ModAssistand shows is loading a JSON from "https://versions.beatmods.com/versions.json" and there the version "1.12.1" was already included.

I thought that "System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary" seems to try to compare something. And after I updated BeatSaber to version 1.12.1 ModAssisant started up without an error (Except a blank screen in the "Mods" tab when "1.12.1" is selected).

I guess it wants to forcefully use the new 1.12.1 value it's got in the JSON but couldn't find it on my system because I didn't update. Only after Updating to the said version it worked.

I hope I could explain myself well enough that it can be understood. 😅

Anyways, Thanks for making this great tool. Hopefully the issue is fixed someday.

TheJmJ commented 3 years ago

I did a quick hotglue fix as seen above, and did a pull request https://github.com/Assistant/ModAssistant/pull/240 I couldn't completely understand the code in the quick glance I took in it, but that at least fixes the issue temporarily, or rather hides it under the rug.

bavis-m commented 3 years ago

The issue is that https://versions.beatmods.com/versions.json returns a 1.12.1 version, but https://alias.beatmods.com/aliases.json has no aliases for it. That's what it's trying to look up in the Dictionary (and failing to do)

Edit: it only looks up aliases if it doesn't immediately find a matching game version. The last version before 1.12.1 was 1.6.2, which was only an aliased version, so it triggered the code. Updating to 1.12.1 prevents that code path from running.

Edit2: looks like beatmods.com has fixed the issue by updating the aliases.json file. Still probably a good fix though, this missing data shouldn't cause a crash of ModAssistant.

luludotdev commented 3 years ago

240 should fix this going forwards