PUN2 - PhotonNetwork.ConnectToRegion("eu"); doesn't work...

Options
If I use

PhotonNetwork.ConnectUsingSettings();

I get a connection to EU server, and all seems to work just fine, but when I use

PhotonNetwork.ConnectToRegion("eu");

I get the following error message:

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:1848)
Photon.Realtime.LoadBalancingClient:OnOperationResponse(OperationResponse) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:1922)
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:545)
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)

...

I'm using Unity 2018.3.10f1 and PUN 2.9 (Photon lib 4.1.2.10)...

Comments

  • vHelin
    Options
    My app ID is set correctly in PhotonNetwork.PhotonServerSettings.AppSettings.AppIdRealtime and it works just fine for PhotonNetwork.ConnectUsingSettings();

    Do I have to put app ID into some other place as well?
  • vHelin
    Options
    I'm using the 20CCU FREE plan at the moment, just started using PUN and building my game. Could that be the reason? Do I need to upgrade to say 100CCU plan to make PhotonNetwork.ConnectToRegion("eu");
    to work?
  • vHelin
    Options
    I think I found a workaround for this: When I want to use automatic/best server I'll call

    PhotonNetwork.PhotonServerSettings.AppSettings.FixedRegion = "";
    PhotonNetwork.ConnectUsingSettings();

    ... and when I want to connect to US server I'll call

    PhotonNetwork.PhotonServerSettings.AppSettings.FixedRegion = "us";
    PhotonNetwork.ConnectUsingSettings();

    This seems to work instead of calling PhotonNetwork.ConnectToRegion("us");
  • Tobias
    Options
    PhotonNetwork.ConnectToRegion("eu") is not the same as ConnectUsingSettings(). When you use it, no settings are applied!
    So you have to set the appid and anything else yourself.

    Setting the PhotonServerSettings FixedRegion before calling ConnectUsingSettings() is a valid workflow.