How to connect Dedicated Server instance with Nakama Match Instance

Ok I have to change the answer to my own as I found a very great way to handle this.
This is more related to Agones but I would guess a lot of people will be using this combination and it would benefit nakama developers to know of it, without having to learn, understand and implement Fleet Manager for Agones.
Basically when sending a game server allocation request to agones you can provide info through labels and annotations .

  • Labels primary usage is to group game servers.
  • Annotations is what we want. we can put data such as Game Mode or Access Keys to agones game server so it knows what it should do before players actually connect.

For example an unreal engine dedicated server map might be a big open world. maybe we want it to be loaded even when in ready state, but maybe we don’t. maybe the players select what map they want to play when requesting match making by passing it in their nakama match making request using string and number parameters.

And after players have been matched by nakama you can provide the matched player ids and requested map to agones using annotations.

The agones unreal engine plugin provides you two options to get this information or listen to when these information have been changed so this way when the game server is allocated it can open the correct map for players to connect to.

That use case was a bit arbitrary and basic, as maybe the game server could have handled it internally after all clients have connected (some extra delay XD)

But more importantly you can provide access keys and user ids to agones.

This way agones can validate client connections and match them to their correct nakama user ids so when using server to server rpc calls on nakama you have the correct user ids to use for rewards, progression etc.