ebkr / r2modmanPlus

A simple and easy to use mod manager for several games using Thunderstore
MIT License
1.16k stars 181 forks source link

[BUG] Northstar doesn't actually update fully #1254

Open itscynxx opened 5 months ago

itscynxx commented 5 months ago

Describe the bug The way that R2MM goes about downloading, updating, and loading Northstar is incredibly scuffed. Here's precisely what I was able to test and confirm:

Downloading Northstar works fine, especially on a first time launching it. However, R2MM does something weird with the files. It sends all of the files to a folder called Northstar, which is fine, but then it sends the R2Northstar folder from the package to the same folder that has the Northstar folder in it.

R2MM also downloads all installed mods to r2mm-profile/R2Northstar/mods, so this is presumably something that got messed up when someone tried to fix another issue, and make a special case for Northstar. When first installing Northstar, it also sends the core mods (mods which Northstar uses for custom servers, and things that are edited inside the game) to r2mm-profile/R2Northstar/mods.

However, when updating Northstar via R2MM it does not send the core mods to r2mm-profile/R2Northstar/mods again. What this means is that R2MM updates Northstar and all related files in the r2mm-profile/Northstar folder, says "Northstar is up to date, we don't need to update", but never actually moves the updated files to where they're being loaded from (which is, again, r2mm-profile/R2Northstar)

Essentially, R2MM installs all Northstar stuff to folder 1. It then moves some stuff to folder 2, and tells the game to launch, from folder 1, using folder 2 for mods. All mods are installed to folder 2. When updating Northstar, R2MM only updates folder 1, and never sends updated mods folder 2 needs to actually be updated.

It should be noted, there must be some check that actually stops this movement (which ends up breaking it). When uninstalling and reinstalling through R2MM, it doesn't even move the r2mm-profile/Northstar/R2Northstar folder like it does with a fresh install, meaning the only way to actually update Northstar through R2MM is manually deleting the r2mm-profile/R2Northstar folder every update.

To Reproduce Steps to reproduce the behavior:

  1. Attempt to update Northstar from a previous installation
  2. Launch Modded
  3. R2MM uses the new NorthstarLauncher.exe and Northstar.dll from r2mm-profile/Northstar to launch the old, outdated mods from r2mm-profile/R2Northstar/mods

Although you won't be able to notice the breaking feature if you haven't installed a previous version of Northstar, Northstar writes logs of every time the game launched. Logs will be written in r2mm-profile/R2Northstar/logs, showing that the profile being used is that one.

Expected behavior R2MM storing the Northstar files properly so that updates would work right

Screenshots R2MM installs Northstar as following image

All Northtar files are kept in the Northstar folder image

R2MM moves the Northstar/R2Northstar folder to be where it's shown in screenshot 1, which moves the core mods Northstar uses image

Installed mods are also sent to the moved R2Northstar folder shown in screenshot 1 image

When R2MM updates Northstar, it only updates things in the Northstar folder, and doesn't move the updated core mods Below is an example of the Northstar/R2Northstar/mods folder core mods versus the R2Northstar/mods folder core mods versions

Correct version from Northstar/R2Northstar/mods image

Incorrect version from R2Northstar/mods (which R2MM tells Northstar to use) image

Additional context This is likely the issues we've been describing with R2MM for a while now. Hopefully some special condition can be made for Northstar to work properly in the manager

Idk if this issue makes any sense because I'm kinda out of it while writing. Please let me know if I need to clarify things

Fixing the issue Two main ways of fixing this issue:

  1. When updating mods, check if it's Northstar, and if it is, move the r2mm-profile/Northstar/R2Northstar/ folder to r2mm-profile/ like R2MM does on a fresh install of Northstar. This should replace the existing folder, and shouldn't cause other issues to my knowledge.

  2. Change the launch functionality to use the r2mm-profile/Northstar/R2Northstar profile instead of the r2mm-profile/R2Northstar profile. This requires removing the special check that moves the core mods to this folder on a first install, changing mods to be installed to r2mm-profile/Northstar/R2Northstar

I personally think 2 is a cleaner way of doing this, but is a lot more effort, and would require some kind of checking to ensure all of the user's old mods were moved alongside the change, as to not lose the old mods

itscynxx commented 5 months ago

A possibly better and more coherent recap of the issue:

Any time a file or folder is mentioned, it's that of the same name in the r2mm profile directory (so like R2MM/Titanfall2/profiles/Default/, for a default profile)

When downloading Northstar, r2mm saves everything to a folder simply called Northstar This is where NorthstarLauncher.exe is launched from, and where Northstar.dll (which has most of the functionality of Northstar's mod loading) is located in an R2MM install

Somewhere, there's a special case for Northstar in R2MM to manually move the Northstar/R2Northstar folder (mainly used for mods and log writing) to the root directory of the profile directory

Core mods (the three mods starting with Northstar that come included with Northstar) are already installed in the R2Northstar/mods folder, and mainly interact with logic inside the game to actually add things like a mods menu or server browser in game

These mods also usually see an update when other aspects of Northstar get an update

However, for some reason, R2MM only moves the R2Northstar folder if the folder does not already exist in the root directory of the profile. I am unsure if this is because it does a manual check, or the function used to move the folder does a check itself and only moves if it doesn't exist

This means that upon updating Northstar, R2MM updates things in the Northstar folder, but because R2Northstar already exists, it doesn't move the folder (which contains the new, updated core mods). This can be confirmed by checking that uninstalling Northstar does not remove the R2Northstar folder, and a fresh install will not move the folder as it already exists

This means that, essentially, only half of Northstar ever "truly" gets updated when using R2MM (I say "truly" as the copies inside of the Northstar/R2Northstar/mods folder do actually get updated)

Edit:

I recently found out the Northstar folder in the R2MM profile directory is seemingly not the one being used. This nulls out my previous points of fixing the issue. As I say in my issue about cleaning up unused Northstar files (#1280):

Keeping the Northstar folder in the Titanfall 2 directory, and keeping the R2Northstar folder in the R2MM profile directory may be more desirable than what I previously suggested, unless (as the other issue also says), it's more desirable to keep Northstar related things in the R2MM profile, in which case it's just that folder that should be used