Can not connect to China Mainland Region after unlocking the appID

I am in China Mainland, and yesterday I sent you an email to request access to the Chinese Mainland region for my Photon app. I did receive the email said my appID has unlocked for China mainland server(s).

Today I try to connect to the 'cn' region and I found something strange:

1. #if CHINA did not work. If I write My code as
#if CHINA
    public string NameServerHost = "ns.photonengine.cn";
#else
    public string NameServerHost = "ns.exitgames.com";
#endif
, it will always use "ns.exitgames.com" because I can only connect to 'asia' or 'jp' region by ConnectUsingSettings().
So I just wrote:
public string NameServerHost = "ns.photonengine.cn"
BTW, #if CHINA also did not work for:
#if CHINA
	PhotonNetwork.ConnectToRegion("cn");
#else
	PhotonNetwork.ConnectUsingSettings();
#endif
2. After I remove all the #if CHINA things, I just use "ns.exitgames.com" and ConnectToRegion("cn"), in that case I got:
OperationResponse 230: ReturnCode: 32767 (Invalid application id). Parameters: {} Server: NameServer Address: ns.photonengine.cn:5058
UnityEngine.Debug:LogError(Object)
Photon.Realtime.LoadBalancingClient:DebugReturn(DebugLevel, String) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:2085)
Photon.Realtime.LoadBalancingClient:OnOperationResponse(OperationResponse) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:2159)
ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(StreamBuffer) (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/PeerBase.cs:620)
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands() (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/EnetPeer.cs:552)
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands() (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/PhotonPeer.cs:1548)
Photon.Pun.PhotonHandler:Dispatch() (at Assets/Photon/PhotonUnityNetworking/Code/PhotonHandler.cs:205)
Photon.Pun.PhotonHandler:FixedUpdate() (at Assets/Photon/PhotonUnityNetworking/Code/PhotonHandler.cs:139)

Does that mean my appID was rejected by the mainland server? But I think I have unlocked it through email.

Comments

  • When I use "ns.photonengine.cn" and ConnectUsingSettings(), it connected to the 'rue' server, but I want to connect to the server in Shanghai whose region code is 'cn'.
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited November 2019
    Hi @Instein98,

    Thank you for choosing Photon!

    Set a "Fixed Region" to "cn" in PhotonServerSettings under AppSettings.
    Here is a snippet for how to connect to china:
    void ConnectToChina()
            {
                PhotonNetwork.PhotonServerSettings.AppSettings.FixedRegion = "cn";
                PhotonNetwork.PhotonServerSettings.AppSettings.UseNameServer = true;
                PhotonNetwork.PhotonServerSettings.AppSettings.AppIdRealtime = "ChinaPUNAppId"; // TODO: replace with your own AppId
                PhotonNetwork.PhotonServerSettings.AppSettings.Server = "ns.photonengine.cn";
                PhotonNetwork.ConnectUsingSettings();
            }
    We will update the documentation accordingly.