PhotonNetwork.ConnectUsingSettings when reconnecting fails silently
Options
This happens when i ConnectUsingSettings, then Disconnect, then ConnectUsingSettings again.
OnFailedToConnectToPhoton(DisconnectCause cause) and OnConnectionFail(DisconnectCause cause) don't get called.
OnJoinedRoom() isn't called either.
the logs look like this: https://www.dropbox.com/s/gk7m0un2rguo7qt/Screenshot (316).png?dl=0
What is Event 226?
OnFailedToConnectToPhoton(DisconnectCause cause) and OnConnectionFail(DisconnectCause cause) don't get called.
OnJoinedRoom() isn't called either.
the logs look like this: https://www.dropbox.com/s/gk7m0un2rguo7qt/Screenshot (316).png?dl=0
What is Event 226?
0
Comments
-
If figured it out. This optimization helps enormously with frequent calls like
setCustomProperties
, but it also restricts the basic room loading messages. So you have to be careful when you implement this that you either add your networkmanager, or wipe this out and redo it when you leave/enter a networked scene.if (PhotonNetwork.SendMonoMessageTargets == null) { PhotonNetwork.SendMonoMessageTargets = new System.Collections.Generic.HashSet<GameObject>(); } PhotonNetwork.SendMonoMessageTargets.Add(this.gameObject);
0 -
Hi @Statigar,
Thank you for choosing Photon!
I apologize about the delay to reply to your first post.
It seems like there is no link between the two posts. I'm going to answer first one.
To know when you are connected to Photon (which is most of the time is when you client is connected to Master Server):
You can implement in any MonoBehaviour:- If "AutoJoinLobby = false":
OnConnectedToMaster()
- If "AutoJoinLobby = true":
OnJoinedLobby()
OnDisconnectedFromPhoton()
Only after that you can re connect.
All PUN callbacks are listed inPhotonNetworkingMessage
enum and inIPunCallbacks
interface.What is Event 226?
226 is the code for AppStats event. Read more about this event here.
You can find out the predefined Photon event codes in EventCode class in "LoadBalancingPeer.cs".
0 - If "AutoJoinLobby = false":