Esempio n. 1
0
        public async Task HandleAsync(
            ISession session,
            IClientPacket clientPacket)
        {
            string category = clientPacket.ReadString();
            string data     = clientPacket.ReadString();

            //Send the categories..
            if (string.IsNullOrEmpty(data))
            {
                IList <INavigatorCategory> categories =
                    await _navigatorController.GetNavigatorCategoriesAsync();

                IList <INavigatorCategory> categoriesToSend = new List <INavigatorCategory>();

                foreach (INavigatorCategory navCategory in categories)
                {
                    if (navCategory.Category == category)
                    {
                        categoriesToSend.Add(navCategory);
                    }
                }

                await session.WriteAndFlushAsync(
                    new NavigatorSearchResultSetComposer(category, data, categoriesToSend));
            }
        }
        public async Task HandleAsync(
            ISession session,
            IClientPacket clientPacket)
        {
            IList <INavigatorCategory> categories =
                await _navigatorController.GetNavigatorCategoriesAsync();

            await session.WriteAndFlushAsync(new UserFlatCatsComposer(categories, session.Player.Rank));
        }