Hello community members,
I have just started to use Nakama for 2 days. I have started to check the capability of Nakama Client SDK to understand the whole solution is suitable for me or not. I want to explain one of my scenario which I could not find a way to solve it in the Client part.
- In our game, users can create a game room by clicking create a game,
- In the lobby we show them simplified room id to share with other players like 231-123.
- Other players can join the same room with this simplified and readable game id.
- Our problem starts here, as you know Nakama generates a more complicated id for matches. To come up with this problem, we create a simplified game id and write it to storage by mapping with real match id generated by Nakama.
- So other users can reach this real match id by querying related collections with simplified game id.
- According to my researches; we can just reach storage objects if we put the owner user id of storage objects to the query.
- But in our case, other users don’t have the owner user id of the storage object.
My Questions
-
I could not understand the logic behind this structure, if I put one storage object into the collection with a unique key and public read accessibility, why we need to have a user id to query this?
-
Is there any possibility to create global storage objects which can query by all other users without the owner user id? If not, Is here any client-side solution to complete the above scenario in Nakama
I am sorry if there is a similar question from now.
Updates
As I understand from other storage related posts;
Storage engine using {collection + key + userId} as an unique identifier for each record. This is the reason i could not reach the storage object without userId.
Also when I check source code, i see that we cannot change userId as null or anything else from client side, but we can change it from server side. To make workaround, most probably I need to call custom Rpc funtion after match is created from client, I hope that I can set userID null and I can reach this storage object just using collection and key.
This approach is clear for me now, but I still wonder why client is limited to blanking userId null.
Thank you.