Skip to content
This repository has been archived by the owner on Oct 27, 2022. It is now read-only.

How to store mod on the computer. #18

Open
marius851000 opened this issue Jan 3, 2021 · 1 comment
Open

How to store mod on the computer. #18

marius851000 opened this issue Jan 3, 2021 · 1 comment

Comments

@marius851000
Copy link

We need to store mod on the computer. Here is my idea:

How to store them :

  • As a compressed file (like a zip): can be compressed, but will need to be decompressed at run-time. Should also add some compexity.
  • As a decompressed folder: may take a bit more size (althought we can expect most of the game with important asset have their own compression method). It is simpler and doesn't need to be decompressed at run-time, but need to be decompressed ahead of time.

In which folder:
In lock file, we lock a certain package identifier and a version, so we expect every package with the same identifier and version are identical. So we can have the format <identifier><separator><version>. The identifier and version would need to be escaped or prohibit character so that they :

  1. do not conflict with separator
  2. doesn't use an illegal character

For this, I propose restricting the identifier and version field to a certain list of character (keep in mind that the identifier is not the displayed mind). I haven't yet made a list of such character, but this would most importantly prevent /, \, [, {, (, ], }, ) (the separator itself may just be a subfolder, a.k.a a / or \)

I'll start experimenting with this idea.

@marius851000
Copy link
Author

Additionally, having atomic operation would be a good plus. Journalised file system work good for this, so, when unpacking a folder, unpack it in a tempory folder, then move/hardlink it to final folder. This way, we can expect the file system to either have a complete folder, or no folder at all.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant