How to let my player to connect to a region manually
Answers
-
Here's a list of regions you can connect to: https://doc.photonengine.com/en-us/pun/current/reference/regions. Notice the token's for each region, those are what you use to connect, as seen in the example below.
I imagine you'll have a selector of sorts that allows players to choose between the different available regions. Here's how you connect to South America:
PhotonNetwork.ConnectToRegion(CloudRegionCode.sa,yourGameVersionInteger);
Here's how you connect to Asia:
PhotonNetwork.ConnectToRegion(CloudRegionCode.asia,yourGameVersionInteger);
I'm not sure if the following step is needed, but I had to change my PhotonServerSettings Hosting value to "Best Region" and the "Enabled Regions" value set to "Everything" to get it working how I wanted.1 -
I've not tested your suggestion yet but what i think if i will enable "Best Region" in PhotonServerSettings that it will compare pings with other regions and will connect my user to the region with "BEST PING" no matter whatever i chose in PhotonNetwork.ConnectToRegion ... But right now i m not with my PC, but as soon as i'll reachout to my PC, i will test this out and will get back to you with result ... Hoping For BestWyvern_IX said:Here's a list of regions you can connect to: https://doc.photonengine.com/en-us/pun/current/reference/regions. Notice the token's for each region, those are what you use to connect, as seen in the example below.
I imagine you'll have a selector of sorts that allows players to choose between the different available regions. Here's how you connect to South America:
PhotonNetwork.ConnectToRegion(CloudRegionCode.sa,yourGameVersionInteger);
Here's how you connect to Asia:
PhotonNetwork.ConnectToRegion(CloudRegionCode.asia,yourGameVersionInteger);
I'm not sure if the following step is needed, but I had to change my PhotonServerSettings Hosting value to "Best Region" and the "Enabled Regions" value set to "Everything" to get it working how I wanted.0 -
From my knowledge, you'd only compare pings and choose the best ping with the "Best Region" setting enabled if you use PhotonNetwork.ConnectUsingSettings to connect as seen in the documentation here: http://doc-api.exitgames.com/en/pun/current/class_photon_network.html#a0fdb79bcce45801ec81fbe56ffb939ec
Using ConnectToRegion will bypass your PhotonServerSettings and connect to whatever region you specify. Stated here: http://doc-api.exitgames.com/en/pun/current/class_photon_network.html#a84b7be74d130b19eeeb1d7b4e8193ad40 -
Fhew ... Now that gave me a ray of hope ... Okay so now i know that i can connect to any region of my choice, and as i m doing this manually, what to do after it, i mean do i have to connect to a Master server too or can i just make my normal calls like creating rooms, joining them and other normal networking stuff0
-
Connecting in this way already connects you to a master server. Now that the player is connected, you can use the normal calls to your liking.0
-
Just what i needed, for some reason i was always having 350-400ms on my game, and now that i manually connect to southamerica i get 105... Thanks!Wyvern_IX said:Here's a list of regions you can connect to: https://doc.photonengine.com/en-us/pun/current/reference/regions. Notice the token's for each region, those are what you use to connect, as seen in the example below.
I imagine you'll have a selector of sorts that allows players to choose between the different available regions. Here's how you connect to South America:
PhotonNetwork.ConnectToRegion(CloudRegionCode.sa,yourGameVersionInteger);
Here's how you connect to Asia:
PhotonNetwork.ConnectToRegion(CloudRegionCode.asia,yourGameVersionInteger);
I'm not sure if the following step is needed, but I had to change my PhotonServerSettings Hosting value to "Best Region" and the "Enabled Regions" value set to "Everything" to get it working how I wanted.0