// Token: 0x06000D02 RID: 3330 RVA: 0x00059AF8 File Offset: 0x00057CF8
 private void Login(string emailAddress, string password)
 {
     CmunePrefs.WriteKey <bool>(CmunePrefs.Key.Player_AutoLogin, this._rememberPassword);
     if (this._rememberPassword)
     {
         CmunePrefs.WriteKey <string>(CmunePrefs.Key.Player_Password, password);
         CmunePrefs.WriteKey <string>(CmunePrefs.Key.Player_Email, emailAddress);
     }
     this._errorAlpha = 1f;
     if (string.IsNullOrEmpty(emailAddress))
     {
         LoginPanelGUI.ErrorMessage = LocalizedStrings.EnterYourEmailAddress;
     }
     else if (string.IsNullOrEmpty(password))
     {
         LoginPanelGUI.ErrorMessage = LocalizedStrings.EnterYourPassword;
     }
     else if (!ValidationUtilities.IsValidEmailAddress(emailAddress))
     {
         LoginPanelGUI.ErrorMessage = LocalizedStrings.EmailAddressIsInvalid;
     }
     else if (!ValidationUtilities.IsValidPassword(password))
     {
         LoginPanelGUI.ErrorMessage = LocalizedStrings.PasswordIsInvalid;
     }
     else
     {
         this.Hide();
         UnityRuntime.StartRoutine(Singleton <AuthenticationManager> .Instance.StartLoginMemberEmail(emailAddress, password));
     }
 }
    // Token: 0x06000D66 RID: 3430 RVA: 0x0005D9FC File Offset: 0x0005BBFC
    private void OnGUI()
    {
        if (Mathf.Abs(this._keyboardOffset - this._targetKeyboardOffset) > 2f)
        {
            this._keyboardOffset = Mathf.Lerp(this._keyboardOffset, this._targetKeyboardOffset, Time.deltaTime * 4f);
        }
        else
        {
            this._keyboardOffset = this._targetKeyboardOffset;
        }
        Rect position = new Rect((float)(Screen.width - 500) * 0.5f, ((float)Screen.height - this._height) * 0.5f - this._keyboardOffset, 500f, this._height);

        GUI.BeginGroup(position, GUIContent.none, BlueStonez.window);
        GUI.Label(new Rect(0f, 0f, position.width, 56f), LocalizedStrings.Welcome, BlueStonez.tab_strip);
        Rect position2 = new Rect(20f, 55f, position.width - 40f, position.height - 78f);

        GUI.Label(position2, GUIContent.none, BlueStonez.window_standard_grey38);
        GUI.BeginGroup(position2);
        GUI.Label(new Rect(0f, 0f, position2.width, 60f), LocalizedStrings.PleaseProvideValidEmailPasswordMsg, BlueStonez.label_interparkbold_18pt);
        GUI.Label(new Rect(0f, 76f, 170f, 11f), LocalizedStrings.Email, BlueStonez.label_interparkbold_11pt_right);
        GUI.Label(new Rect(0f, 110f, 170f, 11f), LocalizedStrings.Password, BlueStonez.label_interparkbold_11pt_right);
        GUI.Label(new Rect(0f, 147f, 170f, 11f), LocalizedStrings.VerifyPassword, BlueStonez.label_interparkbold_11pt_right);
        GUI.enabled = this._enableGUI;
        GUI.SetNextControlName("@Email");
        this._emailAddress = GUI.TextField(new Rect(180f, 69f, 180f, 22f), this._emailAddress, BlueStonez.textField);
        if (string.IsNullOrEmpty(this._emailAddress) && GUI.GetNameOfFocusedControl() != "@Email")
        {
            GUI.color = new Color(1f, 1f, 1f, 0.3f);
            GUI.Label(new Rect(188f, 75f, 180f, 22f), LocalizedStrings.EnterYourEmailAddress, BlueStonez.label_interparkmed_11pt_left);
            GUI.color = Color.white;
        }
        GUI.SetNextControlName("@Password1");
        this._password1 = GUI.PasswordField(new Rect(180f, 104f, 180f, 22f), this._password1, '*', BlueStonez.textField);
        if (string.IsNullOrEmpty(this._password1) && GUI.GetNameOfFocusedControl() != "@Password1")
        {
            GUI.color = new Color(1f, 1f, 1f, 0.3f);
            GUI.Label(new Rect(188f, 110f, 172f, 18f), LocalizedStrings.EnterYourPassword, BlueStonez.label_interparkmed_11pt_left);
            GUI.color = Color.white;
        }
        GUI.SetNextControlName("@Password2");
        this._password2 = GUI.PasswordField(new Rect(180f, 140f, 180f, 22f), this._password2, '*', BlueStonez.textField);
        if (string.IsNullOrEmpty(this._password2) && GUI.GetNameOfFocusedControl() != "@Password2")
        {
            GUI.color = new Color(1f, 1f, 1f, 0.3f);
            GUI.Label(new Rect(188f, 146f, 180f, 22f), LocalizedStrings.RetypeYourPassword, BlueStonez.label_interparkmed_11pt_left);
            GUI.color = Color.white;
        }
        GUI.enabled      = true;
        GUI.contentColor = this._errorMessageColor;
        GUI.Label(new Rect(0f, 175f, position2.width, 40f), this._errorMessage, BlueStonez.label_interparkbold_11pt);
        GUI.contentColor = Color.white;
        GUI.EndGroup();
        GUI.Label(new Rect(100f, position.height - 42f - 22f, 300f, 16f), "By clicking OK you agree to the", BlueStonez.label_interparkbold_11pt);
        if (GUI.Button(new Rect(185f, position.height - 30f - 12f, 130f, 20f), "Terms of Service", BlueStonez.buttondark_small))
        {
            ApplicationDataManager.OpenUrl("Terms Of Service", "http://www.cmune.com/index.php/terms-of-service/");
            this.HideKeyboard();
        }
        GUI.Label(new Rect(207f, position.height - 15f - 22f, 90f, 20f), GUIContent.none, BlueStonez.horizontal_line_grey95);
        GUI.enabled = this._enableGUI;
        if (GUITools.Button(new Rect(position.width - 150f, position.height - 42f - 22f, 120f, 32f), new GUIContent(LocalizedStrings.OkCaps), BlueStonez.button_green))
        {
            this.HideKeyboard();
            if (!ValidationUtilities.IsValidEmailAddress(this._emailAddress))
            {
                this._targetHeight      = 340f;
                this._errorMessageColor = Color.red;
                this._errorMessage      = LocalizedStrings.EmailAddressIsInvalid;
            }
            else if (this._password1 != this._password2)
            {
                this._targetHeight      = 340f;
                this._errorMessageColor = Color.red;
                this._errorMessage      = LocalizedStrings.PasswordDoNotMatch;
            }
            else if (!ValidationUtilities.IsValidPassword(this._password1))
            {
                this._targetHeight      = 340f;
                this._errorMessageColor = Color.red;
                this._errorMessage      = LocalizedStrings.PasswordInvalidCharsMsg;
            }
            else
            {
                this._enableGUI         = false;
                this._targetHeight      = 340f;
                this._errorMessageColor = Color.grey;
                this._errorMessage      = LocalizedStrings.PleaseWait;
                AuthenticationWebServiceClient.CreateUser(this._emailAddress, this._password1, ApplicationDataManager.Channel, ApplicationDataManager.CurrentLocale.ToString(), SystemInfo.deviceUniqueIdentifier, delegate(MemberRegistrationResult result)
                {
                    if (result == MemberRegistrationResult.Ok)
                    {
                        this.Hide();
                        CmunePrefs.WriteKey <string>(CmunePrefs.Key.Player_Email, this._emailAddress);
                        CmunePrefs.WriteKey <string>(CmunePrefs.Key.Player_Password, this._password1);
                        UnityRuntime.StartRoutine(Singleton <AuthenticationManager> .Instance.StartLoginMemberEmail(this._emailAddress, this._password1));
                        this._targetHeight      = 300f;
                        this._errorMessage      = string.Empty;
                        this._emailAddress      = string.Empty;
                        this._password1         = string.Empty;
                        this._password2         = string.Empty;
                        this._errorMessageColor = Color.red;
                        this._enableGUI         = true;
                    }
                    else
                    {
                        this._enableGUI         = true;
                        this._targetHeight      = 340f;
                        this._errorMessageColor = Color.red;
                        this._errorMessages.TryGetValue(result, out this._errorMessage);
                    }
                }, delegate(Exception ex)
                {
                    this._enableGUI    = true;
                    this._targetHeight = 300f;
                    this._errorMessage = string.Empty;
                    this.ShowSignUpErrorPopup(LocalizedStrings.Error, "Sign Up was unsuccessful. There was an error communicating with the server.");
                });
            }
        }
        if (GUITools.Button(new Rect(30f, position.height - 42f - 22f, 120f, 32f), new GUIContent(LocalizedStrings.BackCaps), BlueStonez.button))
        {
            this.Hide();
            this.HideKeyboard();
            PanelManager.Instance.OpenPanel(PanelType.Login);
        }
        GUI.enabled = true;
        GUI.EndGroup();
    }