Exemple #1
0
 public BitExo()
 {
     StaticLoginParams     = new LoginParameter[] { new LoginParameter("API Key", false, true, false, false) };
     this.MaxRoll          = 99.9999m;
     this.SiteAbbreviation = "BE";
     this.SiteName         = "Bit-Exo";
     this.SiteURL          = "https://bit-exo.com/?ref=seuntjie";
     this.Stats            = new SiteStats();
     this.TipUsingName     = true;
     this.AutoInvest       = false;
     this.AutoWithdraw     = false;
     this.CanChangeSeed    = false;
     this.CanChat          = false;
     this.CanGetSeed       = false;
     this.CanRegister      = false;
     this.CanSetClientSeed = false;
     this.CanTip           = true;
     this.CanVerify        = false;
     this.Currencies       = new string[] { "BTC", "BXO", "CLAM", "DOGE", "LTC" };
     SupportedGames        = new Games.Games[] { Games.Games.Dice };
     this.Currency         = 0;
     this.DiceBetURL       = "https://bit-exo.com/{0}";
     this.Edge             = 1;
     LoginTimer.Elapsed   += LoginTimer_Elapsed;
     LoginTimer.Enabled    = false;
 }
Exemple #2
0
        /// <summary>
        /// 執行登入
        /// </summary>
        /// <param name="parameter"></param>
        /// <returns></returns>
        public BaseResultModel <MemberModel> DoLogin(LoginParameter parameter)
        {
            var result = new BaseResultModel <MemberModel>()
            {
                Result = false
            };

            var memeber = _MemberRepository.CheckLogin(parameter.Email, parameter.Password);

            if (memeber != null)
            {
                var now    = DateTime.Now;
                var ticket = new FormsAuthenticationTicket(
                    version: 1,
                    name: memeber.Name,
                    issueDate: DateTime.Now,
                    expiration: now.AddHours(1),
                    isPersistent: false,
                    userData: memeber.Account,
                    cookiePath: FormsAuthentication.FormsCookiePath);
                var        encryptTicket = FormsAuthentication.Encrypt(ticket);
                HttpCookie cookie        = new HttpCookie(FormsAuthentication.FormsCookieName, encryptTicket);
                cookie.Expires = ticket.Expiration;
                HttpContext.Current.Response.Cookies.Add(cookie);
                HttpContext.Current.Session.Add(ApplicationConst.LoginSessionKey, memeber);
                result.Result = true;
                result.Data   = memeber;
            }
            else
            {
                result.Message     = "帳號或密碼錯誤";
                result.Description = "錯誤";
            }
            return(result);
        }
Exemple #3
0
 public PrimeDice()
 {
     StaticLoginParams     = new LoginParameter[] { new LoginParameter("API Key", true, true, false, true) };
     this.MaxRoll          = 99.99m;
     this.SiteAbbreviation = "PD";
     this.SiteName         = "PrimeDice";
     this.SiteURL          = "https://primedice.com?c=Seuntjie";
     this.Stats            = new SiteStats();
     this.TipUsingName     = true;
     this.AutoInvest       = false;
     this.AutoWithdraw     = true;
     this.CanChangeSeed    = true;
     this.CanChat          = false;
     this.CanGetSeed       = true;
     this.CanRegister      = false;
     this.CanSetClientSeed = false;
     this.CanTip           = true;
     this.CanVerify        = true;
     this.Currencies       = new string[] { "Btc", "Ltc", "Eth", "Doge", "Bch", "XRP", "TRX" };
     SupportedGames        = new Games.Games[] { Games.Games.Dice };
     this.Currency         = 0;
     this.DiceBetURL       = "https://primedice.com/bet/{0}";
     this.Edge             = 1;
     NonceBased            = true;
 }
Exemple #4
0
 public Bitvest()
 {
     StaticLoginParams     = new LoginParameter[] { new LoginParameter("Username", false, true, false, false), new LoginParameter("Password", true, true, false, true), new LoginParameter("2FA Code", false, false, true, true, true) };
     this.MaxRoll          = 99.99m;
     this.SiteAbbreviation = "BV";
     this.SiteName         = "Bitvest";
     this.SiteURL          = "https://bitvest.io?r=46534";
     this.Stats            = new SiteStats();
     this.TipUsingName     = true;
     this.AutoInvest       = false;
     this.AutoWithdraw     = true;
     this.CanChangeSeed    = true;
     this.CanChat          = false;
     this.CanGetSeed       = true;
     this.CanRegister      = false;
     this.CanSetClientSeed = false;
     this.CanTip           = true;
     this.CanVerify        = true;
     this.Currencies       = new string[] { "btc", "tok", "ltc", "eth", "doge", "bch" };
     CurrencyMap           = new string[] { "bitcoins", "tokens", "litecoins", "ethers", "dogecoins", "bcash" };
     SupportedGames        = new Games.Games[] { Games.Games.Dice };
     this.Currency         = 0;
     this.DiceBetURL       = "https://bitvest.io/bet/{0}";
     this.Edge             = 1;
 }
Exemple #5
0
        public ActionResult Sign(LoginParameter loginPara)
        {
            string  res      = mUserMgr.Login(loginPara.MobileOrEmail, loginPara.Password);
            MsgInfo loginMsg = JsonConvert.DeserializeObject <MsgInfo>(res);

            if (!loginMsg.IsError)
            {
                LoginUsers loginUser   = JsonConvert.DeserializeObject <LoginUsers>(loginMsg.Msg);
                string     strUserData = JsonConvert.SerializeObject(loginUser);

                //保存身份信息
                FormsAuthenticationTicket Ticket = new FormsAuthenticationTicket(1, loginUser.Mobile, DateTime.Now, DateTime.Now.AddHours(12), false, strUserData);
                CookieHelper.Add(FormsAuthentication.FormsCookieName, FormsAuthentication.Encrypt(Ticket), RootDomain);//加密身份信息,保存至Cookie
                loginMsg.Msg = loginPara.ReturnUrl;
                if (loginPara.IsRemember)
                {
                    CookieHelper.Add("remember", loginUser.Mobile + "$" + Security.DESEncrypt(loginPara.Password), RootDomain);
                }
                else
                {
                    CookieHelper.Remove("remember");
                }
            }
            return(Json(loginMsg));
        }
Exemple #6
0
        public Bitsler()
        {
            StaticLoginParams     = new LoginParameter[] { new LoginParameter("Username", false, true, false, false), new LoginParameter("Password", true, true, false, true), new LoginParameter("API Key", true, true, false, true), new LoginParameter("2FA Code", false, false, true, true, true) };
            Currencies            = sCurrencies;
            DiceBetURL            = "https://www.bitsler.com/?ref=seuntjie/";
            SiteURL               = "https://www.bitsler.com/?ref=seuntjie";
            this.MaxRoll          = 99.99m;
            this.SiteAbbreviation = "BS";
            this.SiteName         = "Bitsler";
            this.SiteURL          = "https://bitvest.io?r=46534";
            this.Stats            = new SiteStats();
            this.TipUsingName     = true;
            this.AutoInvest       = false;
            this.AutoWithdraw     = false;
            this.CanChangeSeed    = true;
            this.CanChat          = false;
            this.CanGetSeed       = false;
            this.CanRegister      = false;
            this.CanSetClientSeed = false;
            this.CanTip           = false;
            this.CanVerify        = false;

            SupportedGames  = new Games.Games[] { Games.Games.Dice };
            this.Currency   = 0;
            this.DiceBetURL = "https://bitvest.io/bet/{0}";
            this.Edge       = 1;
        }
Exemple #7
0
        public async Task <ChadderError> Login(string username, string password)
        {
            if (await DeviceExists() == false)
            {
                var temp = await CreateDevice();

                if (temp != ChadderError.OK)
                {
                    return(temp);
                }
            }
            password = await SharedUtil.GetPasswordHash(password);

            var devicePair = await KeyFactory.RefreshBook(db.LocalDevice.PrivateKeyBook);

            var devicePublic = await devicePair.GetPublicBook();

            var request = new LoginParameter()
            {
                Username     = username,
                Password     = password,
                DeviceId     = db.LocalDevice.DeviceId,
                PublicKey    = devicePublic.Serialize(),
                RefreshToken = await CryptoHelper.CreateRandomData(32)
            };
            await request.Sign(db.LocalDevice.PrivateKeyBook.GetMaster());

            var response = await Session.PostRequestAPI <BasicResponse <string> >(Urls.Login, request);

            if (response.Error == ChadderError.OK)
            {
                var key = await CryptoHelper.CreateRandomData(32);

                sqlDB = await ChadderSQLUserDB.GetNewUserDatabase(response.Extra, key, InstanceId);

                db.LocalUser = new ChadderLocalUserInfo()
                {
                    UserId       = response.Extra,
                    Name         = username,
                    RefreshToken = request.RefreshToken
                };
                await sqlDB.InsertAsync(db.LocalUser);

                var keyPackage = new PlainBinary(key);

                var record = new ChadderLocalUserRecord()
                {
                    UserId      = response.Extra,
                    Name        = username,
                    DatabaseKey = keyPackage.Serialize()
                };
                var mainDB = await ChadderSQLMainDB.GetDatabase(InstanceId);

                await mainDB.InsertAsync(record);

                IsOnline = true;
                await FinishLoading();
            }
            return(response.Error);
        }
Exemple #8
0
        public Freebitcoin()
        {
            StaticLoginParams     = new LoginParameter[] { new LoginParameter("Username", false, true, false, false), new LoginParameter("Password", true, true, false, true), new LoginParameter("2FA Code", false, false, true, true, true) };
            this.MaxRoll          = 100m;
            this.SiteAbbreviation = "FBtc";
            this.SiteName         = "FreeBitcoin";
            this.SiteURL          = "https://freebitco.in/?r=2310118";
            this.Stats            = new SiteStats();
            this.TipUsingName     = true;
            this.AutoInvest       = false;
            this.AutoWithdraw     = false;
            this.CanChangeSeed    = false;
            this.CanChat          = false;
            this.CanGetSeed       = true;
            this.CanRegister      = false;
            this.CanSetClientSeed = false;
            this.CanTip           = true;
            this.CanVerify        = true;
            Currencies            = new string[] { "Btc" };

            SupportedGames  = new Games.Games[] { Games.Games.Dice };
            this.Currency   = 0;
            this.DiceBetURL = "https://freebitco.in/?r=2310118&bet={0}";
            this.Edge       = 5m;
        }
Exemple #9
0
 private Task <string> LoginAsync(LoginParameter ParaLogin)
 {
     return(Task.Run <string>(() =>
     {
         return Login(ParaLogin);
     }));
 }
Exemple #10
0
        public YoloDice()
        {
            StaticLoginParams     = new LoginParameter[] { new LoginParameter("Private Key", true, true, false, true) };
            Currencies            = sCurrencies;
            DiceBetURL            = "https://yolodice.com/#{0}";
            SiteURL               = "https://yolodice.com/r?fexD-GR";
            this.MaxRoll          = 99.99m;
            this.SiteAbbreviation = "YD";
            this.SiteName         = "YoloDice";
            this.SiteURL          = "https://yolodice.com/r?fexD-GR";
            this.Stats            = new SiteStats();
            this.TipUsingName     = true;
            this.AutoInvest       = false;
            this.AutoWithdraw     = true;
            this.CanChangeSeed    = true;
            this.CanChat          = false;
            this.CanGetSeed       = false;
            this.CanRegister      = false;
            this.CanSetClientSeed = false;
            this.CanTip           = false;
            this.CanVerify        = false;

            SupportedGames  = new Games.Games[] { Games.Games.Dice };
            this.Currency   = 0;
            this.DiceBetURL = "https://bitvest.io/bet/{0}";
            this.Edge       = 1;
        }
Exemple #11
0
 public Stake()
 {
     StaticLoginParams     = new LoginParameter[] { new LoginParameter("API Key", true, true, false, true) };
     this.MaxRoll          = 100m;
     this.SiteAbbreviation = "ST";
     this.SiteName         = "Stake";
     this.SiteURL          = "https://Stake.com";
     this.Stats            = new SiteStats();
     this.TipUsingName     = true;
     this.AutoInvest       = false;
     this.AutoWithdraw     = true;
     this.CanChangeSeed    = true;
     this.CanChat          = false;
     this.CanGetSeed       = true;
     this.CanRegister      = false;
     this.CanSetClientSeed = false;
     this.CanTip           = true;
     this.CanVerify        = true;
     this.Currencies       = new string[] { "Btc", "Ltc", "Eth", "Doge", "Bch" };
     SupportedGames        = new Games.Games[] { Games.Games.Dice };
     this.Currency         = 0;
     this.DiceBetURL       = "https://primedice.com/bet/{0}";
     this.Edge             = 2;
     URL          = "https://api.stake.com/graphql/";
     RolName      = "diceRoll";
     GameName     = "BetGameDice";
     StatGameName = "dice";
 }
Exemple #12
0
        public async Task <bool> Login(LoginParameter parameterLogin)
        {
            var users = await _firebaseService.GetUsers() ?? new List <User>();

            var user = users.FirstOrDefault(a => a.Email == parameterLogin.Email);

            if (user != null)
            {
                return(true);
            }

            user = new User
            {
                CreateDate = DateTime.Now,
                Id         = users.LastOrDefault()?.Id + 1 ?? 1,
                FirstName  = parameterLogin.FirstName,
                LastName   = parameterLogin.LastName,
                Email      = parameterLogin.Email,
                Status     = "Actived",
            };

            users.Add(user);

            _firebaseService.PutUsers(users);

            return(true);
        }
        private void btnLogIn_Click(object sender, RoutedEventArgs e)
        {
            SetButtonState(false);
            waitind.Visibility = Visibility.Visible;
            //show login animation
            LoginEventArgs arg = new LoginEventArgs();

            foreach (BaseEdit x in logincontrols.Keys)
            {
                LoginParameter tmp = logincontrols[x];
                if (tmp.Required && x.EditValue == null)
                {
                    //set required label
                    lciError.Visibility = Visibility.Visible;
                    waitind.Visibility  = Visibility.Hidden;
                    lblError.Content    = tmp.Name + " is required.";
                    SetButtonState(true);
                    return;
                }

                arg.Values.Add(new LoginParamValue {
                    Param = tmp, Value = x.EditValue?.ToString() ?? ""
                });
                if (tmp.ClearAfterEnter)
                {
                    x.EditValue = null;
                }
            }
            lciError.Visibility = Visibility.Hidden;
            OnLogin?.Invoke(this, arg);
        }
        public BaseResponse <LoginResult> Login(LoginParameter parameter)
        {
            BaseResponse <LoginResult> response = new BaseResponse <LoginResult>();
            LoginResult result = new LoginResult();

            try
            {
                var user = hbUserReosiory.GetDatas <HBUser>(t => t.UserToken.Equals(parameter.UserName) &&
                                                            t.PWD.Equals(parameter.PWD) &&
                                                            t.UseStatus && !t.IsDeleted, true).FirstOrDefault();
                if (user != null)
                {
                    result.RoleID   = user.RoleID;
                    response.Result = result;

                    return(response);
                }
                else
                {
                    response.IsSuccessful = false;
                    return(response);
                }
            }
            catch (global::System.Exception e)
            {
                response.IsSuccessful = false;
                return(response);
            }
        }
        public async Task <IRepositoryResult> Login(LoginParameter parameter)
        {
            var repositoryResult = await _accountBusiness.Login(parameter);

            var result = ResponseHandler.GetResult(repositoryResult);

            return(result);
        }
Exemple #16
0
        public async Task <ActionResult <BaseDto <User> > > Add(LoginParameter loginParameter)
        {
            var user = await _userBllService.AddUserAsync(loginParameter.UserName, loginParameter.Password);

            BaseDto <User> dto = new BaseDto <User>(Model.Dtos.StatusCode.Success, "", user);

            return(Ok(dto));
        }
Exemple #17
0
        public ServiceResult Invoke(ServiceRequest req)
        {
            LoginParameter param = JsonHelper.JsonDeserialize <LoginParameter>(req.data);



            throw new System.NotImplementedException();
        }
Exemple #18
0
 public IEnumerator<int> Login(SerializedObject request, string loginID, string password, string version, int appType, AsyncEnumerator ae)
 {
     long session = request.Session;
     string connectionString = SettingManager.Default.ConnectionString;
     IsFailedCountExceed(loginID, password, connectionString);
     LoginParameter loginParameter = new LoginParameter();
     loginParameter.CompanyName = string.Empty;
     if (loginID == String.Empty)
     {
         AuditHelper.AddIllegalLogin(AppType.TradingConsole, loginID, password, this.GetLocalIP());
         Application.Default.TradingConsoleServer.SaveLoginFail(loginID, password, GetLocalIP());
         SendErrorResult(request);
         yield break;
     }
     string message = string.Empty;
     Application.Default.ParticipantService.BeginLogin(loginID, password, ae.End(), null);
     yield return 1;
     loginParameter.UserID = Application.Default.ParticipantService.EndLogin(ae.DequeueAsyncResult());
     if (loginParameter.UserID == Guid.Empty)
     {
         _Logger.ErrorFormat("{0} is not a valid user", loginID);
     }
     else
     {
         Guid programID = new Guid(SettingManager.Default.GetLoginSetting("TradingConsole"));
         Guid permissionID = new Guid(SettingManager.Default.GetLoginSetting("Run"));
         Application.Default.SecurityService.BeginCheckPermission(loginParameter.UserID, programID, permissionID, "", "", loginParameter.UserID, ae.End(), null);
         yield return 1;
         bool isAuthrized = Application.Default.SecurityService.EndCheckPermission(ae.DequeueAsyncResult(), out message);
         if (!isAuthrized)
         {
             _Logger.ErrorFormat("{0} doesn't have the right to login trader", loginID);
             loginParameter.UserID = Guid.Empty;
         }
         else
         {
             Token token = new Token(Guid.Empty, UserType.Customer, (AppType)appType);
             token.UserID = loginParameter.UserID;
             token.SessionID = session.ToString();
             SessionManager.Default.AddToken(session, token);
             Application.Default.StateServer.BeginLogin(token, ae.End(), null);
             yield return 1;
             bool isStateServerLogined = Application.Default.StateServer.EndLogin(ae.DequeueAsyncResult());
             SetLoginParameter(loginParameter, session, password, version, appType, isStateServerLogined, token);
         }
     }
     if (loginParameter.UserID == Guid.Empty)
     {
         AuditHelper.AddIllegalLogin(AppType.TradingConsole, loginID, password, this.GetLocalIP());
         Application.Default.TradingConsoleServer.SaveLoginFail(loginID, password, GetLocalIP());
         SendErrorResult(request);
     }
     else
     {
         SetResult(request, loginParameter, session, loginID, password, version, appType, connectionString);
     }
 }
Exemple #19
0
        public async Task <JSONResult <string> > CodeUserLogin([FromBody]  LoginParameter obj)
        {
            return(await Task.Run(() =>
            {
                return new BaseJsonResult().UnifiedFucn(() =>
                {
                    var model = new JSONResult <string>();
                    if (obj == null)
                    {
                        model.ret = 1;
                        model.Result = "参数错误,填写参数";
                        model.Content = "登录失败";
                        return model;
                    }
                    if (obj.LoginName == null || obj.LoginName == "")
                    {
                        model.ret = 1;
                        model.Result = "登录名不能为空";
                        model.Content = "登录失败";
                        return model;
                    }
                    if (obj.passWord == null || obj.passWord == "")
                    {
                        model.ret = 1;
                        model.Result = "密码不能为空";
                        model.Content = "登录失败";
                        return model;
                    }
                    var Model = new mb_UserService().GetUserLogin(obj.LoginName);

                    if (Model != null)
                    {
                        string UserKey = Md5.md5(obj.passWord, 32) + Md5.md5(Model.UserKeyStr, 32);
                        if (UserKey.Equals(Model.UserKey))
                        {
                            model.ret = 0;
                            model.Result = "登录成功";
                            model.Content = "登录成功";
                        }
                        else
                        {
                            model.ret = 2;
                            model.Result = "密码错误";
                            model.Content = "登录失败";
                        }
                    }
                    else
                    {
                        model.ret = 5;
                        model.Result = "不存在该用户";
                        model.Content = "登录失败";
                    }
                    return model;
                });
            }));
        }
Exemple #20
0
        public async Task <JsonResult> Login([FromBody] LoginParameter model)
        {
            await _loginService.Login(model);

            var json = model.ToJson();

            Response.SetCookie("User", json, 30);

            return(Json(true));
        }
Exemple #21
0
        public async Task <IActionResult> Login(LoginParameter data)
        {
            var user = await repo.Login(data.UserName, data.Password);

            if (user == null)
            {
                return(Unauthorized());
            }

            return(Ok(new AuthResult(user, GenerateJwtToken(user))));
        }
Exemple #22
0
        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="loginInfo">登录用户信息</param>
        /// <returns>返回登录执行结果</returns>
        public Result <User> Login(LoginParameter loginInfo)
        {
            IQuery userQuery = QueryManager.Create <UserEntity>(u => u.UserName == loginInfo.UserName && u.Password == User.EncryptPassword(loginInfo.Password));
            User   user      = userRepository.Get(userQuery);

            if (user == null || !user.AllowLogin())
            {
                return(Result <User> .FailedResult("登陆失败"));
            }
            return(Result <User> .SuccessResult("登陆成功", "", user));
        }
        public AccessTokenViewModel Login([FromBody] LoginParameter parameter)
        {
            var loginDto = this._mapper.Map <LoginDto>(parameter);

            // var accessTokenDto = _authenticationService.GetAccessToken(loginDto);
            //
            // var accessTokenViewModel = _mapper.Map<AccessTokenViewModel>(accessTokenDto);
            //
            // return accessTokenViewModel;
            return(new AccessTokenViewModel());
        }
        public async override void Execute(object parameter)
        {
            _param = parameter as LoginParameter;
            if (_param == null)
            {
                return;
            }
            _param.AnimationController.StartAnimation();
            await DoLongRunningTask();

            _param?.AnimationController.EndAnimation();
        }
Exemple #25
0
        private async Task <ApplicationUser> IsValidateUser(LoginParameter loginParameter)
        {
            var user = await _userManager.FindByNameAsync(loginParameter.UserName);

            if (user == null)
            {
                return(null);
            }
            var result = await _signInManager.CheckPasswordSignInAsync(user, loginParameter.Password, false);

            return(result.Succeeded ? user : null);
        }
Exemple #26
0
        public IHttpActionResult PostLogin(LoginParameter login)
        {
            var user = db.Users.Where(ww => ww.Email == login.Email && ww.Password == login.Password).FirstOrDefault();

            if (user == null)
            {
                return(NotFound());
            }
            else
            {
                return(Ok(generateTokenForUser(user)));
            }
        }
Exemple #27
0
 public override Benutzer RunLogin(LoginParameter parameter)
 {
     if (LoginInformation.Passwort.Equals(parameter.Passwort))
     {
         return(new EingeloggterBenutzer(LoginInformation, Firma));
     }
     WrongLogins++;
     if (WrongLogins >= 3)
     {
         return(new GesperrterBenutzer(LoginInformation, Firma));
     }
     return(this);
 }
Exemple #28
0
        public async Task <IActionResult> Login(LoginParameter data)
        {
            var user = await repo.Login(data.Username, data.Password);

            if (user == null)
            {
                return(Unauthorized());
            }

            return(Ok(new {
                token = Helpers.GenerateJwtToken(user.Id.ToString()),
                name = user.UserName
            }));
        }
Exemple #29
0
        public ActionResult <LoginUserSuccessResponse> LoginUser(LoginParameter loginParameter)
        {
            var userReadDto = this._userService.LoginUser(loginParameter);

            if (userReadDto == null)
            {
                return(this.Unauthorized());
            }

            string token = this._authManager.GenerateJwt(userReadDto.UserId.ToString(), userReadDto.Email, AuthRole.User);

            return(this.Ok(new LoginUserSuccessResponse {
                Token = token, User = userReadDto
            }));
        }
Exemple #30
0
 /// <summary>
 /// 登陆
 /// </summary>
 /// <param name="loginParam"></param>
 /// <returns></returns>
 public BaseResponse <UserLoginResult> Login(LoginParameter loginParam)
 {
     if (this.ValidateData <LoginParameter>(loginParam))
     {
         return(userManager.Login(loginParam));
     }
     else
     {
         BaseResponse <UserLoginResult> result = new BaseResponse <UserLoginResult>();
         result.IsSuccessful = false;
         result.Code         = "001351";
         LogHelper.WriteLog(string.Format("未通过安全验证:({0}:{1}", result.Code, result.Reason));
         return(result);
     }
 }
Exemple #31
0
        public static IPromise <LoginInfo> LoginByEmail(string email, string password)
        {
            var promise = new Promise <LoginInfo>();
            var para    = new LoginParameter {
                email    = email,
                password = password
            };
            var request = HttpManager.POST($"{Config.apiAddress}{Config.apiPath}/auth/live/login", parameter: para);

            HttpManager.resume(request: request).Then(responseText => {
                var loginInfo = JsonConvert.DeserializeObject <LoginInfo>(value: responseText);
                promise.Resolve(value: loginInfo);
            }).Catch(exception => promise.Reject(ex: exception));
            return(promise);
        }
Exemple #32
0
 private void SetLoginParameter(LoginParameter loginParameter, long session, string password, string environmentInfo, int appType, bool isStateServerLogined, Token token)
 {
     bool isPathPassed = false;
     DataSet dataSet = Application.Default.TradingConsoleServer.GetLoginParameters(loginParameter.UserID,loginParameter.CompanyName);
     DataRowCollection rows = dataSet.Tables[0].Rows;
     foreach (DataRow row in rows)
     {
         isPathPassed = (System.Boolean)row["IsPathPassed"];
         loginParameter.DisallowLogin = (System.Boolean)row["DisallowLogin"];
         loginParameter.IsActivateAccount = (System.Boolean)row["IsActivateAccount"];
         loginParameter.IsDisableJava30 = (System.Boolean)row["IsDisableJava30"];
         if (string.IsNullOrEmpty(loginParameter.CompanyName))
         {
             string companyName2 = (System.String)row["Path"];
             if (companyName2 == string.Empty) companyName2 = "MHL";
             if (Directory.Exists(GetOrginazationDir(companyName2)))
             {
                 isPathPassed = true;
                 loginParameter.CompanyName = companyName2;
             }
         }
         break;
     }
     if (!isPathPassed || loginParameter.DisallowLogin)
     {
         loginParameter.UserID = Guid.Empty;
     }
     else
     {
         if (isStateServerLogined)
         {
             SessionManager.Default.AddSession(loginParameter.UserID, session);
             Application.Default.TradingConsoleServer.SaveLogonLog(token, GetLocalIP(), environmentInfo);
         }
         else
         {
             AppDebug.LogEvent("TradingConsole.Login2", loginParameter.UserID + " StateServer.Login failed", EventLogEntryType.Error);
             SessionManager.Default.RemoveToken(session);
             loginParameter.UserID = Guid.Empty;
         }
     }
 }
Exemple #33
0
 private void SetResult(SerializedObject request, LoginParameter loginParameter, long session, string loginID, string password, string version, int appType, string connectionString)
 {
     XElement result;
     Token token = SessionManager.Default.GetToken(session);
     if (loginParameter.UserID != Guid.Empty)
     {
         LoginRetryTimeHelper.ClearFailedCount(loginParameter.UserID, ParticipantType.Customer, connectionString);
         string language = string.IsNullOrEmpty(version) ? "ENG" : version.Substring(version.Length - 3);
         if (token == null)
         {
             AppType tokenType = (AppType)appType;
             token = new Token(loginParameter.UserID, UserType.Customer, tokenType);
             SessionManager.Default.AddToken(session, token);
         }
         token.Language = language;
         var companyLogo = this.GetLogoForJava(loginParameter.CompanyName);
         var colorSettings = this.GetColorSettingsForJava(loginParameter.CompanyName);
         var systemParameter = this.GetParameterForJava(session, loginParameter.CompanyName, language);
          var settings = this.GetSettings(loginParameter.CompanyName);
         var tradingAccountData = Application.Default.TradingConsoleServer.GetTradingAccountData(loginParameter.UserID);
         var recoverPasswordData = Application.Default.TradingConsoleServer.GetRecoverPasswordData(language, loginParameter.UserID);
         var dict = new Dictionary<string, string>()
             {
                 {"companyName", loginParameter.CompanyName},
                 {"disallowLogin", loginParameter.DisallowLogin.ToString()},
                 {"isActivateAccount", loginParameter.IsActivateAccount.ToString()},
                 {"isDisableJava30", loginParameter.IsDisableJava30.ToString()},
                 {"companyLogo",Convert.ToBase64String(companyLogo)},
                 {"colorSettings",colorSettings.OuterXml},
                 {"parameter",systemParameter.OuterXml},
                 {"settings",settings.OuterXml},
                 {"recoverPasswordData",recoverPasswordData.ToXml()},
                 {"tradingAccountData", tradingAccountData.ToXml()},
                 {"userId", loginParameter.UserID.ToString()},
                 {"session", session.ToString()}
             };
         result = XmlResultHelper.NewResult(dict);
         Application.Default.SessionMonitor.Add(session);
     }
     else
     {
         LoginRetryTimeHelper.IncreaseFailedCount(loginID, ParticipantType.Customer, connectionString);
         result = XmlResultHelper.ErrorResult;
     }
     if (token.AppType != AppType.Mobile)
     {
         request.Content = result;
         SendCenter.Default.Send(request);
     }
 }