New to Pun, quick question

Options
I've just converted my project after getting Pun because of Nat punch through issues with unity and all errors has been sorted out. When I try to create a room I get the following.

CreateRoom failed. Client is not on Master Server or not yet ready to call operations. Wait for callback: OnJoinedLobby or OnConnectedToMaster

I've figured that I haven't connected correctly but despite searching I'm having trouble to figure out how.

It seems to me that I'm not yet connected to the master server so I guess I should call PhotonNetwork.ConnectToMaster() but I can't find the address and port to use. The intro just seems to jump directly to CreateRoom. Help is appreciated. :)

Comments

  • vadim
    Options
    Use PhotonNetwork.ConnectUsingSettings(gameVersion) to connect to Photon as configured in the editor.
    The method connects to default name server which routes to proper master server.
    You can find connection workflow implementation details in PUN demos.
  • I will check through the demos again, moved the folder outside the project because it gave me a bunch of errors, the thing is I do use ConnectUsingsSettings but it posts a warning Debug.LogWarning("Connect() only works when disconnected and then returns.

    So I took my project to another computer on a completely different network and this time I didn't get the warning and it seems to work. A little weird to me as I've been having trouble on this network before. Anyway this won't impede what'm doing too much at the moment but I still wish to figure out why it doesn't work.
  • vadim
    Options
    What errors do you have? Better fix them w/o moving any folders. What is that folder?
    What version of PUN do you use? Do demos work for you (imported in just created Unity project)?
  • Missing symbol in IELdemo.cs and Connect1A.cs and Connect1C.cs. Missing parantheses here, after fixing them I got PhotonPlayer[] doesn't contain definition for count in GuiFriendsInRoom.cs . After changing a few of them to .Length instead I got bored and just removed Demos as more and more errors just kept popping up. Same thing happened on an empty project after I ran converter wizard. Didn't happen on the other computer.
  • vadim
    Options
    Which Unity version is installed on the computer which fails?
    I can suggest only complete removal and installing latest Unity version on that computer.
  • Tobias
    Options
    This sounds like psilobe is using the Photon Networking Guide or has trouble with the free parts of the guide which are part of PUN.
    I don't know if the Guide it up to date. It includes PUN, so don't re-import a newer version of PUN into the Guide.

    When you import PUN Free (best option for your project), you could skip the "Demos" folder. This gives you just the parts that are needed in your project to use PUN.
    You can import PUN into a new, empty project with the Demos to work on those only. They should work out of the box then.