Quantcast
Channel: Photon Unity Networking (PUN) — Photon Engine
Viewing all articles
Browse latest Browse all 8947

Is it possible to get AvailableRegions without joining Lobby?

$
0
0
Hi,

We want to control AvailableRegions from our server. we are fetching region codes from our server and then using PUN code to ping regions. I am able to do that using below code


PhotonNetwork.PhotonServerSettings.HostType = ServerSettings.HostingOption.BestRegion;
PhotonNetwork.PhotonServerSettings.EnabledRegions = MyServer.AvailableRegionsFlag;

if(null == PhotonNetwork.networkingPeer.AvailableRegions)
PhotonNetwork.networkingPeer.ConnectToNameServer();
else
StartCoroutine(PhotonHandler.SP.PingAvailableRegionsCoroutine(false));

PhotonNetwork.Disconnect();


The only problem is that we can't get PhotonNetwork.networkingPeer.AvailableRegions without connecting to Name server which then connects to best region automatically. Is there a way to avoid connecting to best after calling ConnectToNameServer or directly get AvailableRegions.

thanks

Viewing all articles
Browse latest Browse all 8947

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>