Exemplo n.º 1
0
        public override void BuildPacket()
        {
            PushIntoStack(bossPlotID);
            PushIntoStack(_guild == null ? (short)0 : _guild.GuildBossInfo.BossLv);
            PushIntoStack(_guild == null ? 0 : _guild.ColdTime);
            PushIntoStack(_regNum);
            PushIntoStack(_guild == null ? (short)0 : _guild.CombatStatus.ToShort());
            PushIntoStack((_inspirePercent * 100).ToInt());
            PushIntoStack(_reLiveNum);


            PushIntoStack(_bossUserList.Count);
            foreach (BossUser bossUser in _bossUserList)
            {
                DataStruct dsItem = new DataStruct();
                dsItem.PushIntoStack(bossUser.NickName.ToNotNullString());
                UserGeneral userGeneral = UserGeneral.GetMainGeneral(bossUser.UserId);
                dsItem.PushIntoStack(userGeneral == null ? string.Empty : userGeneral.HeadID.ToNotNullString());
                dsItem.PushIntoStack(bossUser.IsRelive ? 0 : 1);
                dsItem.PushIntoStack(bossUser.CodeTime);
                dsItem.PushIntoStack(NoviceHelper.IsWingFestivalInfo(bossUser.UserId) ? (short)1 : (short)0);
                dsItem.PushIntoStack(0);
                PushIntoStack(dsItem);
            }
            PushIntoStack((_reliveInspirePercent * 100).ToInt());
        }
Exemplo n.º 2
0
        public override void BuildPacket()
        {
            PushIntoStack(cityInfo == null ? string.Empty : cityInfo.CityName.ToNotNullString());
            PushIntoStack(gameUserArray.Count);
            foreach (GameUser user in gameUserArray)
            {
                UserGeneral uGeneral = UserGeneral.GetMainGeneral(user.UserID);
                string      HeadID   = string.Empty;
                if (uGeneral != null)
                {
                    CareerInfo careerInfo = new ShareCacheStruct <CareerInfo>().FindKey(uGeneral.CareerID);
                    HeadID = user.Sex ? careerInfo.HeadID2 : careerInfo.HeadID;
                }
                UserGuild userGuild = new ShareCacheStruct <UserGuild>().FindKey(user.MercenariesID);
                string    pictureID = string.Empty;

                //原因:排除月饼和双倍材料卡
                List <UserProps> propsArray = new PersonalCacheStruct <UserProps>().FindAll(user.UserID, u => u.PropType == 3 && u.ItemID != 5200 && u.ItemID != 7003);
                if (propsArray.Count > 0 && propsArray[0].DoRefresh() > 0)
                {
                    ItemBaseInfo itemInfo = new ShareCacheStruct <ItemBaseInfo>().FindKey(propsArray[0].ItemID);
                    if (itemInfo != null)
                    {
                        pictureID = itemInfo.PictrueID;
                    }
                }
                else
                {
                    pictureID = string.Empty;
                }

                DataStruct ds = new DataStruct();
                ds.PushIntoStack(user.UserID.ToNotNullString());
                ds.PushIntoStack(user.NickName.ToNotNullString());
                ds.PushIntoStack(HeadID.ToNotNullString());
                ds.PushIntoStack(user.MercenariesID.ToNotNullString());
                ds.PushIntoStack(userGuild == null ? string.Empty : userGuild.GuildName.ToNotNullString());
                ds.PushIntoStack((short)user.UserStatus);
                ds.PushIntoStack(user.PointX);
                ds.PushIntoStack(user.PointY);
                ds.PushIntoStack(pictureID.ToNotNullString());
                ds.PushIntoStack(NoviceHelper.IsWingFestivalInfo(user.UserID) ? (short)1 : (short)0);
                ds.PushIntoStack(0);
                PushIntoStack(ds);
            }
        }
Exemplo n.º 3
0
        public override bool TakeAction()
        {
            UserFunction userFunction = new PersonalCacheStruct <UserFunction>().FindKey(ContextUser.UserID, FunctionEnum.Xiulian);

            if (userFunction != null)
            {
                UserHelper.XiuLianGianExperience(ContextUser.UserID); //修炼完成后更改修炼状态

                int inerDate = (int)(DateTime.Now - ContextUser.OnlineDate).TotalSeconds;
                if (inerDate > 300 && ContextUser.UserStatus != UserStatus.XiuLian)
                {
                    int totalTime = 0;
                    GeneralPracticeInfo generalpractice = new ShareCacheStruct <GeneralPracticeInfo>().FindKey(ContextUser.UserLv);
                    if (VipHelper.GetVipOpenFun(ContextUser.VipLv, ExpandType.XiuLianYanChangErShiSiXiaoShi))
                    {
                        totalTime = ConfigEnvSet.GetInt("User.XiuLianDate");
                    }
                    else
                    {
                        if (generalpractice != null)
                        {
                            totalTime = (generalpractice.MaxHour * 60 * 60);
                        }
                    }

                    if (inerDate > 300 && ContextUser.UserStatus != UserStatus.XiuLian && ContextUser.UserStatus != UserStatus.FightCombat)
                    {
                        ContextUser.UserStatus = UserStatus.XiuLian;
                        //ContextUser.Update();

                        List <UserQueue> userQueueArray = new PersonalCacheStruct <UserQueue>().FindAll(ContextUser.UserID, m => m.QueueType == QueueType.XiuLian);
                        if (userQueueArray.Count > 0)
                        {
                            UserQueue userQueue = userQueueArray[0];
                            userQueue.TotalColdTime = totalTime;
                            userQueue.ColdTime      = totalTime;
                            userQueue.Timing        = DateTime.Now;
                            userQueue.IsSuspend     = false;
                            userQueue.StrengNum     = 0;
                            //userQueue.Update();
                        }
                        _statusList.Add(MessageState.XiuLian);
                    }
                }
            }

            UserDailyRestrain dailyRestrain = new PersonalCacheStruct <UserDailyRestrain>().FindKey(ContextUser.UserID);

            if (new TjxChatService(ContextUser).HasMessage(ContextUser.ChatVesion))
            {
                _statusList.Add(MessageState.Chat);
            }

            if (NoviceHelper.CheckOnlinePrize(Uid))
            {
                _statusList.Add(MessageState.TakeOnline);
            }

            if (NoviceHelper.CheckLoginPrize(Uid))
            {
                _statusList.Add(MessageState.TakeLogin);
            }
            if (new TjxBroadcastService(ContextUser).HasMessage())
            {
                _statusList.Add(MessageState.Broadcast);
            }

            if (NoviceHelper.CheckDailyExpPrize(Uid))
            {
                _statusList.Add(MessageState.TakeDailyExp);
            }

            if (RankingHelper.IsGainSportsReward(ContextUser.UserID))
            {
                _statusList.Add(MessageState.JingJiChangReward);
            }

            UserFunction countryFunction = new PersonalCacheStruct <UserFunction>().FindKey(ContextUser.UserID, FunctionEnum.Country);

            if (countryFunction != null && dailyRestrain != null && dailyRestrain.Funtion8 < VipHelper.GetVipUseNum(ContextUser.VipLv, RestrainType.LingQuFengLu))
            {
                _statusList.Add(MessageState.LingQuFengLv);
            }

            if (NoviceHelper.DailyEnergy(ContextUser.UserID))
            {
                _statusList.Add(MessageState.SurplusEnergy);
            }
            if (new GameActiveCenter(Uid).HasActive())
            {
                _statusList.Add(MessageState.Huodong);
            }
            if (NoviceHelper.IsAugustSecondWeekEnergy(ContextUser))
            {
                _statusList.Add(MessageState.FestivalEnergy);
            }
            if (NoviceHelper.IsWingFestivalInfo(ContextUser.UserID))
            {
                _statusList.Add(MessageState.Wing);
            }

            if (GuildFightBroadcast(ContextUser.UserID, stakecount, ContextUser.MercenariesID))
            {
                _statusList.Add(MessageState.GuildFight);
            }
            else
            {
                stakecount = 0;
            }

            var userPrizeList = new ShareCacheStruct <UserTakePrize>().FindAll(m => !m.IsTasked && m.UserID == Uid.ToInt());

            if (userPrizeList.Count > 0)
            {
                _statusList.Add(MessageState.TaskPrize);
            }
            return(true);
        }