How to switch Server Region in case Photon is down?
Options
Hello,
as probably everybody knows, EU was down yesterday for more than 2 hours -__-
How to change the Region in Photon in case this happens again?
Since I can't test this really I need to be sure that it's actually work.
Can someone post a Code Snippet?
as probably everybody knows, EU was down yesterday for more than 2 hours -__-
How to change the Region in Photon in case this happens again?
Since I can't test this really I need to be sure that it's actually work.
Can someone post a Code Snippet?
0
Comments
-
Hi @kk99,
One solution is to use "Dashboard Regions Filtering" feature.
Dynamically (on the fly) and explicitly choose which regions the client can connect to.
E.g. in case of failure of a region, remove it from the list and save.
Set "Hosting" option to "Best Region".
Always overwrite saved preferred region in player prefs with "none" before connecting.PhotonNetwork.OverrideBestCloudServer(CloudRegionCode.none); PhotonNetwork.ConnectUsingSettings(appVersion);
0 -
but how does BestRegion decide?
I want all users to connect to EU unless EU is down.
i dont want 40% users are playing EU, meanwhile other 20% playing US and 40% are playing somewhere else. . .
0 -
Regions Whitelist: "eu"
if there is an issue with "eu", just update app config from the dashboard and set list to next preferred region e.g. "us".0 -
hmm but that is a manual process and it's awful.
What do I do if I am sleeping lol or simply not available or not aware of an issue?
Do you offer an API that returns some values if Regions are down?
I am thinking to call this https://www.photonengine.com/en-US/status and parse the HTML for EU.
and then switch Regions in Unity if in case the parsin indicates EU is down.
if (euIsDown())
PhotonNetwork.ConnectToRegionMaster(regionCode, gameVersion).
any better idea?0 -
I'm afraid your solution is good in theory but can't be reliable as the status page does not give you exact current status but rather the daily average for last week until "yesterday".
So you can't avoid a manual intervention.0 -
so there is no API and basically no other Option to check if EU servers are down? . . .
Is there at least special Exception thrown if a Region is down and you try to connect, then I could display the user an option to switch the Region0 -
You might simply choose a different region, after e.g. 3 connection failures.
In the end, it only matters, if a client can connect or not (for whatever reason).
Relying on some other monitoring endpoint just extends the possible points of failure. What do you do, if the monitoring system fails to respond?0 -
That callback should be enough, you can always wrap connect calls using try catch block.0
-
alright. thanks for the suggestions. it's time to implement this plan B0