Exemplo n.º 1
0
        public async Task SearchCharacterAsync([Summary("imie")][Remainder] string name)
        {
            var session = new SearchSession(Context.User, _shclient);

            if (_session.SessionExist(session))
            {
                return;
            }

            var response = await _shclient.Search.CharacterAsync(name);

            if (!response.IsSuccessStatusCode())
            {
                await ReplyAsync("", embed : _shinden.GetResponseFromSearchCode(response).ToEmbedMessage(EMType.Error).Build());

                return;
            }

            var list   = response.Body;
            var toSend = _shinden.GetSearchResponse(list, "Wybierz postać którą chcesz wyświetlić poprzez wpisanie numeru odpowadającemu jej na liście.");

            if (list.Count == 1)
            {
                var info = (await _shclient.GetCharacterInfoAsync(list.First())).Body;
                await ReplyAsync("", false, info.ToEmbed());
            }
            else
            {
                session.PList = list;
                await _shinden.SendSearchResponseAsync(Context, toSend, session);
            }
        }
Exemplo n.º 2
0
        private async void SearchButtonOnClick(object sender, RoutedEventArgs e)
        {
            if (CurrentSearch?.IsSearching == true)
            {
                CurrentSearch.StopSearch();
                ChangeSearchVisual(false);
                return;
            }
            ChangeSearchVisual(true);
            var para = SearchControl.GetSearchPara();

            CurrentSearch = new SearchSession(Settings, para);
            CurrentSearch.SearchStatusChanged += (session, s) => StatusTextBlock.Text = s;
            SiteTextBlock.Text = $"当前站点:{CurrentSearch.CurrentSearchPara.Site.DisplayName}";
            Settings.HistoryKeywords.AddHistory(CurrentSearch.CurrentSearchPara.Keyword, Settings);
            var t = await CurrentSearch.TrySearchNextPageAsync();

            if (t.IsCanceled || t.Exception != null)
            {
                if (!CurrentSearch.IsSearching)
                {
                    ChangeSearchVisual(false);
                }
            }
            else
            {
                ChangeSearchVisual(false);
                MoeExlorer.RefreshPaging(CurrentSearch);
            }
        }
Exemplo n.º 3
0
 private void OnSearchSessionEnded(SearchSession session)
 {
     if (session.searchStatus == SearchStatus.success)
     {
         UsersRequest.WritePoints(new UserRoomPoints(LocalPlayer, new NetRoomPoints(session.roomId, ravenhillGameModeService.roomMode, session.Points)));
     }
 }
Exemplo n.º 4
0
        private async void SearchButtonOnClick(object sender, RoutedEventArgs e)
        {
            ChangeBgImage();
            if (CurrentSearch?.IsSearching == true)
            {
                CurrentSearch.StopSearch();
                ChangeSearchVisual(false);
                return;
            }
            ChangeSearchVisual(true);
            StatusTextBlock.Text = "";
            var para = SearchControl.GetSearchPara();

            CurrentSearch      = new SearchSession(Settings, para);
            para.CurrentSearch = CurrentSearch;
            SiteTextBlock.Text = CurrentSearch.GetCurrentSearchStateText();
            Settings.HistoryKeywords.AddHistory(CurrentSearch.CurrentSearchPara.Keyword, Settings);
            MoeExplorer.ResetVisual();
            var t = await CurrentSearch.TrySearchNextPageAsync();

            if (t.IsCanceled || t.Exception != null)
            {
                if (!CurrentSearch.IsSearching)
                {
                    ChangeSearchVisual(false);
                }
            }
            else
            {
                ChangeSearchVisual(false);
                MoeExplorer.AddPage(CurrentSearch);
            }
        }
Exemplo n.º 5
0
 protected override void Cleanup()
 {
     SearchSession.PurgeAll(typeof(Document));
     SearchSession.PurgeAll(typeof(OrderDocument));
     SearchSession.PurgeAll(typeof(InvoiceDocument));
     SearchSession.PurgeAll(typeof(Reference));
 }
Exemplo n.º 6
0
        public bool CloseSearch(uint searchSessionID)
        {
            MyLog4Net.Container.Instance.Log.InfoFormat("VideoSearchService entering CancelSearch {0} ...", searchSessionID);
            lock (m_SyncObjSearch)
            {
                // Debug.Assert(m_SearchSession != null && m_SearchSession.SearchId == searchSessionID);
                //Framework.Container.Instance.IVXProtocol.CloseSearchSession(searchSessionID);
                //m_SearchSession = null;
                //m_SearchParaId = 0;
                SearchSession session = GetSearchSession((int)searchSessionID);

                if (session != null)
                {
                    try
                    {
                        CloseSearch(session.SearchPara.SearchType);
                    }
                    catch (SDKCallException ex)
                    {
                        SDKCallExceptionHandler.Handle(ex, "CloseSearchSession", false);
                    }
                }
            }

            MyLog4Net.Container.Instance.Log.InfoFormat("VideoSearchService leave CancelSearch {0}", searchSessionID);

            return(true);
        }
Exemplo n.º 7
0
        public void CloseSearch(SearchType searchType)
        {
            MyLog4Net.Container.Instance.Log.InfoFormat("VideoSearchService entering CancelSearch, type {0} ...", searchType);

            lock (m_SyncObjSearch)
            {
                if (m_DTSearchType2SearchSession.ContainsKey(searchType))
                {
                    SearchSession session = m_DTSearchType2SearchSession[searchType];
                    Framework.Container.Instance.EvtAggregator.GetEvent <SearchCloseEvent>().Publish(session);

                    try
                    {
                        MyLog4Net.Container.Instance.Log.InfoFormat("VideoSearchService entering CancelSearch, sessionId {0} ...", session.SearchId);
                        IVXProtocol.CloseSearchSession(session.SearchId);
                    }
                    finally
                    {
                        m_DTSearchType2SearchSession.Remove(searchType);
                    }
                }
            }

            MyLog4Net.Container.Instance.Log.InfoFormat("VideoSearchService leave CancelSearch, type {0}", searchType);
        }
        public void Should_search_by_partial_match()
        {
            var result = SearchSession
                         .CreateFullTextQuery <Country>("Name:Sw*")
                         .List <Country>();

            Assert.AreEqual(2, result.Count);
        }
        public void Should_search_in_address_line()
        {
            var result = SearchSession
                         .CreateFullTextQuery <Address>("AddressLine:lausanne")
                         .List <Address>();

            Assert.AreEqual(1, result.Count);
        }
Exemplo n.º 10
0
        public void Should_find_match_for_string_without_spaces()
        {
            var result = SearchSession
                         .CreateFullTextQuery <Customer>("Phone:022457*")
                         .List <Customer>();

            CollectionAssert.IsNotEmpty(result);
        }
Exemplo n.º 11
0
        public void Should_find_entities_by_their_address_2()
        {
            var result = SearchSession
                         .CreateFullTextQuery <Contact>("Addresses.AddressLine:Redmond")
                         .List <Contact>();

            Assert.AreEqual(1, result.Count);
        }
        public void Should_get_results_when_searching_by_embedded_entity()
        {
            var result = SearchSession
                         .CreateFullTextQuery <Address>("Country.Name:Switzerland")
                         .List <Address>();

            Assert.AreEqual(2, result.Count);
        }
        public void Should_search_mapped_property_by_whole_word()
        {
            var result = SearchSession
                         .CreateFullTextQuery <Country>("Name:Switzerland")
                         .List <Country>();

            Assert.AreEqual(1, result.Count);
        }
Exemplo n.º 14
0
        public async Task <bool> Start(string searchText)
        {
            //abort if search text is the same as last one
            //if (searchText.Equals(SearchText))
            //{
            //    Pici.Log.info(typeof(Search), String.Format("aborting search since text {0} is equal to last", searchText));
            //    return false;
            //}

            SearchText = searchText;

            if (cts != null)
            {
                cts.Cancel();
            }
            cts = new CancellationTokenSource();
            //create search references before OnSearchStarting
            ResultCount = 0;
            Callback    = new SearchCallback <SearchStatus>(cts.Token);
            Callback.ResultCountChanged += OnSearchCallbackResultCountChanged;

            FilterList = Callback.FilterList;

            Callback.StatusChanged += OnSearchStatusChanged;

            SearchRequest = new SearchRequest(searchText);
            SearchRequest.ItemsPerPage       = PageItemsCount;
            SearchRequest.SortingChanged    += OnSearchRequestSortOrderChanged;
            SearchRequest.FilterListChanged += OnSearchRequestFilterChanged;

            Session       = new SearchSession();
            Pages.Session = Session;

            OnSearchStarting(SearchStartingReason.NewSearch, searchText, FilterList);
            try
            {
                await Session.Start(SearchRequest, Callback);
            }
            catch (Exception ex)
            {
                if (ex is OperationCanceledException)
                {
                    Pici.Log.debug(typeof(HBSViewModel), "Search Request cancelled!");
                }
                else if (ex is HttpRequestException)
                {
                    Pici.Log.error(typeof(SearchSession),
                                   "\r\nA Web Exception occurred! Internet available? Server down?\r\n\r\n", ex);
                    //MessageBox.Show("Service is not available!\r\nInternet active? Server down?", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                }
                else
                {
                    Pici.Log.error(typeof(SearchSession), "An unexpected error occurred!", ex);
                }
                return(false);
            }
            return(true);
        }
Exemplo n.º 15
0
 private void OnSearchBegin(SearchSession session)
 {
     if (session.SearchPara.SearchType == SearchType)
     {
         // 显示取消, 检索完毕后再恢复
         SearchStatusText        = "取消";
         CanSearchOrCancelSearch = true;
     }
 }
Exemplo n.º 16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SearchingPickupEventArgs"/> class.
 /// </summary>
 /// <param name="player"><inheritdoc cref="Player"/></param>
 /// <param name="pickup"><inheritdoc cref="Pickup"/></param>
 /// <param name="searchSession"><inheritdoc cref="SearchSession"/></param>
 /// <param name="searchCompletor"><inheritdoc cref="SearchCompletor"/></param>
 /// <param name="searchTime"><inheritdoc cref="SearchTime"/></param>
 public SearchingPickupEventArgs(Player player, ItemPickupBase pickup, SearchSession searchSession, SearchCompletor searchCompletor, float searchTime)
 {
     Player          = player;
     Pickup          = Pickup.Get(pickup);
     SearchSession   = searchSession;
     SearchCompletor = searchCompletor;
     SearchTime      = searchTime;
     IsAllowed       = searchCompletor.ValidateStart();
 }
        public SearchResultSingleViewModel(SearchSession session, SearchItem searchItem)
        {
            TaskUnitInfo info = null;

            try
            {
                info = Framework.Container.Instance.TaskManagerService.GetTaskUnitById(searchItem.TaskUnitId);
            }
            catch (SDKCallException ex)
            {
                info = null;
                Common.SDKCallExceptionHandler.Handle(ex, "获取任务单元");
            }

            if (info != null)
            {
                CameraInfo camera = null;
                try
                {
                    camera = Framework.Container.Instance.VDAConfigService.GetCameraByID(info.CameraId);
                }
                catch (SDKCallException ex)
                {
                    camera = null;
                    Common.SDKCallExceptionHandler.Handle(ex, "获取监控点");
                }

                if (camera != null)
                {
                    Title = string.Format("{0} ({1}-{2}", camera.CameraName,
                                          info.StartTime.ToString(DataModel.Constant.DATETIME_FORMAT),
                                          info.EndTime.ToString(DataModel.Constant.DATETIME_FORMAT));
                }
                Title = info.TaskUnitName;
            }

            // 注册事件的时候, 可能事件已经 Fire 过了
            lock (searchItem)
            {
                Framework.Container.Instance.EvtAggregator.GetEvent <SearchFinishedEvent>().Subscribe(OnSearchFinished, Microsoft.Practices.Prism.Events.ThreadOption.WinFormUIThread);
                Framework.Container.Instance.EvtAggregator.GetEvent <SearchItemImageReceivedEvent>().Subscribe(OnSearchItemImageReceived, Microsoft.Practices.Prism.Events.ThreadOption.WinFormUIThread);
                Framework.Container.Instance.EvtAggregator.GetEvent <SearchResultRecordSelectedEvent>().Subscribe(OnSearchResultRecordSelectedEvent, Microsoft.Practices.Prism.Events.ThreadOption.WinFormUIThread);
                Framework.Container.Instance.EvtAggregator.GetEvent <SwitchPageBeginEvent>().Subscribe(OnSwitchPage, ThreadOption.PublisherThread);
                Framework.Container.Instance.RegisterEventSubscriber(this);
                m_currSearchItem = searchItem;

                m_searchSessionID = session.SearchId;
                m_SearchSession   = session;

                if (searchItem.IsFinished)
                {
                    MyLog4Net.Container.Instance.Log.DebugFormat("Fire OnSearchFinished event in SearchResultSingleViewModel constructor, ResultSummary taskUnitID: {0}", searchItem.ResultSummary.TaskUnitID);
                    // 需要补上SearchBegin, SearchFinished 事件要做的事情
                    OnSearchFinished(searchItem.ResultSummary);
                }
            }
        }
        public void Should_parse_using_lucene_query()
        {
            var parser = new MultiFieldQueryParser(Version.LUCENE_29, new[] { "Name" }, new StandardAnalyzer(Version.LUCENE_29));
            var query  = parser.Parse("Switzerland");
            var q      = SearchSession.CreateFullTextQuery(query, typeof(Country))
                         .List <Country>();

            Assert.AreEqual(1, q.Count);
        }
Exemplo n.º 19
0
        public void Can_search_filestreamed_with_multiple_pages()
        {
            var          model        = new BagOfCharsModel();
            const string collection   = "Can_search_streamed_with_one_page_per_document";
            var          collectionId = collection.ToHash();
            const string fieldName    = "description";

            _sessionFactory.Truncate(collectionId);

            using (var stream = new WritableIndexStream(collectionId, _sessionFactory))
                using (var writeSession = new WriteSession(new DocumentWriter(collectionId, _sessionFactory)))
                {
                    var keyId = writeSession.EnsureKeyExists(fieldName);

                    for (long i = 0; i < _data.Length; i++)
                    {
                        var data = _data[i];

                        using (var indexSession = new IndexSession <string>(model, model))
                        {
                            var doc = new Document(new Field[] { new Field(fieldName, data, index: true, store: true) });

                            writeSession.Put(doc);
                            indexSession.Put(doc.Id, keyId, data);
                            stream.Write(indexSession.GetInMemoryIndex());
                        }
                    }
                }

            var queryParser = new QueryParser <string>(_sessionFactory, model);

            using (var searchSession = new SearchSession(_sessionFactory, model, new PostingsReader(_sessionFactory)))
            {
                Assert.DoesNotThrow(() =>
                {
                    foreach (var word in _data)
                    {
                        var query    = queryParser.Parse(collection, word, fieldName, fieldName, and: true, or: false);
                        var result   = searchSession.Search(query, 0, 1);
                        var document = result.Documents.FirstOrDefault();

                        if (document == null)
                        {
                            throw new Exception($"unable to find {word}.");
                        }

                        if (document.Score < model.IdenticalAngle)
                        {
                            throw new Exception($"unable to score {word}.");
                        }

                        Debug.WriteLine($"{word} matched with {document.Score * 100}% certainty.");
                    }
                });
            }
        }
Exemplo n.º 20
0
        public void Should_be_able_to_get_results_from_by_querying_by_inheritors()
        {
            var parser = new QueryParser(Version.LUCENE_29, "Name", new StandardAnalyzer(Version.LUCENE_29));
            var query  = parser.Parse("doc*");
            var result = SearchSession
                         .CreateFullTextQuery(query, typeof(OrderDocument), typeof(InvoiceDocument))
                         .List <Document>();

            Assert.AreEqual(2, result.Count);
        }
Exemplo n.º 21
0
        public void Should_get_results_by_querying_a_collection_in_base_class()
        {
            var parser = new QueryParser(Version.LUCENE_29, "References.Description", new StandardAnalyzer(Version.LUCENE_29));
            var query  = parser.Parse("red");
            var result = SearchSession
                         .CreateFullTextQuery(query, typeof(OrderDocument), typeof(InvoiceDocument))
                         .List <Document>();

            Assert.AreEqual(1, result.Count);
        }
Exemplo n.º 22
0
        public void Should_be_able_to_get_results_from_whole_hierarchy_by_querying_with_abstarct_base_class()
        {
            var parser = new QueryParser(Version.LUCENE_29, "Name", new StandardAnalyzer(Version.LUCENE_29));
            var query  = parser.Parse("doc*");
            var result = SearchSession
                         .CreateFullTextQuery(query, typeof(Document))
                         .List <Document>();

            Assert.AreEqual(2, result.Count);
        }
Exemplo n.º 23
0
        public void RefreshPaging(SearchSession session)
        {
            PagingStackPanel.Children.Clear();
            var lastpage = session.LoadedPages?.LastOrDefault();

            if (lastpage == null)
            {
                return;
            }
            LoadImages(lastpage.ImageItems);
            StartDownloadShowImages();

            for (var index = 0; index < session.LoadedPages.Count; index++)
            {
                var page           = session.LoadedPages[index];
                var hasnextpagestr = page.HasNextPage ? "有" : "无";
                var button         = new Button
                {
                    Width    = 32,
                    Height   = 32,
                    Margin   = new Thickness(3),
                    FontSize = 16,
                    Content  = index + 1,
                    Template = (ControlTemplate)FindResource("MoeButtonControlTemplate"),
                    ToolTip  = $"最后真实页码:{page.LastRealPageIndex}\r\n" +
                               $"预加载下一页图片数量:{page.PreLoadNextPageItems.Count}\r\n" +
                               $"是否有下一页:{hasnextpagestr}"
                };
                button.Click += (sender, args) =>
                {
                    for (var i = 0; i < PagingStackPanel.Children.Count; i++)
                    {
                        var btn = (Button)PagingStackPanel.Children[i];
                        VisualStateManager.GoToState(btn, button.Equals(btn) ? "CurrentPage" : "NotCurrentPage", true);
                        if (button.Equals(btn))
                        {
                            session.CurrentPageIndex = i;
                        }
                    }

                    PagingScrollViewer.ScrollToTop();
                    LoadImages(page.ImageItems);
                    StartDownloadShowImages();
                };
                if (index == session.LoadedPages.Count - 1)
                {
                    button.Loaded += (s, a) => VisualStateManager.GoToState(button, "CurrentPage", true);
                }
                PagingStackPanel.Children.Add(button);
            }

            PagingScrollViewer.ScrollToRightEnd();
            VisualStateManager.GoToState(this, session.LoadedPages.Last().HasNextPage ? nameof(HasNextPageState) : nameof(NoNextPageState), true);
            NewPageButtonNumTextBlock.Text = $"{session.LoadedPages.Count + 1}";
        }
Exemplo n.º 24
0
        /// <summary>
        /// 切换检索文件
        /// </summary>
        /// <param name="searchSession"></param>
        public void SwitchSearchItem(SearchSession searchSession)
        {
            MyLog4Net.Container.Instance.Log.InfoFormat("VideoSearchService entering SwitchSearchItem {0}...", searchSession.SearchId);

            TaskItem <SearchSession, SearchSession> taskItem =
                new TaskItem <SearchSession, SearchSession> {
                FuncToRun = Search, Callback = OnSearchResult, Para = searchSession
            };

            m_taskRunner.AddTask(taskItem);

            MyLog4Net.Container.Instance.Log.InfoFormat("VideoSearchService leave SwitchSearchItem {0}", searchSession.SearchId);
        }
Exemplo n.º 25
0
        public bool StartSearch(SearchPara para)
        {
            if (!Framework.Environment.CheckMemeryUse())
            {
                throw new SDKCallException(0, "内存占用过大,请关闭视频播放或取消检索后再试。");
            }

            MyLog4Net.Container.Instance.Log.Info("VideoSearchService entering StartSearch ...");
            bool bRet = true;

            lock (m_SyncObjSearch)
            {
                // 先停掉当前的检索
                //if (m_SearchSession != null)
                //{
                //    Framework.Container.Instance.IVXProtocol.CloseSearchSession(m_SearchSession.SearchId);
                //    m_SearchSession = null;
                //}
                try
                {
                    CloseSearch(para.SearchType);
                }
                catch (SDKCallException ex)
                {
                    SDKCallExceptionHandler.Handle(ex, "CloseSearchSession", false);
                }

                // 放入任务队列
                SearchSession searchSession = new SearchSession(para)
                {
                };
                // 状态复位
                para.ResetSearchItemStatus();

                para.DisplayMode = Framework.Environment.GetDisplayMode(para.SearchType);

                // m_DTSearchType2SearchSession.Add(para.SearchType, searchSession);
                m_DTSearchType2InQueue[para.SearchType] = true;

                TaskItem <SearchSession, SearchSession> taskItem =
                    new TaskItem <SearchSession, SearchSession> {
                    FuncToRun = Search, Callback = OnSearchResult, Para = searchSession
                };

                MyLog4Net.Container.Instance.Log.InfoFormat("VideoSearchService: Insert task item session {0}", searchSession.GetHashCode());
                m_taskRunner.AddTask(taskItem);

                MyLog4Net.Container.Instance.Log.Info("VideoSearchService leave StartSearch");
            }
            return(bRet);
        }
Exemplo n.º 26
0
        public void AddPage(SearchSession session)
        {
            var lastPage = session.LoadedPages?.LastOrDefault();

            if (lastPage == null)
            {
                return;
            }
            AddImages(lastPage.ImageItems);
            StartDownloadShowImages();

            this.GoState(session.LoadedPages.Last().HasNextPage ? nameof(HasNextPageState) : nameof(NoNextPageState));
            NewPageButtonNumTextBlock.Text = $"{session.LoadedPages.Count + 1}";
        }
Exemplo n.º 27
0
        private SearchSession GetSearchSession(int id)
        {
            SearchSession session = null;

            foreach (KeyValuePair <SearchType, SearchSession> kv in m_DTSearchType2SearchSession)
            {
                if (kv.Value.SearchId == id)
                {
                    session = kv.Value;
                    break;
                }
            }
            return(session);
        }
Exemplo n.º 28
0
        // SEARCH CLICK
        private async void _searchQuery_KeyDown(object sender, KeyRoutedEventArgs e)
        {
            if (e.Key != VirtualKey.Enter)
            {
                return;
            }

            var query = _searchQuery.Text;

            query = Regex.Replace(query, @"\s{2,}", " "); // remove unnecessary extra spaces

            if (query.Length == 0)
            {
                return;
            }
            _searchQuery.Text = "";

            var eq = ViewModel.Searches.Where(x => x.Query.Query == query).FirstOrDefault();

            if (eq != null)
            {
                // go to existing tab
                searchPivot.SelectedItem = eq;
                ShowNotification("Query already exists.");
                return;
            }

            // add new tab
            var sq = new SearchQuery()
            {
                Query = query
            };
            var q = new SearchSession(sq);

            ViewModel.Searches.Insert(0, q);

            // select new tab
            await Task.Delay(200);

            searchPivot.SelectedItem = q;

            // save search to history (remove oldest item if over limit)
            while (ViewModel.SearchHistory.Count >= Constants.MaximumSearchHistoryEntries)
            {
                ViewModel.SearchHistory.RemoveAt(0);
            }
            ViewModel.SearchHistory.Add(q.Query.Query);

            shouldScrollDown = true;
        }
Exemplo n.º 29
0
 protected virtual void OnSessionChanged(SearchSession oldSession, SearchSession newSession)
 {
     RaisePropertyChanged("Session", oldSession, newSession);
     if (oldSession != null)
     {
         oldSession.RequestChanged -= OnSessionRequestChanged;
         oldSession.StatusChanged  -= OnSessionStatusChanged;
         newSession.QueryStarted   -= OnQueryStarted;
     }
     if (newSession != null)
     {
         newSession.RequestChanged += OnSessionRequestChanged;
         newSession.StatusChanged  += OnSessionStatusChanged;
         newSession.QueryStarted   += OnQueryStarted;
     }
 }
Exemplo n.º 30
0
        private static bool Prefix(SearchCoordinator __instance, ref bool __result, out SearchSession?session, out SearchCompletor completor)
        {
            try
            {
                SearchRequest request = __instance.SessionPipe.Request;

                SearchingPickupEventArgs ev = new(Player.Get(__instance.Hub), request.Target, request.Body, SearchCompletor.FromPickup(__instance, request.Target, __instance.ServerMaxRayDistanceSqr), request.Target.SearchTimeForPlayer(__instance.Hub));
                Handlers.Player.OnSearchPickupRequest(ev);

                completor = ev.SearchCompletor;
                if (!ev.IsAllowed)
                {
                    session   = null;
                    completor = null;
                    __result  = true;
                    return(false);
                }

                SearchSession body = ev.SearchSession;
                if (!__instance.isLocalPlayer)
                {
                    double num        = NetworkTime.time - request.InitialTime;
                    double num2       = LiteNetLib4MirrorServer.Peers[__instance.connectionToClient.connectionId].Ping * 0.001 * __instance.serverDelayThreshold;
                    float  searchTime = ev.SearchTime;
                    if (num < 0.0 || num2 < num)
                    {
                        body.InitialTime = NetworkTime.time - num2;
                        body.FinishTime  = body.InitialTime + searchTime;
                    }
                    else if (Math.Abs(body.FinishTime - body.InitialTime - searchTime) > 0.001)
                    {
                        body.FinishTime = body.InitialTime + searchTime;
                    }
                }

                session  = body;
                __result = true;
                return(false);
            }
            catch (Exception exception)
            {
                Log.Error($"{typeof(SearchingPickupEvent).FullName}.{nameof(Prefix)}:\n{exception}");
                session   = null;
                completor = null;
                return(true);
            }
        }