Login() public static method

public static Login ( MonoBehaviour owner, IPEndPoint endPoint, string id, string password, Action progressReport ) : Task
owner MonoBehaviour
endPoint IPEndPoint
id string
password string
progressReport Action
return Task
Exemplo n.º 1
0
        internal void NewLogin()
        {
            Userinfo.EmailAddress = this.EmailBox.Text;
            Userinfo.Password = this.PasswordBox.Text;

            var newLoginAttempt = new LoginProcessor();

            newLoginAttempt.Login(Userinfo.EmailAddress, Userinfo.Password);
        }
Exemplo n.º 2
0
    private IEnumerator ProcessLoginUser(string server, string id, string password)
    {
        G.Logger.Info("ProcessLoginUser");

        var endPoint = LoginProcessor.GetEndPointAddress(server);
        var task     = LoginProcessor.Login(this, endPoint, id, password, null);

        yield return(task.WaitHandle);
    }
Exemplo n.º 3
0
        public async Task <IActionResult> Login(UserCred userCred)
        {
            var result = await _login.Login(userCred);

            if (result == null)
            {
                return(RedirectToAction("Login", "Login", new { code = 1 }));
            }

            //Debug.WriteLine("RESULT : "+result);
            var agent = _agentProcessor.LoadAgent(userCred.Username);

            if (agent.Result.NeedsNewPassword)
            {
                return(RedirectToAction("ResetPassword", "Agent", agent.Result));
            }
            return(RedirectToAction("Index", "Home"));
        }
Exemplo n.º 4
0
    private IEnumerator ProcessLoginUser(string server, string id, string password)
    {
        G.Logger.Info("ProcessLoginUser");

        IPEndPoint endPoint;

        try
        {
            endPoint = LoginProcessor.GetEndPointAddress(server);
        }
        catch (Exception e)
        {
            UiMessageBox.Show("Server EndPoint Error: " + e);
            yield break;
        }

        SwitchPanel(LoginPanel, LoadingPanel);

        var task = LoginProcessor.Login(this, endPoint, id, password, p => LoadingText.text = p + "...");

        yield return(task.WaitHandle);

        if (task.Status == TaskStatus.RanToCompletion)
        {
            SwitchPanel(LoadingPanel, MainPanel);

            PlayerPrefs.SetString("LoginServer", server);
            PlayerPrefs.SetString("LoginId", id);
            PlayerPrefs.SetString("LoginPassword", password);
        }
        else
        {
            UiMessageBox.Show(task.Exception.Message);
            SwitchPanel(LoadingPanel, LoginPanel);

            PlayerPrefs.DeleteKey("LoginServer");
            PlayerPrefs.DeleteKey("LoginId");
            PlayerPrefs.DeleteKey("LoginPassword");
        }
    }