Пример #1
0
    public bool GuideFunctionOpening(CReadPacket packet)
    {
        Dictionary <string, object> data = packet.data;

        int[] item = data["func"] as int[];
        if (null != item)
        {
            UnLockFunctionNode lockfunciton = null;
            List <int>         chapterId    = new List <int>();
            for (int i = 0; i < item.Length; i++)
            {
                lockfunciton = FSDataNodeTable <UnLockFunctionNode> .GetSingleton().FindDataByType(item[i]);

                if (null == lockfunciton)
                {
                    continue;
                }
                if (lockfunciton.chapter_id != 0)//解锁副本
                {
                    chapterId.Add(lockfunciton.chapter_id);
                }
                //设置相应的功能位开启
                FunctionOpenMng.GetInstance().SetValue(item[i]);
                //if(lockfunciton.id == 1|| lockfunciton.id == 2|| lockfunciton.id == 3|| lockfunciton.id ==4|| lockfunciton.id ==5|| lockfunciton.id ==6)
                //{
                //    UILevel.instance.openType = OpenLevelType.SysOpen;
                //    ClientSendDataMgr.GetSingle().GetBattleSend().SendQueryWorldMap();//获取世界副本
                //}
            }
            if (chapterId.Count > 0)
            {
                Dictionary <string, object> newpacket1 = new Dictionary <string, object>();
                newpacket1.Add("arg1", chapterId);
                newpacket1.Add("arg2", 1);
                Singleton <Notification> .Instance.Send(MessageID.pve_dungeon_list_req, newpacket1, C2SMessageType.ActiveWait);

                Dictionary <string, object> newpacket2 = new Dictionary <string, object>();
                newpacket2.Add("arg1", chapterId);
                newpacket2.Add("arg2", 2);
                Singleton <Notification> .Instance.Send(MessageID.pve_dungeon_list_req, newpacket2, C2SMessageType.ActiveWait);

                //ClientSendDataMgr.GetSingle().GetBattleSend().SendQueryDungeonList(chapterId, 1);
                //ClientSendDataMgr.GetSingle().GetBattleSend().SendQueryDungeonList(chapterId, 2);
            }
        }
        return(true);
    }
Пример #2
0
 public override void Info(object obj)
 {
     functionData = (UnLockFunctionNode)obj;
 }
Пример #3
0
    /// <summary>
    /// 处理日常任务的数据
    /// </summary>
    /// <param name="data"></param>
    public void DailyHandler(Dictionary <string, object> data)
    {
        playerData.GetInstance().taskDataList.itemList.Clear();
        object[] missionlist = data["misinfo"] as object[];

        //读取日常列表的所有数据
        foreach (var value in FSDataNodeTable <DailyTasksNode> .GetSingleton().DataNodeList.Values)
        {
            EveryTaskData taskData = new EveryTaskData();
            taskData.released = value.released;
            if (taskData.released != 0)
            {
                taskData.unlockSystem = value.unlockSystem;
                if (taskData.unlockSystem == 0)
                {
                    taskData.id            = value.id;
                    taskData.active        = value.active;
                    taskData.count         = value.count;
                    taskData.state         = 0;
                    taskData.countIndex    = 0;
                    taskData.activeIndex   = 0;
                    taskData.des           = value.des;
                    taskData.deblockingDes = "";
                    taskData.iconName      = value.iconName;
                    taskData.leave_for     = value.leave_for;
                    taskData.scriptId      = value.scriptId;
                    taskData.type          = value.type;
                    taskData.open          = 0;
                    taskData.taskName      = value.taskName;
                    playerData.GetInstance().taskDataList.itemList.Add(taskData);
                }
                else
                {
                    if (FSDataNodeTable <UnLockFunctionNode> .GetSingleton().DataNodeList.ContainsKey(taskData.unlockSystem))
                    {
                        UnLockFunctionNode Node = FSDataNodeTable <UnLockFunctionNode> .GetSingleton().FindDataByType(taskData.unlockSystem);

                        taskData.id            = value.id;
                        taskData.active        = value.active;
                        taskData.count         = value.count;
                        taskData.state         = 0;
                        taskData.countIndex    = 0;
                        taskData.activeIndex   = 0;
                        taskData.des           = value.des;
                        taskData.deblockingDes = Node.limit_tip;
                        taskData.iconName      = value.iconName;
                        taskData.leave_for     = value.leave_for;
                        taskData.scriptId      = value.scriptId;
                        taskData.type          = value.type;
                        int a = Node.unlock_system_type;
                        if (a == 1)
                        {
                            taskData.open = Node.condition_parameter;
                        }
                        else
                        {
                            taskData.open = 0;
                        }
                        taskData.taskName = value.taskName;
                        playerData.GetInstance().taskDataList.itemList.Add(taskData);
                    }
                }
            }
        }
        //根据服务器发送的日常列表进行状态重置
        for (int i = 0; i < missionlist.Length; i++)
        {
            int[] taskDataDic = missionlist[i] as int[];
            int   ID          = taskDataDic[0];

            if (ID != 0)
            {
                EveryTaskData taskServerData = playerData.GetInstance().taskDataList.itemList.Find(x => x.id == ID);
                if (taskServerData != null)
                {
                    taskServerData.state      = taskDataDic[1];
                    taskServerData.countIndex = taskDataDic[2];
                }
            }
        }
        if (playerData.GetInstance().taskDataList.itemList.Count > 0)
        {
            List <EveryTaskData> itemLt = new List <EveryTaskData>();
            var a = playerData.GetInstance().taskDataList.itemList.FindAll(x => x.state == (int)TaskProgress.Complete);
            itemLt.AddRange(a);
            var b = playerData.GetInstance().taskDataList.itemList.FindAll(x => x.state == (int)TaskProgress.NoAccept);
            itemLt.AddRange(b);
            var c = playerData.GetInstance().taskDataList.itemList.FindAll(x => x.state == (int)TaskProgress.CantAccept);
            c.Sort((x, y) => x.open - y.open);
            itemLt.AddRange(c);
            var d = playerData.GetInstance().taskDataList.itemList.FindAll(x => x.state == (int)TaskProgress.Reward);
            itemLt.AddRange(d);
            playerData.GetInstance().taskDataList.itemList.Clear();
            playerData.GetInstance().taskDataList.itemList.AddRange(itemLt);
            itemLt.Clear();
        }
        //if (playerData.GetInstance().taskDataList.itemList.Count > 0)
        //{
        //    if (Singleton<SceneManage>.Instance.Current == EnumSceneID.UI_MajorCity01 && UIActivities.Instance.IsShow())
        //    {
        //        UIActivities.Instance.RefreshUI();
        //    }
        //}
        Singleton <Notification> .Instance.ReceiveMessageList(MessageID.common_ask_daily_mission_req);
    }