Пример #1
0
 private void GetState(RSAccountItem account, string html)
 {
     if ((null == account))
     {
         return;
     }
     if (this.IsContains(html, "Login Successful", "Your login was successful", "You will shortly be redirected to your destination", "logout.ws"))
     {
         account.State = LoginState.LoginSucceed;
         this.GetLoginState(account);
     }
     else if (this.IsContains(html, "Login Failed", "Invalid Login or Password", "The username, email or password you entered was incorrect"))
     {
         account.State = LoginState.LoginFalied;
     }
     else if (this.IsContains(html, "The requested URL could not be retrieved", "The remote host or network may be down", HttpHelperBase.HTTPERROR))
     {
         account.State = LoginState.NetworkFailure;
     }
     else if (this.IsContains(html, "<div class=\"section_form\" id=\"recaptcha\">", "<div id=\"recaptcha_image\">"))
     {
         account.State = LoginState.Catpcha;
     }
     else if (string.IsNullOrEmpty(html) || this.IsContains(html, HttpHelperBase.HTTPERROR))
     {
         account.State = LoginState.LoginTooMuch;
     }
     else
     {
         account.State = LoginState.Unknown;
     }
 }
Пример #2
0
        protected StreamWriter GetStreamWriter(RSAccountItem userItem)
        {
            switch (userItem.State)
            {
            case LoginState.LoginSucceed:
            case LoginState.RegistrationInvalid:
                RSOutputMgt.Instance.SucceedCount++;
                return(this.GetStream(Succeed));

            case LoginState.EnterGame:
                RSOutputMgt.Instance.SucceedCount++;
                return(this.GetStream(EnterGame));

            case LoginState.LoginFalied:
                RSOutputMgt.Instance.FailedCount++;
                return(this.GetStream(Failed));

            case LoginState.Unknown:
                RSOutputMgt.Instance.UnknownCount++;
                return(this.GetStream(Unknown));

            default:
                RSOutputMgt.Instance.FailedCount++;
                return(this.GetStream(Failed));
            }
        }
Пример #3
0
        public void Output(RSAccountItem userItem, DetectionParamsItem paramsItem)
        {
            if ((null == userItem) || (null == paramsItem))
            {
                RSLogManager.Instance.ErrorWithCallback("FileExportManager.Output error, parameters has null");
                return;
            }

            this.CreateFileExporter(paramsItem);
            this.fileExporter.Output(userItem);
        }
Пример #4
0
        private void GetAccountSummary(RSAccountItem account, string html)
        {
            string summary = string.Empty;
            //<span class="bold">Country:</span> United States
            string s = HtmlParser.GetOuterTextFromHtml("Country:</span>", "</div>", 1, html);

            if (!string.IsNullOrEmpty(s))
            {
                account.AccountSummary = HtmlParser.GetInnerTextFromHtml(s).Replace("Country:", "");
            }
        }
Пример #5
0
        private void GetLoginState(RSAccountItem account)
        {
            if ((null == account))
            {
                return;
            }

            GameServer gameServer = this.DetectionParamsItem.CurrentGameServer;

            if (!string.IsNullOrEmpty((gameServer.AccountDetailUrl)))
            {
            }
        }
Пример #6
0
        public virtual void Output(RSAccountItem userItem)
        {
            lock (output)
            {
                if ((null != userItem))
                {
                    RSDBHelper.InsertHistory(userItem);
                    RSDBHelper.InsertQueriedItems(userItem);

                    StreamWriter sw      = GetStreamWriter(userItem);
                    string       content = userItem.ToString();
                    this.Output(content, sw);
                }
            }
        }
Пример #7
0
        public static bool InsertQueriedItems(RSAccountItem account)
        {
            lock (lockInsertObj)
            {
                if (IsSqlConOpened)
                {
                    string sql = string.Format(" insert into QueriedRS (QueriedIndex,Email) values ({0},\'{1}\')",
                                               account.Index, account.EMail);

                    if (!string.IsNullOrEmpty(sql))
                    {
                        sqlList.Add(sql);
                        if (sqlList.Count % INSERTMAX == 0)
                        {
                            return(InsertData(sqlList));
                        }
                    }
                }
                return(false);
            }
        }
Пример #8
0
        public static bool InsertHistory(RSAccountItem account)
        {
            if (IsSqlConOpened)
            {
                string sql = string.Format(" insert into RSResult (AccountId,Email,State,Result)" +
                                           " values ({0},\'{1}\',\'{2}\',\'{3}\') ",
                                           account.Index, account.EMail, account.State, account.StateComment);

                if (!string.IsNullOrEmpty(sql))
                {
                    //return RunSql(sql);
                    sqlHistoryList.Add(sql);
                    if (sqlHistoryList.Count % INSERTMAX == 0)
                    {
                        return(InsertData(sqlHistoryList));
                    }
                }
            }

            return(false);
        }
Пример #9
0
        public void GetState(RSAccountItem account)
        {
            if (account == null)
            {
                return;
            }
            RSLogManager.Instance.Info(string.Format("正在查询{0} ,{1}", account.Index, account.EMail));
            this.Account = account;
            GameServer gameServer = this.DetectionParamsItem.CurrentGameServer;
            string     html       = string.Empty;

            if (!string.IsNullOrEmpty(gameServer.LoginUrl))
            {
                html = this.ReadFromUrl(gameServer.LoginUrl);
                if (!string.IsNullOrEmpty(html))
                {
                    //If need Captcha
                    this.GetState(account, html);
                    if (account.IsNeedRedial)
                    {
                        return;
                    }
                }
            }

            if (string.IsNullOrEmpty(gameServer.LoginPostActionUrl))
            {
                return;
            }
            string data = string.Format(PostFormat, this.Account.EMail, this.Account.Password);

            html = this.ReadUrlContent(gameServer.LoginPostActionUrl, data);
            this.GetState(account, html);

            //if (account.IsLoginSucceed)
            //{
            //    GetAccountSummary(account, html);
            //}
        }