Connecting to Photon and getting a list of rooms

Let's connect to Photon Cloud. There are three main ways of doing this:

  • You can call PhotonNetwork.ConnectUsingSettings which will connect via the settings defined in the editor panel
  • You can call PhotonNetwork.ConnectToBestCloudServer which will ping each available server cluster and connect to the best one
  • You can call PhotonNetwork.Connect, passing the server address of the appropriate Photon region and the port
  • You can also use ConnectUsingSettings which will connect to the region we defined in the editor panel. We'll be using this for the rest of the chapter

Note

If you wish to use Connect manually, as of the time of writing, the addresses for each region are:

US (East Coast): app-us.exitgamescloud.com ...

Get Unity Multiplayer Games now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.