Can you use IsMasterClient in a Photon (PUN) lobby?
I read here that Photon does not have a master client in the lobby (only in rooms). Yet in their example code they do something like this during the Asteroids game lobby. Why reference IsMasterClient if it has no use in lobbies?
btnReady.onClick.AddListener( () =>
{
isPlayerReady = !isPlayerReady;
SetPlayerIsReady( isPlayerReady );
Hashtable properties = new Hashtable() {{Settings.kIsPlayerReady, isPlayerReady}};
PhotonNetwork.LocalPlayer.SetCustomProperties( properties );
if ( PhotonNetwork.IsMasterClient )
{
FindObjectOfType<LobbyMainPanel>().LocalPlayerPropertiesUpdated();
}
} );
Answer by ncox27 · Jan 19 at 04:33 AM
The terminology is what makes it confusing. A Photon "Lobby" is not the same as a game lobby. The important thing to know is that once you have multiple players in a "game lobby", Photon recognizes that as a "Room".
For Photon, the Lobby is the space you are in after you have connected to the server but before you have either created or joined a space for other clients to join you. (This isn't EXACTLY true since connecting to the server doesn't always mean you have joined their lobby, but in my experience that workflow fits most cases). This would be the space you're in when you are either looking at a list of public rooms to hop in, deciding to create or join a private room, or getting your character ready to start matchmaking. Once you go past that step and join a public room, create or join a private room, or connect with someone via matchmaking, we traditionally call this the lobby, but for Photon purposes this is now recognized as a Room, in which case isMasterClient would be utilized.
Your answer
Follow this Question
Related Questions
Syncing live animations using PUN 2 Answers
Player names with photon PUN 1 Answer
Unity photon RPC problem 0 Answers
Sync the Dani Grappling Hook 0 Answers