Hey, I am using cloud code from an authenticated client, what I am trying to achieve is to make cloud code modify some data based on a request, before doing so I have to check if my player is in the lobby it says it is so I am calling IGameApiClient.Lobby.GetLobbyAsync with IExecutionContext.AccessToken which is getting rate limited, I think because I am using the same pc for both clients therefore hitting the limit of 1 request per second (both clients make the same request more or less at the same time).
Now, reading around I think the correct usage would be to use the ServiceToken since that is allegedly a “trusted” token used from CloudCode. That is giving me a Bad Request back. Now, am I fully misunderstanding what I am doing here? And if so what is the point of this ServiceToken, I would expect the CloudCode context to be able to act like an authoritative server since it runs on a “trusted” environment?
My request looks like this:
var lobbyResult = await m_gameApiClient.Lobby.GetLobbyAsync(ctx, ctx.ServiceToken, lobbyId);
What I get when I use the ServiceToken is:
Exception type: ApiException. Message: Bad Request
The same happens if I try to modify Lobby data when I am not the host, even if I use the ServiceToken.
Can anybody help?