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

Assets Repository and Mechanism #66

Open
MirisWisdom opened this issue Oct 22, 2020 · 3 comments
Open

Assets Repository and Mechanism #66

MirisWisdom opened this issue Oct 22, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@MirisWisdom
Copy link

Many moons ago, HXE was going to have a little package manager feature built into it. At the moment, it's got a rudimentary update mechanism.

These two concepts can be combined into one asset management system, and this issue will serve as a public thread for discussing the whole thing.

@MirisWisdom MirisWisdom self-assigned this Oct 22, 2020
@MirisWisdom MirisWisdom transferred this issue from MirisWisdom/HXE.Legacy Nov 5, 2020
@MirisWisdom
Copy link
Author

MirisWisdom commented Nov 8, 2020

Draft for the data structure of a repository object:
image

XML representation of a sample repository object state:

<?xml version="1.0" encoding="utf-8"?>
<Repository xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Title>The SPV3 Updates Repository</Title>
  <Path>https://domain.tld/updates.xml</Path>
  <Type>XML</Type>
  <Assets>
    <RepositoryAsset>
      <Name>spv3.exe</Name>
      <Path>.</Path>
      <Versions>
        <AssetVersion>
          <ID>1</ID>
          <CRC>10248192</CRC>
          <Downloads>
            <VersionDownload>
              <URL>https://domain.tld/version_01/spv3.exe</URL>
              <CRC>10248192</CRC>
              <Type>Binary</Type>
            </VersionDownload>
            <VersionDownload>
              <URL>https://mirror.tld/spv3.v01.zip</URL>
              <CRC>40962048</CRC>
              <Type>ZIP</Type>
            </VersionDownload>
          </Downloads>
          <Patches />
        </AssetVersion>
        <AssetVersion>
          <ID>2</ID>
          <CRC>16384543</CRC>
          <Downloads />
          <Patches>
            <VersionPatch>
              <URL>https://domain.tld/spv3.v02.patch</URL>
              <CRC>1287343</CRC>
              <Original>1024819</Original>
              <Type>Binary</Type>
            </VersionPatch>
            <VersionPatch>
              <URL>https://mirror.tld/spv3.v02.patch.zip</URL>
              <CRC>1287343</CRC>
              <Original>1024819</Original>
              <Type>ZIP</Type>
            </VersionPatch>
          </Patches>
        </AssetVersion>
      </Versions>
    </RepositoryAsset>
    <RepositoryAsset>
      <Name>a10.map</Name>
      <Path>maps</Path>
      <Versions>
        <AssetVersion>
          <ID>1</ID>
          <CRC>74631950</CRC>
          <Downloads>
            <VersionDownload>
              <URL>https://domain.tld/maps/a10v1.7z</URL>
              <CRC>23749889</CRC>
              <Type>LZMA</Type>
            </VersionDownload>
            <VersionDownload>
              <URL>https://mirror.tld/spv3/downloads/maps/a10v1.lzma</URL>
              <CRC>84277634</CRC>
              <Type>LZMA</Type>
            </VersionDownload>
          </Downloads>
          <Patches />
        </AssetVersion>
        <AssetVersion>
          <ID>2</ID>
          <CRC>51673276</CRC>
          <Downloads />
          <Patches>
            <VersionPatch>
              <URL>https://domain.tld/spv3.a10v2.patch</URL>
              <CRC>43839584</CRC>
              <Original>12895894</Original>
              <Type>Binary</Type>
            </VersionPatch>
            <VersionPatch>
              <URL>https://mirror.tld/spv3/patches/a10/v02.patch.zip</URL>
              <CRC>78938447</CRC>
              <Original>43839584</Original>
              <Type>ZIP</Type>
            </VersionPatch>
          </Patches>
        </AssetVersion>
      </Versions>
    </RepositoryAsset>
  </Assets>
</Repository>

@MirisWisdom
Copy link
Author

Simplified the data structure a little, with an emphasis on convention over configuration:

{
  "Repositories": [
    {
      "Title": "The HCE Repository",
      "Path": "https://hce.tld/repository.json",
      "Description": "The Official SPV3 Updates Repository",
      "Assets": [
        {
          "Name": "ui.map",
          "Path": "maps",
          "Versions": [
            {
              "Hash": 1034723826,
              "Parent": 2856549778,
              "Downloads": [
                {
                  "URL": "https://hce.tld/downloads/ui.map",
                  "Hash": 1386814934
                }
              ],
              "Patches": [
                {
                  "URL": "https://hce.tld/downloads/ui.map-0x1024.diff",
                  "Hash": 1890108194
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "Title": "The SPV3 Repository",
      "Path": "https://spv3.tld/repository.json",
      "Description": "The Official SPV3 Updates Repository",
      "Assets": []
    }
  ]
}

MirisWisdom pushed a commit that referenced this issue Feb 6, 2021
@BinToss BinToss added the enhancement New feature or request label Apr 7, 2021
@BinToss
Copy link
Member

BinToss commented Oct 26, 2022

My gut tells me it would be better to keep the executable and library asset metadata separate from the game asset metadata.

My (scant) experience with NuGet and other package managers makes me believe it would be best to have each game asset's metadata be in separate files so they could be fetched individually (or by group of related files or file structure).

Chimera's install path and file name(s) have changed a few times over the years. If we are able to update to the latest Chimera release, then migrating the user's SPV3 setup from and older Chimera to the latest Chimera might be...better done as a (cross-platform?) script distributed with the package rather than hardcoded. Older chimera paths include the following:

version shipped w/ SPV3 path(s)
0.40-202 [x] ./controls/chimera.dll; ./mods/*.dll via Monolith Mod Loader 0.3.0
0.50-581 [ ] ./controls/*.dll; ./mods/*.dll via MML 0.3.0
1.0.0_2019-04-06 [ ] ./chimera.dll via MML 1.0.5 [FileVersion 1.0.0.5] (./strings.dll)
1.0.0* [ ] ./strings.dll; MML built in

If Linux compatibility is successful, then a cross-platform script (or a custom old-data/new-data convention) may be necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants