I can't leave room by clicking leave room button and it says operation leaveroom(254) not allowed

Second Question is

1 connected to photon using setting

2 on connected to master->photonNetwork.joinLobby()

3On JoinLobby->Load Scene from login to lobbyScene(created by myself)

3 while in lobbyScene if the player click Play button I called the following methods

4 If(photonNetwork.isconnected)=>photonNetwork.JoinorCreateRoom("ClassicRoom",maxplayer)


Are above steps corrects and synchonous?

Do I really need to join Lobby first or what is the problem if I called joinorCreateRoom directly on connected to master?

What is the difference?

\

Answers

  • JohnTube
    JohnTube ✭✭✭✭✭

    Hi @PhyoHtet123_,

    Are above steps corrects and synchonous?

    Steps look correct but not sure what "synchronous" mean exactly but you need to wait for callbacks always as each operation (method) is Asynchronous and expects a server response or event or even server switch to trigger a callback.

    Do I really need to join Lobby first or what is the problem if I called joinorCreateRoom directly on connected to master?

    What is the difference?

    You don't need to join any lobby unless you need to get the list of rooms available in lobbies of default type.

    Read more here.

    I can't leave room by clicking leave room button and it says operation leaveroom(254) not allowed

    We need the full exact error message but in general you can only call LeaveRoom only while joined to one. And once you call it you don't need to do it again (e.g. clicking a button multiple times may cause this).

    In general I invite you to finish PUN Basics Tutorial OR finish a good YouTube series about PUN 2.

    Also if you are just starting a new project, we highly recommend starting with Photon Fusion which is replacing PUN and Photon Bolt.

  • Thanks you so much for your reply.It is helpful