How to connect specific region?

Options
Hi guys,
I'm sending room name and region code when somebody want to play with friends. If I try to connect photon using PhotonNetwork.ConnectUsingSettings() on friend side. Our friends connect correctly. But this method works well without regioning.
PhotonNetwork.GameVersion = "game-version";
PhotonNetwork.ConnectUsingSettings();

With region I tried this but now I got on join room failed "Game does not exist".
PhotonNetwork.NetworkingClient.AppId = "App-id";
PhotonNetwork.NetworkingClient.AppVersion = "game-version";

PhotonNetwork.NetworkingClient.ConnectToNameServer();

PhotonNetwork.NetworkingClient.ConnectToRegionMaster(regionCode);


What is the correct way to do this? Can I use like this?
PhotonNetwork.GameVersion = "game-version";
PhotonNetwork.ConnectUsingSettings();
PhotonNetwork.ConnectToRegion(regionCode);

Thanks in advance!

Comments

  • zine
    Options
    there is a setting in PhotonServerSettings called "Dev Region", this could be set and the region will be fixed, is this what you need?
  • L3sc
    Options
    @zine Thanks for your answer.
    Yeah you right but that option just working with development build. I want to make it dynamically for release. For example if you want to play with your friend you will send room name and region via playfab. Firstly our friend will be connect same region and after join room.
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited June 2020
    Options
    Hi @L3sc,

    Various ways to do this.

    one way (settings are ignored):
    PhotonNetwork.NetworkingClient.AppId = "App-id";
    PhotonNetwork.NetworkingClient.AppVersion = "game-version";
    PhotonNetwork.NetworkingClient.ConnectToRegionMaster(regionCode);
    

    another one (changes settings):
    PhotonNetwork.PhotonServerSettings.AppSettings.FixedRegion = regionCode;
    PhotonNetwork.NetworkingClient.ConnectUsingSettings();
    

    otherwise take a look here, not sure how or when PhotonNetwork.ConnectToRegion can be used.