Closed angrybino closed 3 years ago
Controlling how ProfileService saves data or attaching listeners to when (before or after) ProfileService does the saves is firstly redundant, because the built-in auto save cycle and release saving are already going to ensure properly saved data well beyond a necessary threshold. It's also worth mentioning that manual saving via Profile:Save()
is not (entirely) the right tool to ensure proper developer product saving - Roblox API provides unique PurchaseId
purchase identifiers via the MarketplaceService.ProcessReceipt
callback where said identifiers can be used to check whether the profile has properly saved the identifier via Profile.MetaData.MetaTagsLatest
.
ProfileService has a system that may steal your active profiles at any time from an external server. This means that in this case profile management code would only receive an event that the profile is stolen without any chance to make a final save and the only thing that's going to be saved is the last state Profile.Data
was in. That's why you're supposed to always have Profile.Data
in the most recent savable state at all times - any changes to player data have to be instantly reflected inside Profile.Data
instead of waiting for the next save cycle. All of that is part of how ProfileService ensures data safety.
Currently, there is no way to control how profiles are saved. A
BindToSave
function for profiles would be really useful as it would allow users to control how they want to save the profile. This also gives the user more flexibility on creating custom data interfaces.Save
to save the profileCancel
to cancel the save for the profileUse cases:
Cancel
to cancel the save (prevent unnecessary requests).Example code:
This would also prevent additional throttling.