public uint Execute(PacketDistributed ipacket) { GC_FINDPLAYER packet = (GC_FINDPLAYER)ipacket; if (null == packet) { return((uint)PACKET_EXE.PACKET_EXE_ERROR); } //enter your logic if (null != GUIData.delPlayerFindResult) { GUIData.delPlayerFindResult(packet); } //RelationLogic.Instance().UpdatePlayerFindResult(packet); return((uint)PACKET_EXE.PACKET_EXE_CONTINUE); }
void OnLoadPlayerFindItem(GameObject resItem, object param) { if (null == resItem) { LogModule.ErrorLog("can not load player find item"); return; } GC_FINDPLAYER packet = param as GC_FINDPLAYER; //清空表格内容 ClearPleyrFindItem(); //填充数据 int idCount = packet.guidCount; for (int i = 0; i < idCount; i++) { Relation player = new Relation(); player.Guid = packet.GetGuid(i); player.Name = packet.GetName(i); player.Level = packet.GetLevel(i); player.Profession = packet.GetProf(i); player.CombatNum = packet.GetCombat(i); //player.TimeInfo = packet.GetTimeInfo(i); //GameObject newPlayerFindItem = Utils.BindObjToParent(resItem, m_PlayerFindListGrid, i.ToString()); //newPlayerFindItem.GetComponent<PlayerFindItemLogic>().InitPlayerFindItem(player); PlayerFindItemLogic PlayerItem = PlayerFindItemLogic.CreateItem(m_PlayerFindListGrid, resItem, i.ToString(), this); if (PlayerItem == null) { continue; } PlayerItem.InitPlayerFindItem(player); if (m_SelectItem == null) { SetSelectPlayerItem(PlayerItem); } } m_PlayerFindListGrid.GetComponent <UIGrid>().repositionNow = true; m_PlayerFindListGrid.GetComponent <UITopGrid>().recenterTopNow = true; }
//收到服务器返回结果之后,更新玩家查找结果 public void UpdatePlayerFindResult(GC_FINDPLAYER packet) { if (packet.HasRet) { if (packet.Ret == 1) { GUIData.AddNotifyData("#{5128}"); return; } else if (packet.Ret == 2) { GUIData.AddNotifyData("#{2745}"); return; } UIManager.LoadItem(UIInfo.PlayerFindItem, OnLoadPlayerFindItem, packet); } else { UIManager.LoadItem(UIInfo.PlayerFindItem, OnLoadPlayerFindItem, packet); } }