Closed loicteixeira closed 6 years ago
implementing the feature itself is straightforward, but we need to discuss the API signature. I think there are two main approaches:
DataStore.SetProtected(string key, string value, Action<bool> callback = null)
DataStore.Set(string key, string value, bool global, Action<bool> callback = null)
to Set(string key, string value, AccessRestriction access, Action<bool> callback = null)
, where AccessRestriction is an enum:
public enum AccessRestriction { Public, Protected, Private }
In the later case we could also keep a method with the old signature and let it call the new method with the corresponding AccessRestrictionDataStore.SetProtected
could be a nice, but it would probably need DataStore.SetPublic
and DataStore.SetPrivate
as well. But anyway, DataStore.Set
would probably need rewriting to accommodate the new options (otherwise we will have a duplicated implementation of the Set
method) so we might as well go with option 2.
I agree with that the change needs to be backward compatible with the old method calling the new one. This should also issue a deprecation warning so developers have time to update and the old method can be removed in a couple version. The new signature looks good to me.
PS: I've updated the issue body with a link to the documentation for reference.
GameJolt does not yet support this feature and it wasn't supposed to appear in the official documentation. And as it seems it is not sure if they will implement it at all.
That's a shame. Thank you for your time.
Closing this issue then. This can be re-opened once there has been some progress on gamejolt/doc-game-api#24.
The DataStorage#Set endpoint now allows restrictions to be set on a specific key so only a specific user can update it.