Skip to content
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

Alternate mod dirs for validation and manual installs #3891

Merged

Conversation

HebaruSan
Copy link
Member

Problem

In KSP-CKAN/KSP2-NetKAN#84, the validation script happily installed files to BepInEx/plugins/QuestariaAerospace/BepInEx/plugins/QuestariaAerospace and didn't complain:

https://github.com/KSP-CKAN/KSP2-NetKAN/actions/runs/5967777987/job/16190169201

image

There's a "GameData within GameData" validator in Netkan that catches the equivalent issue for KSP1.

Cause

The "GameData within GameData" check is hard-coded to use the string GameData.

Changes

  • Now IGame.AlternateModDirectoriesRelative defines an array of strings specifying alternative locations where mods can be installed
    • This contains BepInEx/plugins for KSP2 and nothing for KSP1
  • Now we scan both the primary and alternate mod dirs for manually installed DLLs
  • Now the "GameData within GameData" checks the primary and alternate mod dirs, which makes it work for the above case:
$ netkan.exe --game KSP2 NetKAN/QuestariaAereospace.netkan
88958 [1] WARN CKAN.NetKAN.Transformers.SpaceWarpInfoTransformer (null) - Dependencies from swinfo.json missing from module: lfo
90045 [1] FATAL CKAN.NetKAN.Program (null) - BepInEx/plugins directory found within BepInEx/plugins:
BepInEx/plugins/QuestariaAerospace/BepInEx/plugins/QuestariaAerospace/addressables/AddressablesLink/link.xml
BepInEx/plugins/QuestariaAerospace/BepInEx/plugins/QuestariaAerospace/addressables/catalog.json
BepInEx/plugins/QuestariaAerospace/BepInEx/plugins/QuestariaAerospace/addressables/settings.json
BepInEx/plugins/QuestariaAerospace/BepInEx/plugins/QuestariaAerospace/addressables/StandaloneWindows64/defaultlocalgroup_unitybuiltinshaders_7891cbe984cbeb1f2d1f8278873f00dc.bundle
BepInEx/plugins/QuestariaAerospace/BepInEx/plugins/QuestariaAerospace/addressables/StandaloneWindows64/questariaaerospace_assets_all_9f16c5859564ddf24dd943dd94e9b57a.bundle
BepInEx/plugins/QuestariaAerospace/BepInEx/plugins/QuestariaAerospace/assets/plumes/BE-4.json
BepInEx/plugins/QuestariaAerospace/BepInEx/plugins/QuestariaAerospace/assets/plumes/IQNTR.json
BepInEx/plugins/QuestariaAerospace/BepInEx/plugins/QuestariaAerospace/assets/plumes/IQparrotEngine.json
BepInEx/plugins/QuestariaAerospace/BepInEx/plugins/QuestariaAerospace/localizations/english.csv
BepInEx/plugins/QuestariaAerospace/BepInEx/plugins/QuestariaAerospace/QuestariaAerospace.dll
BepInEx/plugins/QuestariaAerospace/BepInEx/plugins/QuestariaAerospace/swinfo.json

@HebaruSan HebaruSan added Enhancement New features or functionality Easy This is easy to fix Netkan Issues affecting the netkan data labels Aug 24, 2023
@HebaruSan HebaruSan added the Core (ckan.dll) Issues affecting the core part of CKAN label Aug 25, 2023
Copy link
Member

@techman83 techman83 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks @HebaruSan !

@HebaruSan HebaruSan merged commit 2950cbb into KSP-CKAN:master Aug 30, 2023
10 checks passed
@HebaruSan HebaruSan deleted the feature/multigame-nested-gamedata-check branch August 30, 2023 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core (ckan.dll) Issues affecting the core part of CKAN Easy This is easy to fix Enhancement New features or functionality Netkan Issues affecting the netkan data
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants