Example #1
0
        public static void EncodeStorage(Character chr, StorageEncode enc, StorageEncodeFlags flags)
        {
            Packet packet = new Packet(ServerMessages.STORAGE_RESULT);

            packet.WriteByte((byte)enc);
            EncodeStorage(chr, packet, flags);
            chr.SendPacket(packet);
        }
Example #2
0
        private static void EncodeStorage(Character chr, Packet packet, StorageEncodeFlags flags)
        {
            packet.WriteByte(chr.Storage.MaxSlots);

            packet.WriteShort((short)flags);

            if (flags.HasFlag(StorageEncodeFlags.EncodeMesos))
            {
                packet.WriteInt(chr.Storage.Mesos);
            }

            for (byte i = 1; i <= 5; i++)
            {
                StorageEncodeFlags flag = GetEncodeFlagForInventory(i);
                if (flags.HasFlag(flag))
                {
                    AddInvItems(chr, packet, i);
                }
            }
        }