예제 #1
0
        private void GetLoginState(RiftAccountItem account)
        {
            if ((null == account))
            {
                return;
            }

            GameServer gameServer = this.DetectionParamsItem.CurrentGameServer;

            if (!string.IsNullOrEmpty((gameServer.AccountDetailUrl)))
            {
                string content = this.ReadFromUrl(gameServer.AccountDetailUrl);
                if (string.IsNullOrEmpty(content) || content == HttpHelperBase.HTTPERROR)
                {
                    account.State = LoginState.NetworkFailure;
                }
                if (this.IsContains(content, @"RIFT Digital Collector's Edition", "RIFT Digital Standard Edition"))
                {
                    if (!this.IsContains(content, "You do not have an active subscription for this game"))
                    {
                        account.State = LoginState.EnterGame;
                    }
                }
            }
        }
예제 #2
0
        protected StreamWriter GetStreamWriter(RiftAccountItem userItem)
        {
            switch (userItem.State)
            {
            case LoginState.LoginSucceed:
            case LoginState.RegistrationInvalid:
                RiftOutputMgt.Instance.SucceedCount++;
                return(this.GetStream(Succeed));

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

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

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

            default:
                RiftOutputMgt.Instance.FailedCount++;
                return(this.GetStream(Failed));
            }
        }
예제 #3
0
        public void Output(RiftAccountItem userItem, DetectionParamsItem paramsItem)
        {
            if ((null == userItem) || (null == paramsItem))
            {
                RiftLogManager.Instance.ErrorWithCallback("FileExportManager.Output error, parameters has null");
                return;
            }

            this.CreateFileExporter(paramsItem);
            this.fileExporter.Output(userItem);
        }
예제 #4
0
        private void GetAccountSummary(RiftAccountItem 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
        public virtual void Output(RiftAccountItem userItem)
        {
            lock (output)
            {
                if ((null != userItem))
                {
                    RiftDBHelper.InsertHistory(userItem);
                    RiftDBHelper.InsertQueriedItems(userItem);

                    StreamWriter sw      = GetStreamWriter(userItem);
                    string       content = userItem.ToString();
                    this.Output(content, sw);
                }
            }
        }
예제 #6
0
        public static bool InsertQueriedItems(RiftAccountItem account)
        {
            lock (lockInsertObj)
            {
                if (IsSqlConOpened)
                {
                    string sql = string.Format(" insert into QueriedRift (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);
            }
        }
예제 #7
0
        public static bool InsertHistory(RiftAccountItem account)
        {
            if (IsSqlConOpened)
            {
                string sql = string.Format(" insert into RiftResult (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);
        }
예제 #8
0
 private void GetState(RiftAccountItem account, string html)
 {
     if ((null == account))
     {
         return;
     }
     if (this.IsContains(html, "Hello,", "Account summary"))
     {
         this.Account.State = LoginState.LoginSucceed;
         this.GetLoginState(account);
     }
     else if (this.IsContains(html, "您提供的凭证有误", "The email address or password supplied is not correct."))
     {
         this.Account.State = LoginState.LoginFalied;
     }
     else if (this.IsContains(html, "The requested URL could not be retrieved", "The remote host or network may be down"))
     {
         this.Account.State = LoginState.NetworkFailure;
     }
     else if (this.IsContains(html, "The account you are attempting to use has been temporarily blocked", "temporarily blocked"))
     {
         this.Account.State = LoginState.TempBlock;
     }
     else if (string.IsNullOrEmpty(html) || this.IsContains(html, HttpHelperBase.HTTPERROR))
     {
         this.Account.State = LoginState.LoginTooMuch;
     }
     else if (this.IsContains(html, "Confirm your email address ", "To complete registration"))
     {
         this.Account.State = LoginState.RegistrationInvalid;
     }
     else if (this.IsContains(html, "Additional information required", "We need to collect some additional information from you to fully activate your account"))
     {
         this.Account.State = LoginState.AdditionalQuestion;
     }
     else
     {
         this.Account.State = LoginState.Unknown;
     }
 }
예제 #9
0
        public void GetState(RiftAccountItem account)
        {
            if (account == null)
            {
                return;
            }
            RiftLogManager.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);
                string ltStr = HtmlParser.GetOuterTextFromHtml("<input type=\"hidden\" name=\"lt\"", "/>", 1, html);
                ltStr = HtmlParser.GetOutterPropertyFromHtml(ltStr, "value");
                if (!string.IsNullOrEmpty(ltStr))
                {
                    ltValue = ltStr;
                }
            }

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

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

            if (account.IsLoginSucceed && this.DetectionParamsItem.IsGetDetail)
            {
                GetAccountSummary(account, html);
            }
        }