I’m working with the Nakama Asset in Unity, and so far I’ve been able to Authenticae a user and Write data to storage. When I try to list those objects, I get the following error in Unity: Assets\NakamaClient.cs(33,35): error CS7036: There is no argument given that corresponds to the required formal parameter 'cursor' of 'IClient.ListUsersStorageObjectsAsync(ISession, string, string, int, string)'
Does anybody know what could be causing this? Thanks!
@EarthAdam Can you share your code that throws that error? It will be easier to help.
@novabyte sure. It’s the sample code given in the docs:
const string email = "adam@circaevum.com";
const string password = "password";
var session = await client.AuthenticateCustomAsync(email,password);
Debug.Log(session);
const int limit = 100; // default is 10.
var result = await client.ListUsersStorageObjectsAsync(session, "saves", session.UserId, limit);
Debug.LogFormat("List objects: {0}", result);`
I put this in my async void Start() function, right after the Client line that works for everything else so far.
Thanks, Adam
It turns out if I just put null
as the 5th value of ListUsersStorageObjectsAsync
, that takes care of it.
It might be worth updating the documentation for list-objects (at least for the Unity code) to include a default value for Cursor
.
@EarthAdam Thanks for the update. I’ve made an improvement to the client sdk which will be part of the next release and uses default arguments for limit and cursor so it matches the usage examples in the docs.
https://github.com/heroiclabs/nakama-dotnet/commit/de4c3913c1a2803dcf123fe4c079131ce7355651
@novabyte That was quick. Nice work!