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); } } } }
private void Save(BaseGuild guild, BinaryMemoryWriter writer) { int length = writer.CommitTo(guildData, guildIndex, 0, guild.Id); if (metrics != null) { metrics.OnGuildSaved(length); } }
private void Save(Mobile mob, BinaryMemoryWriter writer) { int length = writer.CommitTo(mobileData, mobileIndex, mob.m_TypeRef, mob.Serial); if (metrics != null) { metrics.OnMobileSaved(length); } }
private void Save(Item item, BinaryMemoryWriter writer) { int length = writer.CommitTo(itemData, itemIndex, item._TypeRef, item.Serial); if (metrics != null) { metrics.OnItemSaved(length); } if (item.Decays && item.Parent == null && item.Map != Map.Internal && DateTime.UtcNow > (item.LastMoved + item.DecayTime)) { _decayQueue.Enqueue(item); } }