Search Unity

Explicitly load cached external catalog

Discussion in 'Addressables' started by Redtail87, Jun 12, 2020.

  1. Redtail87

    Redtail87

    Joined:
    Jul 17, 2013
    Posts:
    125
    Hey,

    I am loading an external catalog and have it set to automatically cache with the use of the .hash file.
    Is there a way to load the cached catalog even when the server catalog has been updated, then be able to tell when the catalog has updated?

    The use case is the user downloads the content catalog, uses it, then exits the application.
    The catalog is updated on the server.
    The next time the user launches the application, they have the option to update, or to keep using the cached one.

    it seems when I load the catalog it always grabs the new one, and if I load the cached catalog manually it can't tell when the server updates when using CheckForCatalogUpdates().

    Any ideas?
    Thanks.
     
  2. ProtoTerminator

    ProtoTerminator

    Joined:
    Nov 19, 2013
    Posts:
    586
    The external catalog API is severely lacking. I even found a bug having to do with them. Hopefully they'll expand the usefulness of external catalogs soon after they get through their bugs/stability sprint.
     
  3. Redtail87

    Redtail87

    Joined:
    Jul 17, 2013
    Posts:
    125
    Yea, it does seem to be slowly getting better though.
    So in the meantime I figured out a sorta hacky way to get it to work.

    Download the catalog normally the first use
    Manually load the cached catalog for normal use
    To check for an update, manually compare the hash files from the local cache and the remote server
    Download the catalog normally again to update the cache with the latest.

    Seems to work so far.
     
  4. HEROTECH70

    HEROTECH70

    Joined:
    May 24, 2017
    Posts:
    74
    Do you have any examples to show for this solution?
     
  5. Redtail87

    Redtail87

    Joined:
    Jul 17, 2013
    Posts:
    125
    I moved away from this method a long time ago and I would not recommend it.

    No real solution, currently we just force the updates on the user for the core application bundles, and lock them out of the content until you update.

    Addressables has updated a lot since then though, so this process might have improved since then.