Ejemplo n.º 1
0
        public override UserAccountItem GetAccountDetail(UserAccountItem accountItem)
        {
            this.curretnAccountItem = accountItem;
            string httpContent = this.GetHttpLoginContent(accountItem);

            accountItem.State = this.GetAccountState(httpContent);
            if (!accountItem.IsErrored)
            {
                if (!this.DetectionParamsItem.IsGetDetail)
                {
                    accountItem.Items = this.GetGameAccountItemList(httpContent);
                    this.SetAccountCount(accountItem);
                    return(accountItem);
                }

                this.GetSubGameAccountDetail(accountItem);
                this.GetCharacters(accountItem);
            }
            else
            {
                captchaErrorCount++;
            }

            return(accountItem);
        }
Ejemplo n.º 2
0
        private void GetUnbattleCharacter(UserAccountItem userItem)
        {
            if (userItem.IsCanGetUnbattleCharacter && this.IsCanGetUnbattleChar)
            {
                this.GetUnbattleRealm();
                this.unbattleCharList.Clear();
                this.curretnAccountItem = userItem;
                //WowLogManager.Instance.InfoWithCallback(userItem.UserDetail);
                foreach (RealmItem item in realmList)
                {
                    List <UnBattleCharItem> tempList = GetUnbattleCharacter(item.Num);
                    if ((null != tempList) && (tempList.Count > 0))
                    {
                        this.unbattleCharList.AddRange(tempList);
                        BattleOutptMgt.Instance.LevelDetailCount += tempList.Count;
                        foreach (UnBattleCharItem ci in tempList)
                        {
                            if ((ci.Level >= this.DetectionParamsItem.AvailableCharacterLevel) && this.DetectionParamsItem.IsStopByLevel)
                            {
                                continue;
                            }
                        }
                    }
                    string s = string.Format("当前正在查用户: {0 }的第 {1} 个领域: {2},有{3} 角色", userItem.EMail, item.Index, item.Name,
                                             (null == tempList) ? 0 : tempList.Count);
                    WowLogManager.Instance.InfoWithCallback(s);
                }

                this.SaveUnbattleChar();
            }
        }
Ejemplo n.º 3
0
 protected virtual void GetBattleCharacter(UserAccountItem userItem)
 {
     if (this.IsCanGetBattleChar)
     {
         this.battleCharList.Clear();
         this.curretnAccountItem = userItem;
         //Get all battle characters
         USBattleCharGetter bg = new USBattleCharGetter(0, this.DetectionParamsItem, this.LogManager, this.cookie, this.cookieContainer);
         this.battleCharList = bg.GetCharacter();
         this.SaveBattleChar();
     }
 }
Ejemplo n.º 4
0
 public override void GetCharacters(UserAccountItem userItem)
 {
     if ((null != userItem))
     {
         if (this.IsCanGetBattleChar)
         {
             this.GetBattleCharacter(userItem);
         }
         if (this.IsCanGetUnbattleChar)
         {
             this.GetUnbattleCharacter(userItem);
         }
     }
 }
Ejemplo n.º 5
0
        protected virtual string GetHttpLoginContent(UserAccountItem accountItem)
        {
            string postData        = string.Format(PostContentFormat, accountItem.EMail, accountItem.Password);
            string postCaptchaData = string.Format(PostContentWithCaptchaFormat, accountItem.EMail, accountItem.Password, "{0}");
            string content         = string.Empty;

            //New query need cookie be empty;
            this.ClearCookie();

            WowLogManager.Instance.Info(string.Format("-> post data:第{0}个 {1} to {2}", accountItem.Index, accountItem.EMail, this.DetectionParamsItem.CurrentGameServer.LoginPostActionUrl));
            this.cookie = string.Empty;
            bool isHasCaptcha = this.PostDataAndCheckCaptcha(this.DetectionParamsItem.CurrentGameServer.LoginPostActionUrl,
                                                             this.DetectionParamsItem.CurrentGameServer.DomainUrl, postData,
                                                             ref postCaptchaData, ref content);
            //if (!isHasCaptcha)
            {
                return(content);
            }

            //WowLogManager.Instance.Info(string.Format("-> post data with captcha:第{0}个 {1} to {2}", accountItem.Index, accountItem.EMail, this.DetectionParamsItem.CurrentGameServer.LoginPostActionUrl));
            //HttpWebRequest httpRequest = this.WriteToHttpWebRequest(this.DetectionParamsItem.CurrentGameServer.LoginPostActionUrl, postCaptchaData);
            //try
            //{
            //    if (null != httpRequest)
            //    {
            //        // TODO:use the same session id
            //        using (HttpWebResponse httpReponse = httpRequest.GetResponse() as HttpWebResponse)
            //        {
            //            if (null != httpReponse)
            //            {
            //                using (StreamReader sr = new StreamReader(GetGzipStream(httpReponse), Encoding.UTF8))
            //                {
            //                    return sr.ReadToEnd();
            //                }
            //            }
            //        }
            //    }
            //    return HttpHelperBase.HTTPERROR;
            //}
            //catch (Exception ex)
            //{
            //    WowLogManager.Instance.Error(string.Format("USBattleHttpHelper.GetHttpLoginContent() error:{0}", ex.Message));
            //}
            //finally
            //{
            //    this.DisposeHttpRequest(httpRequest);
            //}
            //return content;
        }
Ejemplo n.º 6
0
        protected override void GetSubGameAccountDetail(UserAccountItem accountItem)
        {
            if (accountItem.IsCanGetDetail)
            {
                IList <GameAccountItem> accountList = this.GetGameAccountItemList(this.ReadFromUrl(this.DetectionParamsItem.CurrentGameServer.SelectAccountUrl));
                if (accountList.Count > 0)
                {
                    foreach (GameAccountItem account in accountList)
                    {
                        account.Detail = this.GetGameAccountDetail(account);
                    }
                }

                accountItem.Items = accountList;
                SetAccountCount(accountItem);
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 选择子帐号,并再查子帐号明细
        /// </summary>
        /// <param name="accountItem"></param>
        protected virtual void GetSubGameAccountDetail(UserAccountItem accountItem)
        {
            if (accountItem.IsCanGetDetail)
            {
                IList <GameAccountItem> accountList = this.GetGameAccountItem();
                if (accountList.Count > 0)
                {
                    foreach (GameAccountItem account in accountList)
                    {
                        account.Detail = this.GetGameAccountDetail(account);
                    }
                }

                accountItem.Items = accountList;
                SetAccountCount(accountItem);
            }
        }
Ejemplo n.º 8
0
 protected void SetAccountCount(UserAccountItem accountItem)
 {
     if ((null == accountItem) || (accountItem.Items == null))
     {
         return;
     }
     if (accountItem.Items.Count == 0)
     {
         accountItem.State = WowLoginStates.LoginWithNoGameAccount;
     }
     else if (accountItem.Items.Count == 1)
     {
         accountItem.State = WowLoginStates.SingleGameAccount;
     }
     else if (accountItem.Items.Count > 1)
     {
         accountItem.State = WowLoginStates.MultiGameAccount;
     }
 }
Ejemplo n.º 9
0
        /// <summary>
        /// if input incorrect captcha /httperror/website error,repeat again
        /// </summary>
        /// <param name="accountItem"></param>
        public override UserAccountItem TakeMoreTryForErrored(UserAccountItem accountItem)
        {
            if (accountItem.IsErrored)
            {
                for (int i = 0; i < this.DetectionParamsItem.ErrorRepeatCount; i++)
                {
                    WowLogManager.Instance.InfoWithCallback(string.Format("重试第 {0} 次前状态,{1}", i + 1, accountItem.UserDetail));
                    string httpContent = this.GetHttpLoginContent(accountItem);
                    accountItem.State = this.GetAccountState(httpContent);

                    // cpatcha code is correct
                    if (!accountItem.IsErrored)
                    {
                        if (!this.DetectionParamsItem.IsGetDetail)
                        {
                            accountItem.Items = GetGameAccountItemList(httpContent);
                            SetAccountCount(accountItem);
                            return(accountItem);
                        }

                        this.GetSubGameAccountDetail(accountItem);
                        this.GetCharacters(accountItem);
                        WowLogManager.Instance.InfoWithCallback(string.Format("第 {0} 次重试,{1}", i + 1, accountItem.UserDetail));
                        break;
                    }
                    else
                    {
                        captchaErrorCount++;
                        WowLogManager.Instance.InfoWithCallback(string.Format("第 {0} 次重试,{1}", i + 1, accountItem.UserDetail));
                    }
                }

                if (this.captchaErrorCount > this.DetectionParamsItem.CaptchaErrorCount)
                {
                    accountItem.State = WowLoginStates.TooMuchFailedChapcha;
                }
            }

            return(accountItem);
        }
Ejemplo n.º 10
0
 public virtual void GetCharacters(UserAccountItem userItem)
 {
 }
Ejemplo n.º 11
0
 public abstract UserAccountItem TakeMoreTryForErrored(UserAccountItem accountItem);
Ejemplo n.º 12
0
 public abstract UserAccountItem GetAccountDetail(UserAccountItem accountItem);