I re-read some comments of this super long thread started 10 years ago, and got into a mood of making a sprint with the development of the virtual file system. (It took a week or so.) It can't be so complicated, I thought, and indeed, its complexity is just a fraction of the Monogame migration's. So here it is, interested developers please see the pull request
on GitHub. I made the PR in a hope that Ryan had not done much coding work on this feature yet. At least this is what I concluded from this discussion thread.
Comments I also documented in the code for not losing it:
The virtual file system can be initialized from a config file with lines e.g. C:\dir\archive.zip\subdir\ /MSTS/mountpoint/, or from a directory. Found subsequent archives are auto-mounted to their respective locations. The configuration file consits of lines of format:
Drive:\SystemPath\ /MountPoint/
SystemPath
- may use "/" or "\", but MountPoint may use "/" only as a directory separator.
- with spaces in it must be quoted, e.g. "C:\My Routes\USA85\" /MSTS/ROUTES/USA85/
- referring to a directory must end with "/" or "\" to assure that only _below_ dirs and files will be visible _below_ the mount point.
- referring to an archive must not end with "/" or "\", e.g. C:\TEMP\MSTS1.2.zip /MSTS/
- may refer to an archive subdirectory, e.g.: C:\routes.zip\USA3\ /MSTS/ROUTES/USA3/
- may _not_ refer to a single non-archive file, neither a non-archive file within an archive.
- is case-insensitive.
- nested archives are unsupported. (archive inside another archive)
MountPoint
- must end with "/" to avoid confusion and to assure that mounting will be done _below_ the given path.
- may not contain spaces, may not be quoted.
- is case-insensitive, will be converted to all-uppercase internally.
Since I am not a software architect, and I wrote this whole thing from the top of my head, a deep review would be very welcome. If James or Chris is still around here, it would be really helpful from them to take a look onto the code. The code is based on
SharpCompress to extract the archives. I haven't made changes to contrib software in the OpenRails repository, but as long as someone uses a simple directory as the VFS "configuration profile", everything should work as before, in this case the change is transparent. The user interface in the Menu Options surely needs some refinement, I just made a quick change on it without much design. One can select a file as well on the Content frame now, and there is an Experimental setting to possible log all VFS file accesses. I left the OpenRails code where files get written intact, although this VFS also has writing abilities by my intention, to system directories only, not to archives. (The code is there theoretically, but I have not tested that extensively.)