コード例 #1
0
        public static HItem[] Parse(HPacket packet)
        {
            packet.ReadInt32();
            packet.ReadInt32();
            var items = new HItem[packet.ReadInt32()];

            for (int i = 0; i < items.Length; i++)
            {
                items[i] = new HItem(packet);
            }
            return(items);
        }
コード例 #2
0
ファイル: HItem.cs プロジェクト: ger88555/Tanji
        public static HItem[] Parse(HMessage packet)
        {
            int loc1 = packet.ReadInteger();
            int loc2 = packet.ReadInteger();

            var items = new HItem[packet.ReadInteger()];

            for (int i = 0; i < items.Length; i++)
            {
                items[i] = new HItem(packet);
            }
            return(items);
        }
コード例 #3
0
ファイル: HItem.cs プロジェクト: SirJamal/Sulakore
        public static IReadOnlyList<HItem> Parse(HMessage packet)
        {
            packet.ReadInteger();
            packet.ReadInteger();

            int itemCount = packet.ReadInteger();
            var itemList = new List<HItem>(itemCount);

            for (int i = 0; i < itemList.Capacity; i++)
            {
                packet.ReadInteger();
                string s1 = packet.ReadString();

                int id = packet.ReadInteger();
                int typeId = packet.ReadInteger();
                packet.ReadInteger();

                int category = packet.ReadInteger();
                HStuffData.ReadStuffData(category, packet);

                packet.ReadBoolean();
                packet.ReadBoolean();
                packet.ReadBoolean();
                packet.ReadBoolean();
                int secondsToExpiration = packet.ReadInteger();

                bool hasRentPeriodStarted = packet.ReadBoolean();
                int roomId = packet.ReadInteger();

                var item = new HItem(id, typeId, category,
                    secondsToExpiration, hasRentPeriodStarted, roomId);

                if (s1 == "S")
                {
                    item.SlotId = packet.ReadString();
                    packet.ReadInteger();
                }
                itemList.Add(item);
            }
            return itemList;
        }
コード例 #4
0
ファイル: HItem.cs プロジェクト: proxymoron/Sulakore
        public static IReadOnlyList <HItem> Parse(HMessage packet)
        {
            packet.ReadInteger();
            packet.ReadInteger();

            int itemCount = packet.ReadInteger();
            var itemList  = new List <HItem>(itemCount);

            for (int i = 0; i < itemList.Capacity; i++)
            {
                packet.ReadInteger();
                string s1 = packet.ReadString();

                int id     = packet.ReadInteger();
                int typeId = packet.ReadInteger();
                packet.ReadInteger();

                int category = packet.ReadInteger();
                HStuffData.ReadStuffData(category, packet);

                packet.ReadBoolean();
                packet.ReadBoolean();
                packet.ReadBoolean();
                packet.ReadBoolean();
                int secondsToExpiration = packet.ReadInteger();

                bool hasRentPeriodStarted = packet.ReadBoolean();
                int  roomId = packet.ReadInteger();

                var item = new HItem(id, typeId, category,
                                     secondsToExpiration, hasRentPeriodStarted, roomId);

                if (s1 == "S")
                {
                    item.SlotId = packet.ReadString();
                    packet.ReadInteger();
                }
                itemList.Add(item);
            }
            return(itemList);
        }