/// <summary> /// 从服务器获取玩家搜索数据 /// </summary> private void GetSearchList(Transform inputTF) { StaticData.DebugGreen("请求玩家搜索数据~~~"); //获取输入框内容 string inputText = inputTF.GetComponent <Text>().text; if (inputText.Length == 0) { //提示弹窗 string tipStr = LocalizationDefineHelper.GetStringNameById(120125); StaticData.CreateToastTips(tipStr); return; } //if (inputText == StaticData.Uid.ToString()) //{ // string searchSelfTip = LocalizationDefineHelper.GetStringNameById(120132); // StaticData.CreateToastTips(searchSelfTip); // return; //} _buttonRefresh.gameObject.SetActive(false); _buttonRefreshGrey.gameObject.SetActive(false); scSearchInfo = new SCSearch(); CSSearch csSearch = new CSSearch() { SearchContext = inputText }; ProtocalManager.Instance().SendCSSearch(csSearch, (scSearch) => { if (scSearch == null) { StaticData.DebugGreen("搜索玩家结果为空~~~"); ShowEmptyTip(FriendTabTags.TabRecommend); GenerateSearchListUI(0); return; } scSearchInfo = scSearch; int playerNum = scSearchInfo.Search.Count; GenerateSearchListUI(playerNum); }, (error) => { }); }
public void SendCSSearch(CSSearch cssearch, Action <SCSearch> ResponseSCSearchCallBack, Action <ErrorInfo> errorCallBack, bool isShowDefaultTip = true) { OpCodeType opCodeType = ListOPRelation.GetOpCodeTypeByRequest <CSSearch> (); ProtoSendMethod.BusinessRequest <SCSearch>(cssearch, opCodeType, ResponseSCSearchCallBack, errorCallBack, isShowDefaultTip); }