Exemplo n.º 1
0
        private void OnSyncTaskProgress(TaskInfo info_)
        {
            long taskUUID = info_.PlayerTaskId;

            TaskBase task = this.m_playerTaskSet.GetTaskById(taskUUID);

            if (task != null)
            {
                task.SyncTaskInfo(info_);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 同步任务详细数据
        /// </summary>
        /// <param name="message"></param>
        private void OnSyncTaskProgress(object message)
        {
            SCTaskListResponse msg = message as SCTaskListResponse;

            HashSet <long> currentProgressingTaskIDs = new HashSet <long>();

            for (int i = 0; i < msg.TaskInfos.Count; ++i)
            {
                long taskUUID = msg.TaskInfos[i].PlayerTaskId;

                TaskBase task = this.m_playerTaskSet.GetTaskById(taskUUID);
                if (task != null)
                {
                    task.SyncTaskInfo(msg.TaskInfos[i]);

                    if (task.TaskCurrentStatus == TaskStatus.PROGRESSING || task.TaskCurrentStatus == TaskStatus.COMPLETED)
                    {
                        if (task.TaskCurrentStatus == TaskStatus.PROGRESSING)
                        {
                            currentProgressingTaskIDs.Add(task.TaskConfID);
                        }

                        if (!this.m_currentTaskList.Contains(task))
                        {
                            this.m_currentTaskList.Add(task);
                        }
                    }
                }
            }

            if (currentProgressingTaskIDs.Count > 0)
            {
                FindObjSceneDataManager.RefreshSceneIDsForTasks(currentProgressingTaskIDs);
            }

            if (this.m_currentTaskList.Count > 0)
            {
                GameEvents.TaskEvents.OnSyncedTaskList.SafeInvoke(this.m_currentTaskList.Count);
            }
        }