Exemplo n.º 1
0
 void Start()
 {
     if (instance == null)
     {
         instance = this;
     }       
 }
 void OnReceivedSPLoginResponse(SPLogin.SPLogin_Responce response)
 {
     if (response.code == 0)
         IntegrationTest.Pass(gameObject);
     else
         IntegrationTest.Fail(gameObject);
 }
Exemplo n.º 3
0
 void Start()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Exemplo n.º 4
0
    public void ResendVerificationEmail()
    {
        string ErrorMsg = "";

        if (!loginUserEmailValidator.IsValidCheck())
        {
            ErrorMsg = "Validation resend requires valid E-mail";
        }
        loginErrorLabel.text = ErrorMsg;
        if (string.IsNullOrEmpty(ErrorMsg))
        {
            SwitchToConfirmation();
            confirmationButton.onClick.Clear();
            confirmationButton.onClick.Add(new EventDelegate(this, "SwitchToLogin"));
            confirmationButton.GetComponentInChildren <UILabel>().text = "Back";
            SPLogin.ResendVerificationEmail(loginUserEmail.value);
        }
    }
Exemplo n.º 5
0
    public void Register()
    {
        string ErrorMsg = "";

        if (!registerUserNameValidator.IsValidCheck())
        {
            if (!string.IsNullOrEmpty(ErrorMsg))
            {
                ErrorMsg += "\n";
            }
            ErrorMsg += "-Invalid User Name";
        }
        if (!registerUserEmailValidator.IsValidCheck())
        {
            if (!string.IsNullOrEmpty(ErrorMsg))
            {
                ErrorMsg += "\n";
            }
            ErrorMsg += "-Invalid Email";
        }

        if (!registerUserPasswordValidator.IsValidCheck() || !registerUserPasswordConfirmValidator.IsValidCheck())
        {
            if (!string.IsNullOrEmpty(ErrorMsg))
            {
                ErrorMsg += "\n";
            }
            ErrorMsg += "-Invalid Password";
        }
        registerErrorLabel.text = ErrorMsg;
        if (string.IsNullOrEmpty(ErrorMsg))
        {
            SwitchToConfirmation();
            SPLogin.RegisterUser(registerUserEmail.value, registerUserPassword.value, registerUserName.value);
        }
    }
Exemplo n.º 6
0
    public void Login()
    {
        string ErrorMsg = "";

        if (!loginUserEmailValidator.IsValidCheck())
        {
            ErrorMsg = "-Invalid Email";
        }

        if (!loginUserPasswordValidator.IsValidCheck())
        {
            if (!string.IsNullOrEmpty(ErrorMsg))
            {
                ErrorMsg += "\n";
            }
            ErrorMsg += "-Invalid Password";
        }
        loginErrorLabel.text = ErrorMsg;
        if (string.IsNullOrEmpty(ErrorMsg))
        {
            PlayerPrefs.SetString("SocialPlay_Login_UserEmail", loginUserEmail.value);
            SPLogin.Login(loginUserEmail.value.ToLower(), loginUserPassword.value);
        }
    }
Exemplo n.º 7
0
 void OnReceivedLoginResponse(SPLogin.SPLogin_Responce response)
 {
     Debug.Log("Login Response: " + response.code + " UserInfo: " + response.userInfo.name);
 }
Exemplo n.º 8
0
    void RecivedUserGuid(SPLogin.UserInfo obj)
    {
        if (autoLoginToggle != null && autoLoginToggle.value == true)
        {
            PlayerPrefs.SetString("SocialPlay_UserGuid", obj.ID.ToString());
            PlayerPrefs.SetString("SocialPlay_UserName", obj.name);
            PlayerPrefs.SetString("SocialPlay_UserEmail", obj.email);
        }

        resendVerificationTextObject.SetActive(false);
        loginErrorLabel.text = "User logged in";
        this.gameObject.SetActive(false);
        ContainerKeybinding.EnableKeybinding("Login");
    }
Exemplo n.º 9
0
    void RegisterMessageResponce(SPLogin.SPLogin_Responce responce)
    {
        resendVerificationTextObject.SetActive(false);

        if (responce.code == 0)
        {
            confirmationStatus.text = "Verification Email has been sent to your Email";
            confirmationButton.onClick.Clear();
            confirmationButton.onClick.Add(new EventDelegate(this, "SwitchToLogin"));
            confirmationButton.GetComponentInChildren<UILabel>().text = "To Login";
        }
        else
        {
            confirmationStatus.text = responce.message;
            confirmationButton.onClick.Clear();
            confirmationButton.onClick.Add(new EventDelegate(this, "SwitchToRegister"));
            confirmationButton.GetComponentInChildren<UILabel>().text = "Back";
        }
    }
Exemplo n.º 10
0
    void RecivedLoginResponce(SPLogin.SPLogin_Responce recivedMessage)
    {
        if (recivedMessage.code == 3)
        {
            resendVerificationTextObject.SetActive(true);
            return;
        }

        resendVerificationTextObject.SetActive(false);
        loginErrorLabel.text = recivedMessage.message;
    }
Exemplo n.º 11
0
    void ForgotPasswordResponce(SPLogin.SPLogin_Responce responce)
    {
        //resendVerificationTextObject.SetActive(false);
        //loginErrorLabel.text = responce.message;

        confirmationStatus.text = responce.message;

    }
Exemplo n.º 12
0
 void ResentVerificationResponce(SPLogin.SPLogin_Responce responce)
 {
     resendVerificationTextObject.SetActive(false);
     loginErrorLabel.text = responce.message;
 }