heroiclabs / nakama-unity

Unity client for Nakama server.
https://heroiclabs.com/docs/unity-client-guide
Other
411 stars 75 forks source link

Update Nakama UnityPackage Problem in IApiReadStorage #122

Closed daviddaco1 closed 2 years ago

daviddaco1 commented 2 years ago

argument 2: cannot convert from 'nakama.storage object id' to 'nakama.iapireadstorage objectid[]'

IApiStorageObjects result = null; result = await Client.ReadStorageObjectsAsync(Session, new StorageObjectId { Collection = "Missions", Key = "missions_state", UserId = Session.UserId });

lugehorsam commented 2 years ago

Hi @daviddaco1 you can see in the function signature for reading storage objects that it accepts an array, not a single storage object ID:

 public async Task<IApiStorageObjects> ReadStorageObjectsAsync(ISession session,
            IApiReadStorageObjectId[] ids = null, RetryConfiguration retryConfiguration = null, CancellationTokenSource canceller = null)

So use the array format instead and you should be fine (e.g., new StorageObjectId[]{})