WolvenKit / gpm

gpm or Game Package Manager is a tool for downloading, installing, uninstalling, building, and publishing mod packages
GNU Affero General Public License v3.0
7 stars 3 forks source link

How to store mod on the computer. #18

Open marius851000 opened 3 years ago

marius851000 commented 3 years ago

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

How to store them :

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 commented 3 years ago

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.