viper
viper copied to clipboard
fix: Do not overwrite modified config files without warning
Config files commonly modified by players, like R2Northstar\mods\Northstar.CustomServers\mod\cfg\autoexec_ns_server.cfg
should not be overwritten without warning if their content has been changed.
To check if their content has changed, compare the content with that of the unmodified version of the file of the current install.
It's probably enough to have a few "whitelisted" files to perform this check on. Doing it over all files is likely not necessary.
There is an excludes
array in your viper.json
which you could add it to. I'll just add these files to the defaults, which would implement it.
I was mostly unaware mods had a cfg
folder in them, seems kind of dumb to not just have them in a mods/cfg
or R2Northstar/cfg
folder.
@GeckoEidechse is there a standard way to store mods configuration files?
Like are they all in mods/My.Mod/cfg/
folder, or all named *.cfg
(mods/My.Mod/**/*.cfg
)?
This would allow us to do some pattern matching to exclude them from being overwritten.
Like are they all in
mods/My.Mod/cfg/
folder, or all named*.cfg
(mods/My.Mod/**/*.cfg
)?
To my knowledge everything is in <mod>/cfg
, but the actual file names can be anything from .json
to .nut
, however I've seen a few which put the settings inside <mod>/mod.json
which seems like something we shouldn't try to merge.
Basically what 0neGal said. (I'm actually not too familiar with the mod structure myself.)
Note that there could also be a case where a mod updates its configuration files to add/remove parameters. I'm not sure how Viper would best handle such a situation tbh.
Unsure if this is much of a problem anymore, I don't know how ModSettings actually stores settings, but assuming that most mods by now use it, and it happens to store it somewhere outside of it's package folder (somehow?), then this would be fixed? And most of it did get merged into NS' core mods right?
Not really and honestly, since then things kinda changed and everything in Northstar.XXXXX
should be overwritten on update.
The config is unfortunately still not set up to be modified from somewhere separate but I'd consider that an upstream bug and not something that Viper should attempt to solve.