Пример #1
0
        /// <summary>
        ///     Decodes this instance.
        /// </summary>
        public void Decode(ByteStream Stream)
        {
            int Count = Stream.ReadVInt();

            if (Count != 8)
            {
                Logging.Error(this.GetType(), "Invalid commodity count. Received commodity count:" + Count + ", server commodity count:" + 8);
            }

            for (int I = 0; I < 8; I++)
            {
                for (int J = Stream.ReadVInt(); J > 0; J--)
                {
                    DataSlot DataSlot = new DataSlot();
                    DataSlot.Decode(Stream);
                    this.Slots[I].Add(DataSlot);
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Decodes this instance.
        /// </summary>
        internal void Decode(ByteStream Packet)
        {
            int Count = Packet.ReadVInt();

            if (Count != 8)
            {
                Logging.Error(this.GetType(), "Invalid commodity count. Received commodity count:" + Count + ", server commodity count:" + 8);
            }

            for (int i = 0; i < 8; i++)
            {
                for (int j = Packet.ReadVInt(); j > 0; j--)
                {
                    DataSlot DataSlot = new DataSlot();
                    DataSlot.Decode(Packet);
                    this.Slots[i].Add(DataSlot);
                }
            }
        }