I’ve tried implementing Economy in my game, but I’m confused about the services.
Why can the client write to currencies directly?
I set up a Cloud Code Script to handle access from the Game Server, but it says I don’t have permission to write to another player’s Economy Currency value.
I guess because the Server has no special Auth.
Is there a way to authenticate the server for this permission?
await ServerAuthenticationService.Instance.SignInFromServerAsync();
var token = ServerAuthenticationService.Instance.AccessToken;
ServerAuthenticationService doesnt exist in my Unity.Services.Authentication
package.
Am I missing something? It feels like I’m using these services wrong since everything seems centered around the local player.
Edit:
I had use
const currencies = new CurrenciesApi(context);
instead of
const currencies = new CurrenciesApi({ accessToken });
But my Question still persists, do these Enpoints need some kind of Auth for safety?