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

[Feature Request] Version managing of ForgedAlliance.exe #1352

Closed
Askaholic opened this issue Jul 15, 2019 · 4 comments
Closed

[Feature Request] Version managing of ForgedAlliance.exe #1352

Askaholic opened this issue Jul 15, 2019 · 4 comments

Comments

@Askaholic
Copy link
Collaborator

Askaholic commented Jul 15, 2019

It would be nice if the client could keep around a few versions of the game files to prevent excessive downloading when watching older replays, or in my case, when switching between the production server and the test server when those two are on different versions of the game.

EDIT: I actually ended up writing my own version manager as a separate cli application and it's been pretty useful. In doing so, I came up with a few ideas for how to store the files so that there is no duplication. What I ended up doing was storing files in a directory structure like this:

versions
├── 1
│   └── bin
│       ├── GDFBinary.dll
│       ├── init_ladder1v1.lua
│       ├── init_nonxt.lua
│       ├── SupComDataPathFAF.lua
│       └── SupComDataPath.lua
├── 3634
│   └── gamedata
│       └── faforever.faf
├── 3658
│   └── bin
│       └── init_faf.lua
├── 3677
│   └── gamedata
│       └── modules.nx2
├── 3708
│   ├── bin
│   │   └── ForgedAlliance.exe
│   └── gamedata
│       ├── effects.nx2
│       ├── env.nx2
...
├── 3709
│   ├── bin
│   │   ├── ForgedAlliance.exe
│   │   ├── init_ladder1v1.lua
│   │   └── SupComDataPath.lua
│   └── gamedata
│       ├── effects.nx2
│       └── env.nx2
├── 3712
│   ├── bin
│   │   └── ForgedAlliance.exe
│   └── gamedata
│       ├── effects.nx2
│       ├── env.nx2
...
└── index.json

where the first layer of directories uses the file version number and the second layer has the same structure as ProgramData. The index file is essentially used to cache API responses when querying for file versions/hashes. It looks like this:

{
  "files": [{
    "group": "bin",
    "md5": "33212d464270907d0d9c393590661ddd",
    "name": "ForgedAlliance.exe",
    "url": "https://content.faforever.com/legacy-featured-mod-files/updates_faf_files/ForgedAlliance.3713.exe",
    "version": 3713
  }, {
    "group": "bin",
    "md5": "453056145eb17db9adf48a25eb1a7fd6",
    "name": "init_faf.lua",
    "url": "https://content.faforever.com/legacy-featured-mod-files/updates_faf_files/init_faf_3658.lua",
    "version": 3658
  }],
  "patches": {
    "ladder1v1": {
      "id": "6",
      "versions": {}
    },
    "faf": {
      "id": "0",
      "versions": {
        "3712": {
          "files": [19, 1, 2, 3, 4, 5, 6, 7, 20, 21, 22, 23, 24, 13, 25, 26, 27, 28, 29]
        },
        "3713": {
          "files": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18]
        },
        "3714": {
          "files": [30, 1, 2, 3, 4, 5, 6, 7, 31, 32, 33, 34, 35, 13, 36, 37, 38, 39, 40]
        }
      }
    },
...
  }
}

where first it lists all of the file versions and file metadata in the order they were installed, and then it lists the featured mod information (really just the id and technical name) along with the installed versions and a list of indices referencing the required files in the file list.

When the user requests to switch to an installed patch version, the version manager can then verify the checksums of the required files and copy them to the corresponding ProgramData directory.

@Sheikah45
Copy link
Member

Does the game cache fix this?

@Askaholic
Copy link
Collaborator Author

It should fix the excessive downloading. Would still be nice if you could see what versions you have installed, delete them, and play them though, but you can close if you think that's a "wont do" sort of feature.

@Sheikah45
Copy link
Member

Hmm yeah I think that might be a little dangerous just in terms of possibility for desyncs and informing players on which version a game is.

@Sheikah45
Copy link
Member

This is fixed by the game cache.

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

No branches or pull requests

3 participants