Search Unity

Question How to use CheckForCatalogUpdates() with DownloadCatalogAsync()

Discussion in 'Addressables' started by Tayfe, Jun 5, 2020.

  1. Tayfe

    Tayfe

    Joined:
    Nov 21, 2011
    Posts:
    103
    We use
    DownloadCatalogAsync(pathToJSONfile)
    to load a catalog. This catalog has been downloaded before and is stores locally so it's accessed using a path like
    file://C:/path/to/catalog/file.json
    . For details you might check out my other thread.

    My problem is now that I don't know how to check whether this catalog has been updated. I thought I could just download and overwrite the local catalog file (.json and .hash) but even if it is a updated catalog
    CheckForCatalogUpdates()
    doesn't seem to recognize this.
    I am wondering where I have to save the catalog files so that the function recognizes the new catalog. Currently I am using
    Application.PersinstentDataPath
    but this doesn't seem to work.
    Is it possible to pass the catalog directly to
    CheckForCatalogUpdates()
    or is there a specified path where it's looking for an updated version?

    Thanks for trying to help!
     
  2. mateuszjaworski

    mateuszjaworski

    Joined:
    Aug 8, 2019
    Posts:
    12
    I have the same problem. CheckForCatalogUpdates returns the same thing, even when I actually upload some changes. I'd like to know whether it is a bug or a misuse, but there is not info about that anywhere...
     
  3. Tayfe

    Tayfe

    Joined:
    Nov 21, 2011
    Posts:
    103
    I am already thinking about implementing a function myself. Sadly there is no documentation about how the catalog.json file is structured. So I can just guess.
    And if there should be a change in further updates my own function might stop working so I don't feel very well doing it myself. But this is the last feature I'm missing so far so it would be awesome to finish it soon so I can start working on other features.
     
  4. Tayfe

    Tayfe

    Joined:
    Nov 21, 2011
    Posts:
    103
    I figured out that updating to addressables version 1.10.0 solved at least the problem with caching the catalog. So this
    is not up to date anymore! Instead we simple use the URL to the catalog as it should be done. Updates are working now as well.

    The new problem is now that the updates are done automatically. And yes, I have checked "Disable catalog updates on startup"! I had to change it's value manually in the json file because editing it in the inspector seems to have no impact on the actual file and is therefore not saved.
    So even this is checked now manually in the file itself and is still there after restarting the editor the update is still done automatically. So I upload a new assetbundle to my server and as soon as I try to load this bundle with a established internet connection it automatically downloads the bundle first. What can I do against it?
     
    FlightOfOne likes this.