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.
With region I tried this but now I got on join room failed "Game does not exist".
What is the correct way to do this? Can I use like this?
Thanks in advance!
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!
0
Comments
-
there is a setting in PhotonServerSettings called "Dev Region", this could be set and the region will be fixed, is this what you need?0
-
@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.0 -
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.0