Exemple #1
0
        private void GetState(FightAccountItem account, string html)
        {
            if ((null == account))
            {
                return;
            }

            if (this.IsContains(html, "Personal Info", "Change Account Name", "Change Password", "LOGOUT", "<a href=\" / \">ACCOUNT</a>"))
            {
                account.State = LoginState.LoginSucceed;
            }
            else if (this.IsContains(html, "<input type=\"text\" id=\"email\" name=\"email\" value=\"\" placeholder=\"E-mail / Account Name\" autofocus=\"\" required=\"\">",
                                     "The account name or password you entered is invalid. Please check your information and try again.",
                                     "<a class=\"login-reset yui3-u\" href=\"/recovery\">", "Forgot your password?"))
            {
                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, loginTooMuch))
            {
                account.State = LoginState.LoginTooMuch;
            }
            else
            {
                account.State = LoginState.Unknown;
            }
        }
Exemple #2
0
        protected StreamWriter GetStreamWriter(FightAccountItem userItem)
        {
            switch (userItem.State)
            {
            case LoginState.LoginSucceed:
            case LoginState.RegistrationInvalid:
                OutputMgt.Instance.SucceedCount++;
                return(this.GetStream(Succeed));

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

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

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

            default:
                OutputMgt.Instance.FailedCount++;
                return(this.GetStream(Failed));
            }
        }
Exemple #3
0
        public void Output(FightAccountItem userItem, DetectionParamsItem paramsItem)
        {
            if ((null == userItem) || (null == paramsItem))
            {
                FightLogManager.Instance.ErrorWithCallback("FileExportManager.Output error, parameters has null");
                return;
            }

            this.CreateFileExporter(paramsItem);
            this.fileExporter.Output(userItem);
        }
Exemple #4
0
        public virtual void Output(FightAccountItem userItem)
        {
            lock (output)
            {
                if ((null != userItem))
                {
                    DBHelper.InsertHistory(userItem);
                    DBHelper.InsertQueriedItems(userItem);

                    StreamWriter sw      = GetStreamWriter(userItem);
                    string       content = userItem.ToString();
                    this.Output(content, sw);
                }
            }
        }
Exemple #5
0
        public static bool InsertQueriedItems(FightAccountItem account)
        {
            lock (lockInsertObj)
            {
                if (IsSqlConOpened)
                {
                    string sql = string.Format(" insert into QueriedFight (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);
            }
        }
Exemple #6
0
        public static bool InsertHistory(FightAccountItem account)
        {
            if (IsSqlConOpened)
            {
                string sql = string.Format(" insert into FightResult (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);
        }
Exemple #7
0
        public void GetState(FightAccountItem account)
        {
            if (account == null)
            {
                return;
            }
            FightLogManager.Instance.Info(string.Format("正在查询{0} ,{1}", account.Index, account.EMail));

            this.Account = account;
            GameServer gameServer = this.DetectionParamsItem.CurrentGameServer;
            string     postData   = string.Format(PostFormat, account.EMail.Replace("@", "%40"), account.Password);
            string     html       = string.Empty;

            this.refererUrl = gameServer.LoginPostActionUrl;
            html            = this.PostAndResponseUriContent(gameServer.LoginPostActionUrl, postData);
            if (html != loginTooMuch)
            {
                html = this.ReadFromUrl(gameServer.AccountDetailUrl);
            }

            this.GetState(account, html);
        }