playMaker

Author Topic: Photon 2 - Can't Join Room[SOLVED]  (Read 4308 times)

fromfame

  • Junior Playmaker
  • **
  • Posts: 78
  • Sloppy PM Veteran
Photon 2 - Can't Join Room[SOLVED]
« on: June 03, 2020, 04:54:24 PM »
I've connected to Master then created a room which was successful, however upon joining the room (of the same name as room created) it always gives me this error.

Quote
JoinRoom failed. Client is on GameServer (must be Master Server for matchmaking) and ready. Wait for callback: OnJoinedLobby or OnConnectedToMaster.

I don't even know how to join a gameserver yet, not sure what happened.

I've attached a screen shot below, I've labeled the sequence. Would appreciate help.
« Last Edit: June 10, 2020, 01:29:00 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon 2 - Can't Join Room
« Reply #1 on: June 04, 2020, 01:59:26 AM »
Hi,

 You already are in a room, so you are on a "GameServer", you can't join a room while in a room, you must first leave the room and come back to the "MasterServer", and from there, you can join a room again.

Bye,

 Jean

fromfame

  • Junior Playmaker
  • **
  • Posts: 78
  • Sloppy PM Veteran
Re: Photon 2 - Can't Join Room
« Reply #2 on: June 04, 2020, 02:16:01 AM »
I see, so by creating a room I’m also joining that room.

It’s interesting the action (or call) works like that, thanks for clarifying!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon 2 - Can't Join Room
« Reply #3 on: June 04, 2020, 02:21:49 AM »
Hi,

 yes, it's by design within PUN, you can't create a room without joining it de facto.

Bye,

 Jean

fromfame

  • Junior Playmaker
  • **
  • Posts: 78
  • Sloppy PM Veteran
Re: Photon 2 - Can't Join Room
« Reply #4 on: June 04, 2020, 01:05:55 PM »
Hey Jean, took me half the day but I found out why things have been so inconsistent for me!

I was following this video https://www.youtube.com/watch?v=V_YaXdvqmOg

Turns out both the actions (Connect to Master, Create Room, Etc) and Photon's GLOBAL SYSTEM EVENTS (PHOTON / Connect To Master or PHOTON / On Create Room, Etc) both call to Photon and will conflict if they do it after each other.

The issue I had above was that I called to Photon already by using the global event 'PHOTON / ON CREATE ROOM' instead of first using 'Create Room' action to set the details I want, then call in the action:)

Note for anyone who's confused in the future!
« Last Edit: June 07, 2020, 04:47:12 PM by fromfame »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon 2 - Can't Join Room
« Reply #5 on: June 05, 2020, 07:25:58 AM »
Hi,

 I don't think you are correct here.

connect to master doesn't create a room, and creating a room can not work if you are not on the master server or on the lobby server.

These global events are driven by photon callback themselves. you don't send them manualy, they must only be used for feedback, not for controlling pun.

Bye,

 Jean

fromfame

  • Junior Playmaker
  • **
  • Posts: 78
  • Sloppy PM Veteran
Re: Photon 2 - Can't Join Room
« Reply #6 on: June 07, 2020, 04:46:52 PM »
Hi Jean,

Sorry, it all works perfectly fine now after reading as much documentation you made as I could.

Thanks for your help.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon 2 - Can't Join Room
« Reply #7 on: June 10, 2020, 01:28:50 AM »
Hi,

 Great :)

Bye,

 Jean