No Data received when trying to share a data to another client (Godot)

Godot 4.0 (Nakama Godot 4 Client v.3.3.1) + nakama(v3.22.0)

Hello/hi everyone Im having trouble here when sharing a data, I have two function here for read and write.

function for sharing a data to another and set read permission into a public
var data = {}
data[acc.user.id] = {
‘user_id’: acc.user.id
}

var result : NakamaAPI.ApiStorageObjects = await GlobalObject.client.write_storage_objects_async(GlobalObject.session, [
	NakamaWriteStorageObject.new("Player","member", 2, 1, JSON.stringify(data),'')
])

and here reading/receiving a data by another client.

var result : NakamaAPI.ApiStorageObjects = await GlobalObject.client.read_storage_objects_async(GlobalObject.session, [
	NakamaStorageObjectId.new("Player","member")
])

in the result there is no error but still received none. is there a problem with the version or something is wrong in my code.

I just found a solution guys its actually already in the topic here How to create global storage object from client1 and read it from client2 - #3 by Jorge.

here is the fixed code:
from
(Mistake)
var result : NakamaAPI.ApiStorageObjects = await GlobalObject.client.read_storage_objects_async(GlobalObject.session, [
NakamaStorageObjectId.new(“Player”,“member”)
])

to
(Solution)
var result = await GlobalObject.client.list_storage_objects_async(GlobalObject.session, “Player”, ‘’, 100)

1 Like