In the game I work on, it is based on a P2P connection in Godot with the Nakama library and Nakama WebRTC. It is based on turns and so far everything has worked as expected, but I was given the need to implement logic in which the server would be involved in the multiplayer connection mainly to take game metrics and have a status of the players to reconnection of the game in case of loss of connection.
The normal thing would be to have the authoritative server from the beginning, but due to certain logic of the game and the Godot Multiplayer API, this would make it too complicated to change everything.
Also, one of the main things is to maintain the life state of a code that is generated to mask the match ID to make it more user friendly, which would be preferred to only exist during the time when all players are connected and the game is over + extra time in case of disconnection of all clients.
I tried to look for some Hook to capture when a user loses connection with Nakama and the session is closed but this has not been possible or at least there is no reference within the Nakama Doc.
What could I implement to maintain a client connection and a server connection simultaneously?