- Home /
OnConnectedToMaster() vs IsConnectedAndReady?
Hi there,
I'm confused by the callback "OnConnectedToMaster()", the bool "PhotonNetwork.IsConnectedAndReady" and the various types of servers (1. name server, 2. master server, 3. game server) which Photon PUN can connect with.
Question: When I'm calling "PhotonNetwork.ConnectUsingSettings()", to which of the above type of servers does it connect? If it connects successfully using "PhotonNetwork.ConnectUsingSettings()" should that call "OnConnectedToMaster()" AND set "PhotonNetwork.IsConnectedAndReady" to true? I'm asking because I use "PhotonNetwork.ConnectUsingSettings()" and then I experience that "PhotonNetwork.IsConnectedAndReady" is ALREADY TRUE and my coroutine continues trying to open a room but the callback OnConnectedToMaster has not happened yet.
Happy to explain more of the context of the problem if needed.
Best, Flurin
Answer by YasinJavaid_ · Sep 24, 2021 at 08:14 AM
Hi, call stack of calling PhotonNetwork.ConnectUsingSettings()
if appSettings has IsMasterServerAddress then its connect to ConnectToMaster() and then its connected to ConnectToMasterServer()
or
if app settings has UseNameServer and Server string is empty then it will connects to ConnectToNameServer()
or
if app settings has FixedRegion then it will connects to ConnectToRegionMaster(region);
PhotonNetwork.IsConnectedAndReady will return false in following situations NetworkingClient == null LoadBalancingPeer == null ClientState.PeerCreated: ClientState.Disconnected: ClientState.Disconnecting: ClientState.DisconnectingFromGameServer: ClientState.DisconnectingFromMasterServer: ClientState.DisconnectingFromNameServer: ClientState.Authenticating: ClientState.ConnectingToGameServer: ClientState.ConnectingToMasterServer: ClientState.ConnectingToNameServer: ClientState.Joining: ClientState.Leaving:
and
returns true offlinemode is true all above case not met.
hope you get what you looking for.
Your answer
Follow this Question
Related Questions
Callback for DNS entry error using Photon Networking 0 Answers
[PHOTON PUN] Players cant shoot each other? 1 Answer
Unity networking tutorial? 6 Answers
Photon pun problem on send and read request 0 Answers
Join Error photon 0 Answers