Ejemplo n.º 1
0
        public BaseResponse <BE.User> LogUser(string launchToken)
        {
            BaseRequest         req         = new BaseRequest();
            BaseResponse <User> returnValue = null;

            req.LaunchToken = launchToken;
            try
            {
                BaseResponse <BaseWalletResponseData> login = UserWalletFacade.ProcessLogin(req);
                if (login.Status.Equals(ResponseStatus.OK))
                {
                    BE.User user           = new User();
                    var     walletResponse = login.GetData();
                    user.LaunchToken  = launchToken;
                    user.SessionToken = walletResponse.SessionToken;
                    user.UID          = walletResponse.UserUID;
                    user.NickName     = walletResponse.NickName;
                    user.Balance      = walletResponse.Balance;

                    UserAccess ua = new UserAccess();


                    returnValue = new BaseResponse <User>(ua.LoginUser(user), ResponseStatus.OK);
                }
                else
                {
                    returnValue = new BaseResponse <User>(new User(), ResponseStatus.Fail, login.Message);
                }
                return(returnValue);
            }
            catch (Exception ex)
            {
                return(new BaseResponse <User>(new User(), ResponseStatus.Fail, string.Format("Error processing login - {0}", ex.ToString())));
            }
        }