PhotonNetwork.ConnectToRegion not working
Options
I have a project in Unity, and I'd like to make sure even distant users can be in the same room so I wanted to limit to a single region ("us"). I am starting from code that is very similar to the sample.
So, based on what I saw in the documentation [1], I replaced
PhotonNetwork.ConnectUsingSettings();
with
PhotonNetwork.ConnectToRegion("us")
I was expecting my application would work the same, just always connect to the US region. Instead, it stopped working. What happens when I call ConnectToRegion is I see an error in the log ([2], below), and then I get the disconnect callback.
I have been able to work around this issue by restricting the whitelist to just the "us" region in the Photon web dashboard, but in the future I'd like to allow players to select their region.
How do I allow players to select their region?
Thank you in advance.
[1] https://doc.photonengine.com/en-us/pun/current/connection-and-authentication/regions
[2]
OperationResponse 230: ReturnCode: 32767 (Invalid application id). Parameters: {} Server: NameServer Address: ns.exitgames.com:5058
UnityEngine.Debug:LogError(Object)
Photon.Realtime.LoadBalancingClient:DebugReturn(DebugLevel, String) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:2010)
Photon.Realtime.LoadBalancingClient:OnOperationResponse(OperationResponse) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:2084)
ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(StreamBuffer) (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/PeerBase.cs:616)
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands() (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/EnetPeer.cs:550)
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands() (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/PhotonPeer.cs:1473)
Photon.Pun.PhotonHandler:FixedUpdate() (at Assets/Photon/PhotonUnityNetworking/Code/PhotonHandler.cs:116)
So, based on what I saw in the documentation [1], I replaced
PhotonNetwork.ConnectUsingSettings();
with
PhotonNetwork.ConnectToRegion("us")
I was expecting my application would work the same, just always connect to the US region. Instead, it stopped working. What happens when I call ConnectToRegion is I see an error in the log ([2], below), and then I get the disconnect callback.
I have been able to work around this issue by restricting the whitelist to just the "us" region in the Photon web dashboard, but in the future I'd like to allow players to select their region.
How do I allow players to select their region?
Thank you in advance.
[1] https://doc.photonengine.com/en-us/pun/current/connection-and-authentication/regions
[2]
OperationResponse 230: ReturnCode: 32767 (Invalid application id). Parameters: {} Server: NameServer Address: ns.exitgames.com:5058
UnityEngine.Debug:LogError(Object)
Photon.Realtime.LoadBalancingClient:DebugReturn(DebugLevel, String) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:2010)
Photon.Realtime.LoadBalancingClient:OnOperationResponse(OperationResponse) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:2084)
ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(StreamBuffer) (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/PeerBase.cs:616)
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands() (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/EnetPeer.cs:550)
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands() (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/PhotonPeer.cs:1473)
Photon.Pun.PhotonHandler:FixedUpdate() (at Assets/Photon/PhotonUnityNetworking/Code/PhotonHandler.cs:116)
0
Comments
-
Hi @purple_goo,
Thank you for choosing Photon!
This was already asked before, try searching the forum, example discussions:
https://forum.photonengine.com/discussion/comment/42730/#Comment_42730
https://forum.photonengine.com/discussion/comment/44858/#Comment_44858
https://forum.photonengine.com/discussion/comment/44829/#Comment_448291 -
Thank you so much, @JohnTube! That did the trick. I had searched but clearly not well enough.0