Exemplo n.º 1
0
        private StoreCategory ReadStoreCategory(Internal.CommunicationStream message)
        {
            string name;
            string description = null;
            StoreHighlightState highlightState = StoreHighlightState.None;

            name = message.ReadString();
            if (OpenTibiaUnity.GameManager.ClientVersion < 1180)
            {
                description = message.ReadString();
            }

            if (OpenTibiaUnity.GameManager.GetFeature(GameFeature.GameIngameStoreHighlights))
            {
                highlightState = message.ReadEnum <StoreHighlightState>();
            }

            var category = new StoreCategory(name, description, highlightState);

            int iconCount = message.ReadUnsignedByte();

            for (int i = 0; i < iconCount; i++)
            {
                category.AddIcon(message.ReadString());
            }

            return(category);
        }
Exemplo n.º 2
0
 private void ReadCyclopediaCharacterInfoBaseInformation(Internal.CommunicationStream message)
 {
     string characterName = message.ReadString();
     string vocation      = message.ReadString();
     ushort level         = message.ReadUnsignedShort();
     var    outfit        = ProtocolGameExtentions.ReadCreatureOutfit(message);
 }
Exemplo n.º 3
0
        private void ParseMonsterCyclopediaBonusEffects(Internal.CommunicationStream message)
        {
            int charmPoints = message.ReadInt();

            int count = message.ReadUnsignedByte();

            for (int i = 0; i < count; i++)
            {
                int    charmType        = message.ReadUnsignedByte();
                string charmName        = message.ReadString();
                string charmDescription = message.ReadString();

                byte   unknown2 = message.ReadUnsignedByte(); // valid values: 0, 1, 2 (likely to be agressive/defensive/passive)
                ushort price    = message.ReadUnsignedShort();

                bool unlocked  = message.ReadBoolean();
                bool activated = message.ReadBoolean();
                if (activated)
                {
                    ushort selectedCreature = message.ReadUnsignedShort(); // raceID
                    uint   clearPrice       = message.ReadUnsignedInt();
                }
            }

            byte remainingNumberOfAssignableBonusEffects = message.ReadUnsignedByte();
            bool hasCharmExpansion = remainingNumberOfAssignableBonusEffects == 255;

            // selectable race ids
            count = message.ReadUnsignedShort();
            for (int i = 0; i < count; i++)
            {
                ushort raceID = message.ReadUnsignedShort();
            }
        }
Exemplo n.º 4
0
        private void ParseShowModalDialog(Internal.CommunicationStream message)
        {
            uint   windowId      = message.ReadUnsignedInt();
            string title         = message.ReadString();
            string windowMessage = message.ReadString();

            byte buttonCount = message.ReadUnsignedByte();

            for (int i = 0; i < buttonCount; i++)
            {
                string buttonText = message.ReadString();
                byte   buttonId   = message.ReadUnsignedByte();
            }

            byte choiceCount = message.ReadUnsignedByte();

            for (int i = 0; i < choiceCount; i++)
            {
                string choiceText = message.ReadString();
                byte   choiceId   = message.ReadUnsignedByte();
            }

            byte defaultEscapeButtonId = message.ReadUnsignedByte();
            byte defaultEnterButtonId  = message.ReadUnsignedByte();
            bool priority = message.ReadBoolean();
        }
Exemplo n.º 5
0
        public StoreOffer ReadExtendedStoreOffer(Internal.CommunicationStream message)
        {
            string name       = message.ReadString();
            var    storeOffer = new StoreOffer(name, null);

            byte quantityCount = message.ReadUnsignedByte();

            for (int i = 0; i < quantityCount; i++)
            {
                storeOffer.AddQuantityConfiguration(ReadStoreOfferQuantityConfiguration(message));
            }

            storeOffer.AddVisualisation(ReadStoreVisualisation(message));

            if (OpenTibiaUnity.GameManager.ClientVersion >= 1212)
            {
                message.ReadUnsignedByte(); // enum (0, 1, 2)
            }

            storeOffer.Filter = message.ReadString();

            storeOffer.TimeAddedToStore      = message.ReadUnsignedInt();
            storeOffer.TimesBought           = message.ReadUnsignedShort();
            storeOffer.RequiresConfiguration = message.ReadBoolean();

            ushort productCount = message.ReadUnsignedShort();

            for (int i = 0; i < productCount; i++)
            {
                storeOffer.AddProduct(ReadStoreProduct(message));
            }
            return(storeOffer);
        }
Exemplo n.º 6
0
        private void ParseOpenOwnChannel(Internal.CommunicationStream message)
        {
            int    channelId   = message.ReadUnsignedShort();
            string channelName = message.ReadString();
            var    channel     = ChatStorage.AddChannel(channelId, channelName, MessageModeType.Channel);

            channel.CanModerate = true;

            if (channel.IsPrivate)
            {
                ChatStorage.OwnPrivateChannelId = channelId;
            }

            if (OpenTibiaUnity.GameManager.GetFeature(GameFeature.GameChannelPlayerList))
            {
                int joinedUsers = message.ReadUnsignedShort();
                for (int i = 0; i < joinedUsers; i++)
                {
                    channel.PlayerJoined(message.ReadString());
                }

                int invitedUsers = message.ReadUnsignedShort();
                for (int i = 0; i < invitedUsers; i++)
                {
                    channel.PlayerInvited(message.ReadString());
                }
            }
        }
Exemplo n.º 7
0
        public StoreCategoryAndFilter ReadStoreCategoryAndFilter(Internal.CommunicationStream message)
        {
            string category = message.ReadString();
            string filter   = message.ReadString();

            return(new StoreCategoryAndFilter(category, filter));
        }
Exemplo n.º 8
0
        private void ParseBuddyAdd(Internal.CommunicationStream message)
        {
            uint   creatureId  = message.ReadUnsignedInt();
            string name        = message.ReadString();
            string desc        = string.Empty;
            uint   icon        = 0;
            bool   notifyLogin = false;

            if (OpenTibiaUnity.GameManager.GetFeature(GameFeature.GameAdditionalVipInfo))
            {
                desc        = message.ReadString();
                icon        = message.ReadUnsignedInt();
                notifyLogin = message.ReadBoolean();
            }

            byte        status = message.ReadUnsignedByte();
            List <byte> groups;

            if (OpenTibiaUnity.GameManager.GetFeature(GameFeature.GameBuddyGroups))
            {
                int count = message.ReadUnsignedByte();
                groups = new List <byte>(count);
                for (int i = 0; i < count; i++)
                {
                    groups.Add(message.ReadUnsignedByte());
                }
            }
        }
Exemplo n.º 9
0
        private void ParsePreyData(Internal.CommunicationStream message)
        {
            int slot  = message.ReadUnsignedByte();
            var state = message.ReadEnum <PreySlotStates>();

            switch (state)
            {
            case PreySlotStates.Locked: {
                message.ReadEnum <PreySlotUnlockType>();
                break;
            }

            case PreySlotStates.Inactive: {
                break;
            }

            case PreySlotStates.Active: {
                string monsterName   = message.ReadString();
                var    monsterOutfit = ProtocolGameExtentions.ReadCreatureOutfit(message);
                var    bonusType     = message.ReadEnum <PreyBonusTypes>();
                int    bonusValue    = message.ReadUnsignedShort();
                int    bonusGrade    = message.ReadUnsignedByte();
                int    timeLeft      = message.ReadUnsignedShort();
                break;
            }

            case PreySlotStates.Selection: {
                byte size = message.ReadUnsignedByte();
                for (int i = 0; i < size; i++)
                {
                    string monsterName   = message.ReadString();
                    var    monsterOutfit = ProtocolGameExtentions.ReadCreatureOutfit(message);
                }
                break;
            }

            case PreySlotStates.SelectionChangeMonster: {
                var  bonusType  = message.ReadEnum <PreyBonusTypes>();
                int  bonusValue = message.ReadUnsignedShort();
                int  bonusGrade = message.ReadUnsignedByte();
                byte size       = message.ReadUnsignedByte();
                for (int i = 0; i < size; i++)
                {
                    string monsterName   = message.ReadString();
                    var    monsterOutfit = ProtocolGameExtentions.ReadCreatureOutfit(message);
                }
                break;
            }

            default:
                break;
            }

            message.ReadUnsignedShort(); // timeUntilFreeListReroll
            if (OpenTibiaUnity.GameManager.ClientVersion >= 1190)
            {
                message.ReadUnsignedByte(); // preyWildCards
            }
        }
Exemplo n.º 10
0
        public StoreOffer ReadLegacyStoreOffer(Internal.CommunicationStream message)
        {
            bool supportsHighlighting = OpenTibiaUnity.GameManager.GetFeature(GameFeature.GameIngameStoreHighlights);

            uint   offerId          = message.ReadUnsignedInt();
            string offerName        = message.ReadString();
            string offerDescription = message.ReadString();
            var    storeOffer       = new StoreOffer(offerName, offerDescription);

            uint price = message.ReadUnsignedInt();
            var  highlightState = message.ReadEnum <StoreHighlightState>();
            uint saleValidUntil = 0, saleBasePrice = 0;

            if (highlightState == StoreHighlightState.Sale && supportsHighlighting && OpenTibiaUnity.GameManager.ClientVersion >= 1097)
            {
                saleValidUntil = message.ReadUnsignedInt();
                saleBasePrice  = message.ReadUnsignedInt();
            }

            var    disabledState  = message.ReadEnum <StoreOfferDisableState>();
            string disabledReason = string.Empty;

            if (supportsHighlighting && disabledState == StoreOfferDisableState.Disabled)
            {
                disabledReason = message.ReadString();
            }

            var quantityConfiguration = new StoreOfferQuantityConfiguration(offerId, price, 1, highlightState, false);

            quantityConfiguration.DisabledState = disabledState;
            if (disabledState == StoreOfferDisableState.Disabled)
            {
                quantityConfiguration.DisabledReasons.Add(disabledReason);
            }

            if (highlightState == StoreHighlightState.Sale && supportsHighlighting && OpenTibiaUnity.GameManager.ClientVersion >= 1097)
            {
                quantityConfiguration.SetSaleParameters(saleValidUntil, saleBasePrice);
            }

            storeOffer.AddQuantityConfiguration(quantityConfiguration);

            int iconCount = message.ReadUnsignedByte();

            for (int i = 0; i < iconCount; i++)
            {
                storeOffer.AddVisualisation(new Store.Visualisations.StoreIconVisualisation(message.ReadString()));
            }

            int productCount = message.ReadUnsignedShort();

            for (int i = 0; i < productCount; i++)
            {
                storeOffer.AddProduct(ReadStoreProduct(message));
            }

            return(storeOffer);
        }
Exemplo n.º 11
0
        private void ParseStoreOffers(Internal.CommunicationStream message)
        {
            var    gameManager  = OpenTibiaUnity.GameManager;
            string categoryName = message.ReadString();

            if (gameManager.ClientVersion >= 1180)
            {
                uint selectedOfferId = message.ReadUnsignedInt();
                var  sortType        = message.ReadEnum <StoreOfferSortType>();
                int  filterCount     = message.ReadUnsignedByte();
                for (int i = 0; i < filterCount; i++)
                {
                    string filter = message.ReadString();
                }

                if (gameManager.ClientVersion >= 1185)
                {
                    // if a filter is not included, then if "Show all" is not selected
                    // the offer will be hidden until then..
                    // if the offer has no filter, then this value won't affect it

                    int shownFiltersCount = message.ReadUnsignedShort();
                    for (int i = 0; i < shownFiltersCount; i++)
                    {
                        int filterIndex = message.ReadUnsignedByte();
                    }
                }
            }

            var storeCategory = OpenTibiaUnity.StoreStorage.FindCategory(categoryName);

            int offerCount = message.ReadUnsignedShort();

            for (int i = 0; i < offerCount; i++)
            {
                var offer = ReadStoreOffer(message);

                // server may be sending information about non-existant category
                if (storeCategory != null)
                {
                    storeCategory.AddOffer(offer);
                }
            }

            if (gameManager.ClientVersion >= 1180 && categoryName == Constants.StoreHomeCategoryName)
            {
                byte featuredOfferCount = message.ReadUnsignedByte();
                for (int i = 0; i < featuredOfferCount; i++)
                {
                    var storeFeaturedOffer = ReadStoreFeaturedOffer(message);
                }

                byte unknown = message.ReadUnsignedByte();
            }
        }
Exemplo n.º 12
0
        private void ParseNPCOffer(Internal.CommunicationStream message)
        {
            string npcName = null;

            if (OpenTibiaUnity.GameManager.GetFeature(GameFeature.GameNameOnNpcTrade))
            {
                npcName = message.ReadString();
            }

            var buyObjects  = new List <Trade.TradeObjectRef>();
            var sellObjects = new List <Trade.TradeObjectRef>();

            ushort currencyObjectId = 0;

            if (OpenTibiaUnity.GameManager.ClientVersion >= 1203)
            {
                currencyObjectId = message.ReadUnsignedShort();
            }

            int listCount;

            if (OpenTibiaUnity.GameManager.ClientVersion >= 900)
            {
                listCount = message.ReadUnsignedShort();
            }
            else
            {
                listCount = message.ReadUnsignedByte();
            }

            for (int i = 0; i < listCount; i++)
            {
                ushort objectId   = message.ReadUnsignedShort();
                ushort objectData = message.ReadUnsignedByte();

                string name      = message.ReadString();
                uint   weight    = message.ReadUnsignedInt();
                uint   buyPrice  = message.ReadUnsignedInt();
                uint   sellPrice = message.ReadUnsignedInt();

                if (buyPrice > 0)
                {
                    buyObjects.Add(new Trade.TradeObjectRef(objectId, objectData, name, buyPrice, weight));
                }

                if (sellPrice > 0)
                {
                    sellObjects.Add(new Trade.TradeObjectRef(objectId, objectData, name, sellPrice, weight));
                }
            }

            OpenTibiaUnity.GameManager.onRequestNPCTrade.Invoke(npcName, buyObjects, sellObjects);
        }
Exemplo n.º 13
0
        public StoreFeaturedOffer ReadStoreFeaturedOffer(Internal.CommunicationStream message)
        {
            string icon           = message.ReadString();
            var    openParameters = ReadStoreOpenParameters(message);

            return(new StoreFeaturedOffer(icon, openParameters));
        }
Exemplo n.º 14
0
        private void ParseLoginWait(Internal.CommunicationStream message)
        {
            string waitMessage = message.ReadString();
            int    waitTime    = message.ReadUnsignedByte();

            onLoginWait.Invoke(waitMessage, waitTime);
        }
Exemplo n.º 15
0
        public StoreVisualisation ReadStoreVisualisation(Internal.CommunicationStream message)
        {
            var appearanceType = message.ReadEnum <StoreOfferAppearanceType>();

            switch (appearanceType)
            {
            case StoreOfferAppearanceType.Icon: {
                string icon = message.ReadString();
                return(new Store.Visualisations.StoreIconVisualisation(icon));
            }

            case StoreOfferAppearanceType.Mount: {
                ushort outfitId = message.ReadUnsignedShort();
                return(new Store.Visualisations.StoreMountVisualisation(outfitId));
            }

            case StoreOfferAppearanceType.Outfit: {
                ushort outfitId = message.ReadUnsignedShort();
                byte   head     = message.ReadUnsignedByte();
                byte   body     = message.ReadUnsignedByte();
                byte   legs     = message.ReadUnsignedByte();
                byte   feet     = message.ReadUnsignedByte();
                return(new Store.Visualisations.StoreOutfitVisualisation(outfitId, head, body, legs, feet));
            }

            case StoreOfferAppearanceType.Object: {
                ushort objectId = message.ReadUnsignedShort();
                return(new Store.Visualisations.StoreObjectVisualisation(objectId));
            }
            }

            return(null);
        }
Exemplo n.º 16
0
        private void ParseStoreCategories(Internal.CommunicationStream message)
        {
            if (OpenTibiaUnity.GameManager.ClientVersion < 1180)
            {
                ParseCreditBalance(message);
            }

            OpenTibiaUnity.StoreStorage.ClearCategories();

            int categoryCount = message.ReadUnsignedShort();

            for (int i = 0; i < categoryCount; i++)
            {
                var    storeCategory      = ReadStoreCategory(message);
                string parentCategoryName = message.ReadString();
                if (parentCategoryName.Length != 0)
                {
                    var parentCategory = OpenTibiaUnity.StoreStorage.FindCategory(parentCategoryName);
                    if (parentCategory != null)
                    {
                        parentCategory.AddSubCategory(storeCategory);
                    }
                }
                else
                {
                    OpenTibiaUnity.StoreStorage.AddCategory(storeCategory);
                }
            }
        }
Exemplo n.º 17
0
        public StoreOpenParameters ReadStoreOpenParameters(Internal.CommunicationStream message)
        {
            var openAction = message.ReadEnum <StoreOpenParameterAction>();

            Store.OpenParameters.IStoreOpenParamater openParam = null;
            switch (openAction)
            {
            case StoreOpenParameterAction.Invalid:
            {
                break;
            }

            case StoreOpenParameterAction.CategoryType:
            {
                var categoryType = message.ReadEnum <StoreCategoryType>();
                openParam = new Store.OpenParameters.StoreCategoryTypeOpenParamater(categoryType);
                break;
            }

            case StoreOpenParameterAction.CategoryAndFilter:
            {
                var categoryAndFilter = ReadStoreCategoryAndFilter(message);
                openParam = new Store.OpenParameters.StoreCategoryAndFilterOpenParamater(categoryAndFilter);
                break;
            }

            case StoreOpenParameterAction.OfferType:
            {
                var offerType = message.ReadEnum <StoreOfferType>();
                openParam = new Store.OpenParameters.StoreOfferTypeOpenParamater(offerType);
                break;
            }

            case StoreOpenParameterAction.OfferId:
            {
                var offerId = message.ReadUnsignedInt();
                openParam = new Store.OpenParameters.StoreOfferIdOpenParamater(offerId);
                break;
            }

            case StoreOpenParameterAction.CategoryName:
            {
                var categoryName = message.ReadString();
                openParam = new Store.OpenParameters.StoreCategoryNameOpenParamater(categoryName);
                break;
            }
            }

            // enum too, 0, 1, 2, 3
            message.ReadUnsignedByte();

            /**
             * 0: default
             * 1: home
             * // 2, 3?
             */
            message.ReadBoolean(); // 0, 1, 2, 3 (enum)
            return(new StoreOpenParameters(openAction, openParam));
        }
Exemplo n.º 18
0
        private void ParseTextEffect(Internal.CommunicationStream message)
        {
            var    position = message.ReadPosition();
            int    color    = message.ReadUnsignedByte();
            string text     = message.ReadString();

            WorldMapStorage.AddTextualEffect(position, color, text);
        }
Exemplo n.º 19
0
        private void ParseOpenContainer(Internal.CommunicationStream message)
        {
            byte   containerId     = message.ReadUnsignedByte();
            var    objectIcon      = ProtocolGameExtentions.ReadObjectInstance(message);
            string name            = message.ReadString();
            byte   nOfSlotsPerPage = message.ReadUnsignedByte(); // capacity of shown view
            bool   isSubContainer  = message.ReadBoolean();

            bool canUseDepotSearch    = false;
            bool isDragAndDropEnabled = true;
            bool isPaginationEnabled  = false;
            int  nOfTotalObjects;
            int  indexOfFirstObject = 0;
            int  nOfContentObjects; // objects in the current shown view //

            if (OpenTibiaUnity.GameManager.GetFeature(GameFeature.GameContainerPagination))
            {
                if (OpenTibiaUnity.GameManager.ClientVersion >= 1220)
                {
                    canUseDepotSearch = message.ReadBoolean();
                }

                isDragAndDropEnabled = message.ReadBoolean();
                isPaginationEnabled  = message.ReadBoolean();
                nOfTotalObjects      = message.ReadUnsignedShort();
                indexOfFirstObject   = message.ReadUnsignedShort();
                nOfContentObjects    = message.ReadUnsignedByte();

                if (nOfContentObjects > nOfSlotsPerPage)
                {
                    throw new System.Exception("ProtocolGame.ParseOpenContainer: Number of content objects " + nOfContentObjects + " exceeds number of slots per page " + nOfSlotsPerPage);
                }

                if (nOfContentObjects > nOfTotalObjects)
                {
                    throw new System.Exception("ProtocolGame.ParseOpenContainer: Number of content objects " + nOfContentObjects + " exceeds number of total objects " + nOfTotalObjects);
                }
            }
            else
            {
                nOfContentObjects = message.ReadUnsignedByte();
                nOfTotalObjects   = nOfContentObjects;

                if (nOfContentObjects > nOfSlotsPerPage)
                {
                    throw new System.Exception("ProtocolGame.ParseOpenContainer: Number of content objects " + nOfContentObjects + " exceeds the capaciy " + nOfSlotsPerPage);
                }
            }

            var containerView = ContainerStorage.CreateContainerView(containerId, objectIcon, name, isSubContainer,
                                                                     isDragAndDropEnabled, isPaginationEnabled, nOfSlotsPerPage,
                                                                     nOfTotalObjects - nOfContentObjects, indexOfFirstObject, nOfContentObjects);

            for (int i = 0; i < nOfContentObjects; i++)
            {
                containerView.AddObject(indexOfFirstObject + i, ProtocolGameExtentions.ReadObjectInstance(message));
            }
        }
Exemplo n.º 20
0
        private void ReadCyclopediaCharacterInfoRecentDeaths(Internal.CommunicationStream message)
        {
            ushort count = message.ReadUnsignedShort();

            for (int i = 0; i < count; i++)
            {
                uint   time  = message.ReadUnsignedInt();
                string cause = message.ReadString();
            }
        }
Exemplo n.º 21
0
        private void ParseShowModalDialog(Internal.CommunicationStream message)
        {
            var modalDialog = new ProtocolModalDialog();

            modalDialog.Id      = message.ReadUnsignedInt();
            modalDialog.Title   = message.ReadString();
            modalDialog.Message = message.ReadString();

            byte buttonCount = message.ReadUnsignedByte();

            modalDialog.Buttons = new ProtocolModalDialogEntity[buttonCount];
            for (int i = 0; i < buttonCount; i++)
            {
                string text = message.ReadString();
                byte   id   = message.ReadUnsignedByte();
                modalDialog.Buttons[i] = new ProtocolModalDialogEntity()
                {
                    Id   = id,
                    Text = text
                };
            }

            byte choiceCount = message.ReadUnsignedByte();

            modalDialog.Choices = new ProtocolModalDialogEntity[choiceCount];
            for (int i = 0; i < choiceCount; i++)
            {
                string text = message.ReadString();
                byte   id   = message.ReadUnsignedByte();
                modalDialog.Choices[i] = new ProtocolModalDialogEntity()
                {
                    Id   = id,
                    Text = text
                };
            }

            modalDialog.DefaultEnterButton  = message.ReadUnsignedByte();
            modalDialog.DefaultEscapeButton = message.ReadUnsignedByte();
            modalDialog.Priority            = message.ReadBoolean();

            OpenTibiaUnity.GameManager.onRequestModalDialog.Invoke(modalDialog);
        }
Exemplo n.º 22
0
        private void ReadCyclopediaCharacterInfoRecentPvpKills(Internal.CommunicationStream message)
        {
            ushort count = message.ReadUnsignedShort();

            for (int i = 0; i < count; i++)
            {
                uint   time        = message.ReadUnsignedInt();
                string description = message.ReadString();
                var    status      = message.ReadEnum <CyclopediaPvpKillStatus>();
            }
        }
Exemplo n.º 23
0
        public void ParseKillTracking(Internal.CommunicationStream message)
        {
            string name      = message.ReadString();
            var    outfit    = ProtocolGameExtentions.ReadCreatureOutfit(message);
            int    lootCount = message.ReadUnsignedByte();

            for (int i = 0; i < lootCount; i++)
            {
                var @object = ProtocolGameExtentions.ReadObjectInstance(message);
            }
        }
Exemplo n.º 24
0
        private void ParseObjectInfo(Internal.CommunicationStream message)
        {
            int objectCount = message.ReadUnsignedByte();

            for (int i = 0; i < objectCount; i++)
            {
                ushort objectId = message.ReadUnsignedShort();
                byte   data     = message.ReadUnsignedByte();
                string name     = message.ReadString();
            }
        }
Exemplo n.º 25
0
        private void ReadCyclopediaCharacterInfoAchievements(Internal.CommunicationStream message)
        {
            ushort totalPoints             = message.ReadUnsignedShort();
            ushort totalSecretAchievements = message.ReadUnsignedShort();

            ushort obtainedAchievements = message.ReadUnsignedShort();

            for (int i = 0; i < obtainedAchievements; i++)
            {
                ushort achievementID = message.ReadUnsignedShort();
                uint   time          = message.ReadUnsignedInt();
                bool   secret        = message.ReadBoolean();
                if (secret)
                {
                    string name        = message.ReadString();
                    string description = message.ReadString();
                    int    grade       = message.ReadUnsignedByte();
                }
            }
        }
Exemplo n.º 26
0
        private void ParseInspectionList(Internal.CommunicationStream message)
        {
            bool isPlayer = message.ReadBoolean();

            int size = message.ReadUnsignedByte();

            for (int i = 0; i < size; i++)
            {
                var @object = ReadObjectInstance(message);
                if (isPlayer)
                {
                    var slot = message.ReadEnum <ClothSlots>();
                }

                int imbuementSlots = message.ReadUnsignedByte();
                for (int j = 0; j < imbuementSlots; j++)
                {
                    int imbuementId = message.ReadUnsignedByte();
                }

                int details = message.ReadUnsignedByte();
                for (int j = 0; j < details; j++)
                {
                    string name        = message.ReadString();
                    string description = message.ReadString();
                }
            }

            if (isPlayer)
            {
                string playerName = message.ReadString();
                var    outfit     = ReadCreatureOutfit(message);

                int details = message.ReadUnsignedByte();
                for (int j = 0; j < details; j++)
                {
                    string name        = message.ReadString();
                    string description = message.ReadString();
                }
            }
        }
Exemplo n.º 27
0
        private void ParseChannels(Internal.CommunicationStream message)
        {
            int count = message.ReadUnsignedByte();
            List <Chat.Channel> channels = new List <Chat.Channel>();

            for (int i = 0; i < count; i++)
            {
                int    id   = message.ReadUnsignedShort();
                string name = message.ReadString();
                channels.Add(new Chat.Channel(id, name, MessageModeType.None));
            }
        }
Exemplo n.º 28
0
        private void ParseMonsterCyclopedia(Internal.CommunicationStream message)
        {
            int count = message.ReadUnsignedShort();

            for (int i = 0; i < count; i++)
            {
                string classification = message.ReadString();

                uint total = message.ReadUnsignedShort();
                uint known = message.ReadUnsignedShort();
            }
        }
Exemplo n.º 29
0
        private void ParseDailyRewardHistory(Internal.CommunicationStream message)
        {
            int count = message.ReadUnsignedByte();

            for (int i = 0; i < count; i++)
            {
                var timestamp = message.ReadUnsignedInt(); // timestamp
                message.ReadUnsignedByte();                // some state (0: none, 1: active[green])
                message.ReadString();                      // description
                message.ReadUnsignedShort();               // streak
            }
        }
Exemplo n.º 30
0
        private void ParseBuddyGroupData(Internal.CommunicationStream message)
        {
            int groups = message.ReadUnsignedByte();

            for (int i = 0; i < groups; i++)
            {
                message.ReadUnsignedByte(); // id
                message.ReadString();       // name
                message.ReadUnsignedByte(); // idk
            }

            message.ReadUnsignedByte(); // premium/free iirc (since free players are allowed only for 5 groups)
        }