-
Notifications
You must be signed in to change notification settings - Fork 15
Symlinked config monitoring #25
Description
If the mod is deployed using symlinks (Vortex) then the watcher can't discern and reload the changed config file.
It's a Nice-To-Have really:
- The
WatchForChangescould check if the config file is a symbolic link with something likeGetFileAttributeslooking forFILE_ATTRIBUTE_REPARSE_POINT, - Resolve the target path of a symlink by
CreateFilewithFILE_FLAG_OPEN_REPARSE_POINTandDeviceIoControl(to read the reparse data buffer), - Set up directory monitoring of the symlink's target directory.
Also btw., perhaps the config itself could be moved to a subdirectory since ReadDirectoryChangesW is a bit intensive and locking, and could interfere with other mods and game if they're logging much, potentially (I don't know NativeModLoader implementation, if it's async, etc.).
These are just some thoughts after few minutes of looking at the code after wishing NCT had a way to change it's settings live, like a BG3SE console command or MCM and noticing that it indeed has it - just not for my Vortex setup :-) Also, I am not a C++ dev and that's why I don't post a PR. These are just some ideas I came up with looking at win32 api docs.