bool HandleJoinTaskInfo(NetCmdBase obj) { LC_Cmd_JoinTask ncb = (LC_Cmd_JoinTask)obj; tagTaskConfig pConfig = null; if (!FishConfig.Instance.m_TaskInfo.m_TaskMap.TryGetValue(ncb.TaskID, out pConfig)) { return(false); } RoleTaskBase pBase = CreateTask((EventTargetType)pConfig.TaskEventInfo.EventID); tagRoleTaskInfo pInfo = new tagRoleTaskInfo(); pInfo.TaskID = ncb.TaskID; pInfo.TaskValue = 0; if (pBase == null || !pBase.OnInit(pInfo, this)) { return(false); } m_TaskMap.Add(ncb.TaskID, pBase); PlayerRole.Instance.UpdateRoleEventHandle(); CheckIsExistsFinishItem(); tagOnceTaskChangeEvent pEvent = new tagOnceTaskChangeEvent(ncb.TaskID); MsgEventHandle.HandleMsg(pEvent); return(true); }
public virtual void ChangeTaskErrorInfo(tagRoleTaskInfo pInfo) { //客户端向服务器端发送错误的请求的时候 我们重置任务的数据 pTaskInfo = pInfo; m_TaskEventIsFinish = (pConfig.TaskEventInfo.FinishValue <= pTaskInfo.TaskValue); tagOnceTaskChangeEvent pEvent = new tagOnceTaskChangeEvent(pTaskInfo.TaskID); MsgEventHandle.HandleMsg(pEvent); }
public virtual bool OnInit(tagRoleTaskInfo pInfo, RoleTaskManager pManager) { //初始化任务 的数据 m_pManger = pManager; pTaskInfo = pInfo;//客户端在加载的时候 无须判断是否需要进行每日清空 pConfig = FishConfig.Instance.m_TaskInfo.m_TaskMap[pTaskInfo.TaskID]; m_TaskEventIsFinish = (pConfig.TaskEventInfo.FinishValue <= pInfo.TaskValue); OnJoinTask(); return(true); }