How should a player rejoin a match after reconnecting?

So we have cases where a match is going on in our mobile Unity game and the game gets interrupted for some reason. This could be a call, a notification of some sort, the user takes a screenshot etc. When that happens sockets on iOS will get disconnected on the OS level, so we preempt any random issues and just disconnect everything and then reconnect/reauthenticate when the game is again activated.

For the case of ongoing multiplayer matches, what is the correct way to resume? The server keeps the matches going just fine and the client authenticates ok, but match data doesn’t seem to flow anymore. Keep keep the old IMatch around that we got from JoinMatchAsync() but the sockets etc are all new. Do we need to call JoinMatchAsync() again to rejoin the match, or should the old match instance work ok through a new socket?

Oh, and the docs don’t seem mention these cases, something to add?

Hi @chakie yes the player should rejoin the match after disconnecting and reconnecting. And then depending on your game, you may need to implement logic for the player to sync with your match state.

Thank you for the confirmation. I went ahead and added a join call and it seems now to work kind of as expected with match traffic flowing as it should. Some minor state sync issues, but that’s entirely my own fault.

1 Like