예제 #1
0
    private void LoginViaLoginPassHandler(BaseEvent message)
    {
        LoginEvents.LoginViaLoginPassEvent loginData = message as LoginEvents.LoginViaLoginPassEvent;

        PlayFabClientAPI.LoginWithEmailAddress(new LoginWithEmailAddressRequest()
        {
            Email    = loginData.login,
            Password = loginData.pass,
        }, result => {
            // success
            MessagingSystem.Instance.DispatchEvent(new LoginEvents.LoginSignInDoneEvent());
        }, error => {
            // 'error' object is our point of access to error data
        });
    }
예제 #2
0
    private void LoginViaLoginPassHandler(BaseEvent message)
    {
        LoginEvents.LoginViaLoginPassEvent loginData = message as LoginEvents.LoginViaLoginPassEvent;
        Log("Check email...");
        if (string.IsNullOrEmpty(loginData.login.Trim()) || string.IsNullOrEmpty(loginData.pass.Trim()))
        {
            Log("Email or Pwd is null");
            MessagingSystem.Instance.DispatchEvent(new LoginEvents.LoginErrorEvent(LoginErrorCodes.EMAIL_PASS_IS_NULL));

            return;
        }

        MessagingSystem.Instance.DispatchEvent(new LoginEvents.LoginLoadingEvent(true));

        //Signin
        SigninAsync(loginData.login, loginData.pass);
    }