Relayed match with some stateful info on server?


I have a board game that is best to use the relayed match design. I only have a few issues and wish that someone would guide me to the right direction:

  1. A match is indefinite (about 100 matches, and people can come and leave at will), how can I prevent the server from closing the match?

  2. How to Store persistent data within a match, like boardState. – I looked into user storage and found that only owner has permission to modify the data, so it wouldn’t be applicable in this scenario. what is the best way to store data on the server for a relayed match?

  3. I already have server side code written in dart/python so hence I do not want to go with the authoritative approach, having migrate that piece of code to nakama module in go/ts/lua. Is it good practice to have a server-side code login to nakama as a special user and relay messages from there? ie. check if a move is valid and return a valid board-state of the match?

thank you.

Hi @tpham3783,

A server-relayed (client authoritative) match will close as soon as the last player leaves the match. In order to have persistent matches you should use a server authoritative match.

Similarly, the answer to your second question on storing persistent match state is to use server authoritative matches rather than store match state in storage objects.

With regards to your 3rd point, I would not advise trying to use some kind of designated Nakama user as a message relay. The advised approach for both of the things you need here is server authoritative matches.

I hope this helps.