I can drag and drop files into the networking example, and when I join from a browser that wasnāt there when the files were created it will load files that were previously created correctly. All very cool.
But how do I delete files that were stored in tiny storage when I donāt want them anymore? Once they are uploaded I get a callback in beginListenFilespawn engine_networking_files and they get added to the scene right away.
SyncDestroy is used for networking the destroy call on a object in the scene - it will not delete data on the backend server.
You can send an event for removing the file upload event so you will not download the file again when you come back to the room later - but I think thereās no code in engine right now for letting the backend know that you want to delete a file completely
For removing the event from the backend you can use this.context.connection.sendDeleteRemoteState(<guid>) with the guid of the object that is being spawned. Thatās not ideal but maybe works for the short term?
Iāll try itā¦ I have syncDestroy working and it deletes for all clients but when they reload the files come back in from the back endā¦ will let you know how the remote state deletion works
sendDeleteRemoteStateAll works but sendDeleteRemoteState didnātā¦ maybe I am getting the wrong GUID? I used let guid = (found.object as GameObject).guid ā¦ itās the same found.object I used syncDestroy on and the syncdestroy seemed to work
having trouble figuring out the GUID to use to deleteā¦ in beginListenFileSpawn if I log the GUID of the gltf file after loading it is different every timeā¦ should i be using the evt.file_hash that is coming in before the file gets loaded?
basically i am getting the object to delete by doing a raycastā¦ syncDelet works when i call it on that objectā¦ how do i get the GUID to use for the sendDeleteRemoteState call
I hardcoded a GUID from a console.log of the evt.guid and it worksā¦ now I just need to figure out how to preserve that info ā¦ looking at the userData field perhaps
is there any reason in the beginListenFileSpawn method in engine_networking_files.ts file I canāt just set the objects uuid after being created to the evt.guid from the file spawned event? it should be unique right?