Skip to content

Conversation

@mircearoata
Copy link
Member

Introduces a Provider interface, which includes functions with similar signatures for all the requests that are made to SMR.
The interface is implemented by

  • ficsitProvider, which forwards the call to the existing ficsit.* method
  • localProvider, which uses the information from the download cache and converts it to the ficsit.* structs
  • MixedProvider, which contains an Offline field, based on which it either forwards the call to ficsitProvider or localProvider

The cached info is kept in memory, and it is loaded initially by cli.InitCLI, with newly downloaded mods being added to it as part of the download process. The cache can be reloaded, if necessary, using cache.LoadCache.

Since the cache is meant to be a backup system and not a primary one, invalid cache files found while loading are logged, but do not result in an error.

Closes #7

@Vilsol Vilsol merged commit e4b02a7 into satisfactorymodding:master Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Completed

Development

Successfully merging this pull request may close these issues.

Offline Support

2 participants