bool HandleJoinActionInfo(NetCmdBase obj) { LC_Cmd_JoinAction ncb = (LC_Cmd_JoinAction)obj; tagActionConfig pConfig = null; if (!FishConfig.Instance.m_ActionInfo.m_ActionMap.TryGetValue(ncb.ActionID, out pConfig)) { return(false); } RoleActionBase pBase = CreateAction((EventTargetType)pConfig.EventID); tagRoleActionInfo pInfo = new tagRoleActionInfo(); pInfo.ActionID = ncb.ActionID; pInfo.ActionValue = 0; if (pBase == null || !pBase.OnInit(pInfo, this)) { return(false); } m_ActionMap.Remove(ncb.ActionID); m_ActionMap.Add(ncb.ActionID, pBase); PlayerRole.Instance.UpdateRoleEventHandle(); // CheckIsExistsFinishItem(); tagOnceActionChangeEvent pEvent = new tagOnceActionChangeEvent(ncb.ActionID); MsgEventHandle.HandleMsg(pEvent); return(true); }
bool HandleGetRoleActionInfo(NetCmdBase obj) { LC_Cmd_GetRoleActionInfo ncb = (LC_Cmd_GetRoleActionInfo)obj; if ((ncb.States & FishDataInfo.MsgBegin) != 0) { m_ActionMap.Clear(); } for (UInt16 i = 0; i < ncb.Sum; ++i) { tagActionConfig pConfig = null; if (!FishConfig.Instance.m_ActionInfo.m_ActionMap.TryGetValue(ncb.Array[i].ActionID, out pConfig)) { continue; } RoleActionBase pBase = CreateAction((EventTargetType)pConfig.EventID); if (pBase == null || !pBase.OnInit(ncb.Array[i], this)) { continue; } m_ActionMap.Add(ncb.Array[i].ActionID, pBase); } if ((ncb.States & FishDataInfo.MsgEnd) != 0) { m_IsLoadInfo = true; tagActionChangeEvent pEvent = new tagActionChangeEvent(); MsgEventHandle.HandleMsg(pEvent); } return(true); }
bool HandleChangeActionInfo(NetCmdBase obj) { LC_Cmd_GetOnceActionInfo ncb = (LC_Cmd_GetOnceActionInfo)obj; RoleActionBase pAction = GetAction(ncb.ActionInfo.ActionID); if (pAction == null) { //直接添加 tagActionConfig pConfig = null; if (!FishConfig.Instance.m_ActionInfo.m_ActionMap.TryGetValue(ncb.ActionInfo.ActionID, out pConfig)) { return(false); } pAction = CreateAction((EventTargetType)pConfig.EventID); if (pAction == null || !pAction.OnInit(ncb.ActionInfo, this)) { return(false); } m_ActionMap.Add(ncb.ActionInfo.ActionID, pAction); // CheckIsExistsFinishItem(); tagOnceActionChangeEvent pEvent = new tagOnceActionChangeEvent(ncb.ActionInfo.ActionID); MsgEventHandle.HandleMsg(pEvent); return(true); } else { UInt32 ID = (ncb.ActionInfo.ActionStates ^ pAction.pActionInfo.ActionStates); pAction.pActionInfo = ncb.ActionInfo; // CheckIsExistsFinishItem(); tagOnceActionChangeEvent pEvent = new tagOnceActionChangeEvent(ncb.ActionInfo.ActionID); MsgEventHandle.HandleMsg(pEvent); RoleActionBase pBase = GetAction(ncb.ActionInfo.ActionID); if (pBase != null && pBase.pConfig.EventMap.ContainsKey(ID)) { tagActionEventConfig pEventConfig = pBase.pConfig.EventMap[ID]; tagActionOnceRewardEvent pReward = new tagActionOnceRewardEvent(ncb.ActionInfo.ActionID, ID, pEventConfig.RewardID); MsgEventHandle.HandleMsg(pReward); tagUserOperationEvent pUOM = new tagUserOperationEvent(UserOperateMessage.UOM_Action_GetReward_Sucess); MsgEventHandle.HandleMsg(pUOM); } //pAction.ChangeActionErrorInfo(ncb.ActionInfo); } return(true); }