Inheritance: Server.BinaryFileWriter
Exemplo n.º 1
0
        private void OnSerialized(ConsumableEntry entry)
        {
            ISerializable      value  = entry.value;
            BinaryMemoryWriter writer = entry.writer;

            Item item = value as Item;

            if (item != null)
            {
                Save(item, writer);
            }
            else
            {
                Mobile mob = value as Mobile;

                if (mob != null)
                {
                    Save(mob, writer);
                }
                else
                {
                    BaseGuild guild = value as BaseGuild;

                    if (guild != null)
                    {
                        Save(guild, writer);
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void Save(BaseGuild guild, BinaryMemoryWriter writer)
        {
            int length = writer.CommitTo(guildData, guildIndex, 0, guild.Id);

            if (metrics != null)
            {
                metrics.OnGuildSaved(length);
            }
        }
Exemplo n.º 3
0
        private void Save(Mobile mob, BinaryMemoryWriter writer)
        {
            int length = writer.CommitTo(mobileData, mobileIndex, mob.m_TypeRef, mob.Serial);

            if (metrics != null)
            {
                metrics.OnMobileSaved(length);
            }
        }
Exemplo n.º 4
0
        private void Save(Item item, BinaryMemoryWriter writer)
        {
            writer.CommitTo(itemData, itemIndex, item.m_TypeRef, item.Serial);

            if (item.Decays && item.Parent == null && item.Map != Map.Internal && DateTime.UtcNow > (item.LastMoved + item.DecayTime))
            {
                _decayQueue.Enqueue(item);
            }
        }
Exemplo n.º 5
0
        private void Save(SaveData data, BinaryMemoryWriter writer)
        {
            int length = writer.CommitTo(customData, customIndex, data._TypeID, data.Serial);

            if (metrics != null)
            {
                metrics.OnDataSaved(length);
            }
        }
Exemplo n.º 6
0
        private void Save(BaseInstanceMap map, BinaryMemoryWriter writer)
        {
            int length = writer.CommitTo(mapData, mapIndex, map.m_TypeRef, map.Serial);

            if (metrics != null)
            {
                metrics.OnMapSaved(length);
            }

            if (map.Decays)
            {
                _decayMapQueue.Enqueue(map);
            }
        }
Exemplo n.º 7
0
        private void Save(Item item, BinaryMemoryWriter writer)
        {
            int length = writer.CommitTo(itemData, itemIndex, item.m_TypeRef, item.Serial);

            if (metrics != null)
            {
                metrics.OnItemSaved(length);
            }

            if (item.Decays && item.Parent == null && item.Map != Map.Internal && DateTime.Now > (item.LastMoved + item.DecayTime))
            {
                _decayQueue.Enqueue(item);
            }
        }
Exemplo n.º 8
0
        private void OnSerialized(ConsumableEntry entry)
        {
            ISerializable      value  = entry.value;
            BinaryMemoryWriter writer = entry.writer;

            if (value is Item item)
            {
                Save(item, writer);
            }
            else if (value is Mobile mob)
            {
                Save(mob, writer);
            }
            else if (value is BaseGuild guild)
            {
                Save(guild, writer);
            }
        }
Exemplo n.º 9
0
 private void Save(BaseGuild guild, BinaryMemoryWriter writer)
 {
     writer.CommitTo(guildData, guildIndex, 0, guild.Id);
 }
Exemplo n.º 10
0
 private void Save(Mobile mob, BinaryMemoryWriter writer)
 {
     writer.CommitTo(mobileData, mobileIndex, mob.m_TypeRef, mob.Serial);
 }