Exemple #1
0
        protected virtual void RegisterWithEmail(string email)
        {
            AccountService client = new AccountService();

            client.CustomToken   = CustomToken;
            client.CustomContext = CustomContext;

            List <ServiceTypes> types = new List <ServiceTypes>();

            types.Add(ServiceTypes.Pun);
            if (PhotonEditorUtils.HasChat)
            {
                types.Add(ServiceTypes.Chat);
            }
            if (PhotonEditorUtils.HasVoice)
            {
                types.Add(ServiceTypes.Voice);
            }

            if (client.RegisterByEmail(email, types, RegisterWithEmailSuccessCallback, RegisterWithEmailErrorCallback))
            {
                this.photonSetupState = PhotonSetupStates.EmailRegistrationPending;
                EditorUtility.DisplayProgressBar(CurrentLang.ConnectionTitle, CurrentLang.ConnectionInfo, 0.5f);
            }
            else
            {
                this.DisplayErrorMessage("Email registration request could not be sent. Retry again or check error logs and contact support.");
            }
        }
Exemple #2
0
        protected virtual void RegisterWithEmail(string email)
        {
            EditorUtility.DisplayProgressBar(CurrentLang.ConnectionTitle, CurrentLang.ConnectionInfo, 0.5f);

            string accountServiceType = string.Empty;

            if (PhotonEditorUtils.HasVoice)
            {
                accountServiceType = "voice";
            }


            AccountService client = new AccountService();

            client.RegisterByEmail(email, RegisterOrigin, accountServiceType, RegisterWithEmailCallback); // this is the synchronous variant using the static RegisterOrigin. "result" is in the client
        }
Exemple #3
0
        protected virtual void RegisterWithEmail(string email)
        {
            EditorUtility.DisplayProgressBar(CurrentLang.ConnectionTitle, CurrentLang.ConnectionInfo, 0.5f);

            string accountServiceType = string.Empty;

            if (PhotonEditorUtils.HasVoice)
            {
                accountServiceType = "voice";
            }


            AccountService client = new AccountService();

            client.RegisterByEmail(email, RegisterOrigin, accountServiceType); // this is the synchronous variant using the static RegisterOrigin. "result" is in the client

            EditorUtility.ClearProgressBar();
            if (client.ReturnCode == 0)
            {
                this.mailOrAppId = client.AppId;
                PhotonNetwork.PhotonServerSettings.UseCloud(this.mailOrAppId, null);
                if (PhotonEditorUtils.HasVoice)
                {
                    PhotonNetwork.PhotonServerSettings.AppSettings.AppIdVoice = client.AppId2;
                }
                PhotonEditor.SaveSettings();

                this.photonSetupState = PhotonSetupStates.GoEditPhotonServerSettings;
            }
            else
            {
                PhotonEditor.SaveSettings();

                Debug.LogWarning(client.Message + " ReturnCode: " + client.ReturnCode);
                if (client.Message.Contains("registered"))
                {
                    this.photonSetupState = PhotonSetupStates.EmailAlreadyRegistered;
                }
                else
                {
                    EditorUtility.DisplayDialog(CurrentLang.ErrorTextTitle, client.Message, CurrentLang.OkButton);
                    this.photonSetupState = PhotonSetupStates.RegisterForPhotonCloud;
                }
            }
        }
Exemple #4
0
        protected virtual void RegisterWithEmail(string email)
        {
            AccountService      client = new AccountService();
            List <ServiceTypes> types  = new List <ServiceTypes>();

            types.Add(ServiceTypes.Pun);
            if (PhotonEditorUtils.HasChat)
            {
                types.Add(ServiceTypes.Chat);
            }
            if (PhotonEditorUtils.HasVoice)
            {
                types.Add(ServiceTypes.Voice);
            }

            if (client.RegisterByEmail(email, types, RegisterWithEmailSuccessCallback, RegisterWithEmailErrorCallback))
            {
                EditorUtility.DisplayProgressBar(CurrentLang.ConnectionTitle, CurrentLang.ConnectionInfo, 0.5f);
            }
        }