Hi,
I’m working on a Multiplayer game that makes use of Relay + UTP + Mirror. I’m using the most recent versions of Relay, UTP and Mirror, however to pair them all together I’m making use of this sample that’s linked on the official Relay manual: Unity Mirror sample, which I believe is about 2 years old at this point.
I continue getting this error when testing as a Host in editor:
Received error message from Relay: player timed out due to inactivity.
Followed by this error:
Relay allocation is invalid. See NetworkDriver.GetRelayConnectionStatus and RelayConnectionStatus.AllocationInvalid for details on how to handle this situation.
I’m aware of having to keep Relay connections alive manually when using UTP by frequently calling ScheduleUpdate on Host and Client NetworkDrivers (Keep a connection alive). From the digging I’ve done through the sample code I linked at the top of this post, it does implement ScheduleUpdate calls which get called every Mirror Server Tick for both Host and Clients.
This is where I’m lost. What I can say is that it only seems to happen on my second session of starting a host and playing my game. This leads me to believe I’m not doing the stopping of the networking correctly somehow. Because if I stop my editor and host a game, it’s fine. It’s only on consecutive hosted games without stopping play mode.
I make calls when the game is over to stop Mirror and Transport related networking. Not sure if anything else is supposed to be called for the set up I have.
Any help is appreciated!