Hello! We’re a small team that have just started building our first multiplayer game, and would like some guidance on our approach.
Currently, we have clients connecting directly to a Nakama instance - in our Kubernetes cluster - for authentication, storage & matchmaking. When a match is found, Nakama allocates a game server on our Agones fleet (FleetManager implementation PR soon, TM!).
We’re now looking to spike an implementation for metagame functionality (e.g. daily achievements, spending gold). We know we can achieve all of this with custom runtime modules; however, our devs are heavily C#-based, and our Go code is getting more and more hack-y.
We’d instead like to host our own gateway server responsible for interfacing with Nakama, which will expose it’s own endpoints for the client. Our idea is:
- Clients send an auth request, which is passed through to Nakama.
- When successful, the JWT is passed back to the client.
- When the gateway server receives any subsequent requests, it will restore the Nakama session from the provided JWT in the request in order to call the associated function in Nakama on behalf of the client.
We’re thinking this will essentially allow the gateway server to replace any functionality we might have otherwise used the custom runtime for.
Is this an accepted way to use Nakama, or are we overcomplicating things and should just use the runtime? Are there any gotcha’s we should be prepared for with this approach?
Thank you kindly for your time.