Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question About pricing (Answered)

Discussion in 'Cloud Save' started by Jeryl, Aug 31, 2023.

  1. Jeryl

    Jeryl

    Joined:
    Sep 18, 2015
    Posts:
    42
    Hi,
    If I simply want to query if the player has a specific key, without reading the key or writing, does that count as a read?
    Thanks
     
  2. MiTschMR

    MiTschMR

    Joined:
    Aug 28, 2018
    Posts:
    358
    From my understanding, every time you use a method that starts with load, retrieve or whatever will count. But I don't know how it is implemented behind the scenes, but since all the methods generate webrequests and API calls, it would make sense if that is the case.
     
  3. EmilF_Unity

    EmilF_Unity

    Unity Technologies

    Joined:
    Jun 10, 2022
    Posts:
    16
    Hi Jeryl,

    MiTschMR is correct in their interpretation that any load, list, or retrieve method will count as a read. Unless you already have the relevant data locally from a previous read, the only way to check if a key exists is to try and read that key.
     
  4. Jeryl

    Jeryl

    Joined:
    Sep 18, 2015
    Posts:
    42
    Ok, thank you both.
    So if I understand correctly, usage is calculated by API calls, not read / calls?
    If I use
    Code (CSharp):
    1. List<string> keys = await CloudSaveService.Instance.Data.RetrieveAllKeysAsync();
    2.         for (int i = 0; i < keys.Count; i++)
    3.         {
    4.             Debug.Log(keys[i]);
    5.         }
    it counts as 1 usage, no matter how many keys I am reading in that call, right?
    If that's the case, my issue is a non issue :)
     
  5. MiTschMR

    MiTschMR

    Joined:
    Aug 28, 2018
    Posts:
    358
    From my understanding, yes, that is one API call to get all keys, meaning it counts as 1 read.
     
  6. Jeryl

    Jeryl

    Joined:
    Sep 18, 2015
    Posts:
    42
    Awesome, thanks a lot