public void OnRecvUpdateMentorshipList(IntPtr ptr, int nLen) { IntPtrVaArgParseHelper helper = new IntPtrVaArgParseHelper(ptr, nLen); GameLogic.cmd_mentorship_mentorshiplist_head mentorshipListHead = helper.get <GameLogic.cmd_mentorship_mentorshiplist_head>(); m_MasterList.Clear(); m_FPrenticeList.Clear(); m_IPrenticeList.Clear(); for (int i = 0; i < mentorshipListHead.nCount; ++i) { GameLogic.cmd_mentorship_personshipinfo cmdNodeData = helper.get <GameLogic.cmd_mentorship_personshipinfo>(); if (cmdNodeData.nPost == (int)EMMentorshipPost.emMentorshipPost_Prentice) { if (cmdNodeData.nRelationType == (int)EMMentorshipType.emMentorshipType_Formal) { m_FPrenticeList.Add(cmdNodeData); } else { m_IPrenticeList.Add(cmdNodeData); } } else if (cmdNodeData.nPost == (int)EMMentorshipPost.emMentorshipPost_Master) { m_MasterList.Add(cmdNodeData); } } sortMasterList(); sortFPrenticeList(); sortIPrenticeList(); UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_MENTORSHIP_UPDATEMASTERLIST, null); UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_MENTORSHIP_UPDATEFPRENTICELIST, null); UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_MENTORSHIP_UPDATEIPRENTICELIST, null); }
public void OnRecvUpdateMentorshipInfo(IntPtr ptr, int nLen) { IntPtrVaArgParseHelper helper = new IntPtrVaArgParseHelper(ptr, nLen); GameLogic.cmd_mentorship_updateshipinfo cmdData = helper.get <GameLogic.cmd_mentorship_updateshipinfo>(); for (int i = 0; i < m_MasterList.Count; ++i) { if (cmdData.nMentorshipID == m_MasterList[i].nMentorshipID) { GameLogic.cmd_mentorship_personshipinfo shipNode = m_MasterList[i]; shipNode.nRelationType = cmdData.nRelationType; shipNode.nState = cmdData.nState; shipNode.nSeverPDBID = cmdData.nSeverPDBID; shipNode.nSeverTime = cmdData.nSeverTime; shipNode.szName = cmdData.szName; m_MasterList[i] = shipNode; sortMasterList(); UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_MENTORSHIP_UPDATEMASTERLIST, null); return; } } for (int i = 0; i < m_FPrenticeList.Count; ++i) { if (m_FPrenticeList[i].nMentorshipID == cmdData.nMentorshipID) { GameLogic.cmd_mentorship_personshipinfo shipNode = m_FPrenticeList[i]; shipNode.nRelationType = cmdData.nRelationType; shipNode.nState = cmdData.nState; shipNode.nSeverPDBID = cmdData.nSeverPDBID; shipNode.nSeverTime = cmdData.nSeverTime; shipNode.szName = cmdData.szName; m_FPrenticeList[i] = shipNode; UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_MENTORSHIP_UPDATEFPRENTICELIST, null); return; } } for (int j = 0; j < m_IPrenticeList.Count; ++j) { if (cmdData.nMentorshipID == m_IPrenticeList[j].nMentorshipID) { if (cmdData.nRelationType == (int)EMMentorshipType.emMentorshipType_Formal) { GameLogic.cmd_mentorship_personshipinfo shipNode = m_IPrenticeList[j]; shipNode.nRelationType = cmdData.nRelationType; shipNode.nState = cmdData.nState; shipNode.nSeverPDBID = cmdData.nSeverPDBID; shipNode.nSeverTime = cmdData.nSeverTime; m_FPrenticeList.Add(shipNode); m_IPrenticeList.Remove(m_IPrenticeList[j]); sortFPrenticeList(); UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_MENTORSHIP_UPDATEFPRENTICELIST, null); UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_MENTORSHIP_UPDATEIPRENTICELIST, null); } else { GameLogic.cmd_mentorship_personshipinfo shipNode = m_IPrenticeList[j]; shipNode.nRelationType = cmdData.nRelationType; shipNode.nState = cmdData.nState; shipNode.nSeverPDBID = cmdData.nSeverPDBID; shipNode.nSeverTime = cmdData.nSeverTime; shipNode.szName = cmdData.szName; m_IPrenticeList[j] = shipNode; UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_MENTORSHIP_UPDATEIPRENTICELIST, null); } return; } } }