Hello guys i want to select region like america ,europe and asia part server If you know please send me example project :S i dont know i cant do
Help pleaseee :SS
You can set this in the Editor before you compile. In Menu: Window > Photon Unity Networking. In the Wizard: “Setup” and you can pick a region. Don’t forget to save.
i know but i saw a game i want this how can i make ?
Help me guyss :S please
Source code please :S
sezbladex:
Creating the UI is up to you.
Per region, Photon’s Master Server’s have a different address: Fusion 2 Introduction | Photon Engine
So once the user selected a region, you can call PhotonNetworking.ConnectToMaster(masterServerAddress, 5055, appId, gameVersion);
It works like ConnectUsingSettings(gameVersion) but connects to a specific masterServerAddress.
using UnityEngine;
using System.Collections;
using Photon.Pun;
using Photon.Realtime;
using UnityEngine.UI;
public class EscogerHost : MonoBehaviour
{
[Header(“Config Host”)]
public ServerSettings sSs;
public Text textoHost;
public Text contadorPlayers;
// Use this for initialization
void Start()
{
textoHost.text = PlayerPrefs.GetString(“ElHostt”);
}
void Update()
{
}
public void UseCloud(string code)
{
contadorPlayers.text = PhotonNetwork.CountOfPlayers.ToString();
PlayerPrefs.SetString(“ElHostt”, textoHost.text);
sSs.AppSettings.FixedRegion = code;
textoHost.text = code;
}
}
Hello,
one user is based in USA and can connect to the app, the other based in Europe can connect to the app also.
The Europe user creates the lobby, but the US user cannot see the lobby in the list. Any idea?
Clients must connect to the same region to find one another.
Thanks, but the region was not specified in our app, so I suppose that, according to the documentation, Photon chooses the best one for each user. And in this case, two different regions US & Europe. Do you confirm ?
Yes, this can happen. Ping times can vary anytime and it happens that two clients in the same location may select different regions. Maybe one didn’t get a reply for pings, etc.
If this happened more than once, up the “Network Logging” level in the PhotonServerSettings, run until the clients have the issue and send logs (complete ones for the start, not a screenshot) from both clients. The log I would look into is a multi-line log showing all ping times.
We fixed it by providing a list of the available regions: effectively, even we’re based in Europe, and we choose “us” as a region, we can login in the same lobby than a “us” user. Thanks.
There is a “Region Whitelist” in the App Dashboard, which you can use to limit the available regions for clients.
It’s best to limit the regions this way, because it tells is you only want these regions and you keep the option to add more regions if needed (the clients will notice a changed region list and re-ping the regions of a changed list).
No matter that, great you found a working solution.
Thanks for this advice, we’ll do it!