Add GetPlayerRestoreStatus Check
BobyStar
A
Networking.GetPlayerRestoreStatus(GameObject)
and PlayerData.GetPlayerRestoreStatus(VRCPlayerApi)
that returns a custom enum with the values: Incompatible
, Awaiting
, Success
, Failed
, & NoDataToRestore
.This would only work on networked objects that can store persistence data like PlayerData or PlayerObjects with an Enable Persistence component. Other objects will always return the
Incompatible
value.This would allow worlds to ask for a particular object's persistence status for many things:
*
Incompatible
- This object does not support persistence. Use a PlayerObject with the Enable Persistence component.*
Awaiting
- Data has not been received from the server so the world knows to wait until a further update before trying to read/write persistence data for that object.*
Success
- Data was successfully restored from the server without any exceptions from VRChat's side. The world knows it is safe to read and write data to it.*
Failed
- Data restoration encountered an error on VRChat's side and data should not be manipulated for data loss. The world can present an error message and/or allow the player to clear their data.*
NoDataToRestore
- There was no data to restore from the server. The world knows this is a new player, a new update bringing a new persistent compatible object, or a player who has recently cleared their data. This also indicates to the world that this object is ready for writing new persistence data.Log In