public void RegisterUser() { if (newPassword.text == newRepeatPassword.text) { if (newUsername.text.Length < 8) { dataInserter.CreateUser(newName.text, newUsername.text, newPassword.text); ResetRegisterFields(); } else { Debug.Log("Username max length is 8"); } } else { Debug.Log("Passwords don't match!"); } }
private void signup() { // Validate inputs Regex regex = new Regex(@"^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$"); Match match = regex.Match(m_EmailInputField.text); if (m_UsernameInputField.text.Length <= 0 || m_PasswordInputField.text.Length <= 0 || m_EmailInputField.text.Length <= 0) { m_ErrorMessage.text = "please fill out all fields"; return; } else if (!match.Success) { m_ErrorMessage.text = "please provide a valid email"; return; } else { m_ErrorMessage.text = ""; } m_LoadingImage.gameObject.SetActive(true); // Create new user DataInserter dataInserter = GameMaster.Instance.m_DatabaseManager.m_DataInserter; if (dataInserter != null) { dataInserter.StartCoroutine(dataInserter.CreateUser( m_UsernameInputField.text, m_PasswordInputField.text, m_EmailInputField.text, signupSuccess, signupFailed, signupEmailAlreadyExists )); } else { Debug.LogError("DataInserter script can't be found by SignUpPanel"); } }
void LateUpdate() { StartCoroutine(DataInserter.CreateUser(DataInserter.url, score)); }