playMaker

Author Topic: Photon "Not Authorized" Error, can't join existing rooms[SOLVED]  (Read 7277 times)

MABManZ

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 125
    • MABManZ.com
Got started trying to mess with Photon today, and have been able to connect to the server and create rooms, however, players cannot join existing rooms so I can't actually get 2 players in the same room! If I force the same room name, it rejects the connection and somehow builds another room with identical name.

I get this error in console (and in red text if you play the .exe):

JoinRandom failed: OperationResponse 225: ReturnCode: -3 (Not authorized). Parameters: {}.
UnityEngine.Debug:LogError(Object)
PhotonHandler:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:158)
NetworkingPeer:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:746)
NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:964)
ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[])
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()



I did some digging around and found something noting that players can't join existing rooms if authorize doesn't go through. My AppID works fine in the Playmaker DemoWorker sample, I'm kinda stumped at the moment.
« Last Edit: August 03, 2013, 02:05:36 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon "Not Authorized" Error, can't join existing rooms
« Reply #1 on: August 02, 2013, 03:51:46 AM »
Hi,

 If you can connect and get a list of rooms, then it's not your App id.

In your case, you seem to be using "Join Random room", so it's unlikely the way to go if you want to have two players end up on the very same room unless the randomisation is part of the deal in your implementation.

Does your room allow for more than 1 player? you set this when you create a room ( Max number of players).

Bye,

 Jean

MABManZ

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 125
    • MABManZ.com
Re: Photon "Not Authorized" Error, can't join existing rooms
« Reply #2 on: August 02, 2013, 04:08:38 AM »
I used JoinRandom room to see if the player would join the only existing room, after you have created one.

Max players is set to 4

Here is the error I get when I force to join "TestRoom1":


createGame failed, client stays on masterserver: OperationResponse 227: ReturnCode: 32766 (A game with the specified id already exist.). Parameters: {}.
UnityEngine.Debug:LogError(Object)
PhotonHandler:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:158)
NetworkingPeer:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:746)
NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:896)
ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[])
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:65)



It then proceeds to connect to a "TestRoom1", presumably on the master server but is not the same room as the others.


edit: I have it setup to create a new room if cannot connect to existing room. If I remove this option, it will never connect to the existing room even if give it a name and specify it.
« Last Edit: August 02, 2013, 04:14:26 AM by MABManZ »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon "Not Authorized" Error, can't join existing rooms
« Reply #3 on: August 02, 2013, 09:15:28 AM »
Hi,

 your issue is very much in the logic implementation. Your error is clear: the room you are trying to create exists already. So maybe in your fsm, you think you go one route and actually you go another route.

do you have this problem in editor? for example run your game in the published version, but run the second player in editor so you can debug properly.

bye,

 Jean

MABManZ

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 125
    • MABManZ.com
Re: Photon "Not Authorized" Error, can't join existing rooms
« Reply #4 on: August 02, 2013, 03:51:36 PM »
Result is the same in the editor or in published build. I'm going to start again from scratch and try to set up a room list method to determine rooms to join and see if the problem continues, thanks!

MABManZ

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 125
    • MABManZ.com
Re: Photon "Not Authorized" Error, can't join existing rooms
« Reply #5 on: August 02, 2013, 08:45:37 PM »
Figured it out, the problem I was not properly using the global events from the Playmaker Photon Proxy to send resulting actions (was relying on wait times and retrying until it worked). It appears to be working now!