I have an issue which I believe might be a bug in the Photon Voice autoconnection logic. I have a game with both online and offline modes, where for the offline mode I use the PhotonNetwork.offlineMode flag. There are 3 steps that cause the issue.
1. Connect to Photon server using PhotonNetwork.ConnectToRegion and match into a room.
2. Leave the room, PhotonNetwork.Disconnect () and go into PhotonNetwork.offlineMode, then create a new room using PhotonNetwork.CreateRoom (). At this point, Photon Voice automatically connects to the server, even though we are in offlineMode (note that this occurs even if step 1 is skipped, and it connects to the default region "eu").
3. Leave the offline room, then attempt to reconnect to PUN server using PhotonNetwork.ConnectToRegion. On the first attempt, PhotonNetwork.connectionState goes from Disconnected to Connected, but there is no OnConnectedToMaster callback, and PhotonNetwork.connected and PhotonNetwork.connectedAndReady get stuck in a false state. On subsequent attempts to connect, the warning displays "ConnectToRegion() failed. Can only connect while in state 'Disconnected'. Current state: Connected".
The core of the issue is that in Step 3:
if (PhotonNetwork.connectedAndReady) // Always returns false
JoinOrCreateRoom ();
else
PhotonNetwork.ConnectToRegion (...); // No OnConnectedToMaster callback to then join or create room
Should Photon Voice not connect to server when creating an offline room? Are the connection state vars incorrect due to Photon Voice being connected but PUN not being connected?
I have followed the guide for using offline mode, are my steps correct for it?