public uint Execute(PacketDistributed ipacket) { GC_MASTER_RET_LIST packet = (GC_MASTER_RET_LIST)ipacket; if (null == packet) { return((uint)PACKET_EXE.PACKET_EXE_ERROR); } if (GameManager.gameManager.PlayerDataPool.MasterPreList != null) { GameManager.gameManager.PlayerDataPool.MasterPreList.UpdateData(packet); } if (GUIData.delMasterDataUpdate != null) { GUIData.delMasterDataUpdate(); } //enter your logic return((uint)PACKET_EXE.PACKET_EXE_CONTINUE); }
public void UpdateData(GC_MASTER_RET_LIST list) { m_MasterInfoList.Clear(); SortedDictionary <int, MasterPreviewInfo> tempList = new SortedDictionary <int, MasterPreviewInfo> (new MySort()); // 按照师门薪火排序 for (int i = 0; i < list.masterGuidCount; ++i) { MasterPreviewInfo info = new MasterPreviewInfo(); info.MasterGuid = list.GetMasterGuid(i); if (info.MasterGuid == GlobeVar.INVALID_GUID) { continue; } if (list.masterNameCount > i) { info.MasterName = list.GetMasterName(i); } if (list.masterTorchCount > i) { info.MasterTorch = list.GetMasterTorch(i); } if (list.masterChiefNameCount > i) { info.MasterChiefName = list.GetMasterChiefName(i); } if (list.memberNumCount > i) { info.MasterCurMemberNum = list.GetMemberNum(i); } if (list.createTimeCount > i) { info.MasterCreateTime = list.GetCreateTime(i); } if (list.skillID1Count > i) { info.MasterSkillId1 = list.GetSkillID1(i); } if (list.skillID2Count > i) { info.MasterSkillId2 = list.GetSkillID2(i); } if (list.skillID3Count > i) { info.MasterSkillId3 = list.GetSkillID3(i); } if (list.skillID4Count > i) { info.MasterSkillId4 = list.GetSkillID4(i); } //合法则添加 //int repeatedTorchCount = 1; if (info.IsValid()) { if (tempList.ContainsKey(-info.MasterTorch)) { continue; } else { doAddTorchToSortedList(-info.MasterTorch, info, tempList); } } } foreach (var item in tempList) { m_MasterInfoList.Add(item.Value); } }