Not sure if this will work had a quick look and changed a very minor part might fix the problem if not ill take a more indepth look and repost.
 

Attachments

  • BaseClothing.cs
    46.2 KB · Views: 4
There were 2 case 7: Commented out the 2nd one, got an error of No such case 6. Uncommented & changed the 2nd case 7 to case 6. Compiled & wanted to delete Robe. I'm going to bed... I'm tired (was at work all night) & have a headache (worked all night on this at work). lol
 
Carefully redid it again & same thing.. No changes have been made to any of the Ser/Deser of Hats, OuterTorso, Pants & Shoes. Just the addition of the CommunityCollections rewards clothing. Its even deleting FancyShirt which wasnt even touched. Unless it's simply because of the Ser/Deser changes in BaseClothing.cs thats causing the deletions, even if they are ok.
BaseClothing.cs Ser
Code:
		private static void SetSaveFlag(ref SaveFlag flags, SaveFlag toSet, bool setIf)
		{
			if (setIf)
				flags |= toSet;
		}
 
		private static bool GetSaveFlag(SaveFlag flags, SaveFlag toGet)
		{
			return ((flags & toGet) != 0);
		}
 
		[Flags]
		private enum SaveFlag
		{
			None = 0x00000000,
			Resource = 0x00000001,
			Attributes = 0x00000002,
			ClothingAttributes = 0x00000004,
			SkillBonuses = 0x00000008,
			Resistances = 0x00000010,
			MaxHitPoints = 0x00000020,
			HitPoints = 0x00000040,
			PlayerConstructed = 0x00000080,
			Crafter = 0x00000100,
			Quality = 0x00000200,
			StrReq = 0x00000400,
			#region Imbuing
		//	TimesImbued = 0x12000000,
			#endregion
		}
 
		#region Mondain's Legacy Sets
		private static void SetSaveFlag(ref SetFlag flags, SetFlag toSet, bool setIf)
		{
			if (setIf)
				flags |= toSet;
		}
 
		private static bool GetSaveFlag(SetFlag flags, SetFlag toGet)
		{
			return ((flags & toGet) != 0);
		}
 
		[Flags]
		private enum SetFlag
		{
			None = 0x00000000,
			Attributes = 0x00000001,
			ArmorAttributes = 0x00000002,
			SkillBonuses = 0x00000004,
			PhysicalBonus = 0x00000008,
			FireBonus = 0x00000010,
			ColdBonus = 0x00000020,
			PoisonBonus = 0x00000040,
			EnergyBonus = 0x00000080,
			SetHue = 0x00000100,
			LastEquipped = 0x00000200,
			SetEquipped = 0x00000400,
			SetSelfRepair = 0x00000800,
		}
		#endregion
 
		public override void Serialize(GenericWriter writer)
		{
			base.Serialize(writer);
 
			writer.Write((int)6); // version
 
			#region SF Imbuing
			writer.Write((int)m_TimesImbued); // Imbuing
 
			writer.Write((bool)Physical_Modded);
			writer.Write((bool)Fire_Modded);
			writer.Write((bool)Cold_Modded);
			writer.Write((bool)Poison_Modded);
			writer.Write((bool)Energy_Modded);
			#endregion
 
			#region Mondain's Legacy Sets
			SetFlag sflags = SetFlag.None;
 
			SetSaveFlag(ref sflags, SetFlag.Attributes, !m_SetAttributes.IsEmpty);
			SetSaveFlag(ref sflags, SetFlag.SkillBonuses, !m_SetSkillBonuses.IsEmpty);
			SetSaveFlag(ref sflags, SetFlag.PhysicalBonus, m_SetPhysicalBonus != 0);
			SetSaveFlag(ref sflags, SetFlag.FireBonus, m_SetFireBonus != 0);
			SetSaveFlag(ref sflags, SetFlag.ColdBonus, m_SetColdBonus != 0);
			SetSaveFlag(ref sflags, SetFlag.PoisonBonus, m_SetPoisonBonus != 0);
			SetSaveFlag(ref sflags, SetFlag.EnergyBonus, m_SetEnergyBonus != 0);
			SetSaveFlag(ref sflags, SetFlag.SetHue, m_SetHue != 0);
			SetSaveFlag(ref sflags, SetFlag.LastEquipped, m_LastEquipped);
			SetSaveFlag(ref sflags, SetFlag.SetEquipped, m_SetEquipped);
			SetSaveFlag(ref sflags, SetFlag.SetSelfRepair, m_SetSelfRepair != 0);
 
			writer.WriteEncodedInt((int)sflags);
 
			if (GetSaveFlag(sflags, SetFlag.Attributes))
				m_SetAttributes.Serialize(writer);
 
			if (GetSaveFlag(sflags, SetFlag.SkillBonuses))
				m_SetSkillBonuses.Serialize(writer);
 
			if (GetSaveFlag(sflags, SetFlag.PhysicalBonus))
				writer.WriteEncodedInt((int)m_SetPhysicalBonus);
 
			if (GetSaveFlag(sflags, SetFlag.FireBonus))
				writer.WriteEncodedInt((int)m_SetFireBonus);
 
			if (GetSaveFlag(sflags, SetFlag.ColdBonus))
				writer.WriteEncodedInt((int)m_SetColdBonus);
 
			if (GetSaveFlag(sflags, SetFlag.PoisonBonus))
				writer.WriteEncodedInt((int)m_SetPoisonBonus);
 
			if (GetSaveFlag(sflags, SetFlag.EnergyBonus))
				writer.WriteEncodedInt((int)m_SetEnergyBonus);
 
			if (GetSaveFlag(sflags, SetFlag.SetHue))
				writer.WriteEncodedInt((int)m_SetHue);
 
			if (GetSaveFlag(sflags, SetFlag.LastEquipped))
				writer.Write((bool)m_LastEquipped);
 
			if (GetSaveFlag(sflags, SetFlag.SetEquipped))
				writer.Write((bool)m_SetEquipped);
 
			if (GetSaveFlag(sflags, SetFlag.SetSelfRepair))
				writer.WriteEncodedInt((int)m_SetSelfRepair);
			#endregion
 
			// Version 5
			SaveFlag flags = SaveFlag.None;
 
			SetSaveFlag(ref flags, SaveFlag.Resource, m_Resource != DefaultResource);
			SetSaveFlag(ref flags, SaveFlag.Attributes, !m_AosAttributes.IsEmpty);
			SetSaveFlag(ref flags, SaveFlag.ClothingAttributes, !m_AosClothingAttributes.IsEmpty);
			SetSaveFlag(ref flags, SaveFlag.SkillBonuses, !m_AosSkillBonuses.IsEmpty);
			SetSaveFlag(ref flags, SaveFlag.Resistances, !m_AosResistances.IsEmpty);
			SetSaveFlag(ref flags, SaveFlag.MaxHitPoints, m_MaxHitPoints != 0);
			SetSaveFlag(ref flags, SaveFlag.HitPoints, m_HitPoints != 0);
			SetSaveFlag(ref flags, SaveFlag.PlayerConstructed, m_PlayerConstructed != false);
			SetSaveFlag(ref flags, SaveFlag.Crafter, m_Crafter != null);
			SetSaveFlag(ref flags, SaveFlag.Quality, m_Quality != ClothingQuality.Regular);
			SetSaveFlag(ref flags, SaveFlag.StrReq, m_StrReq != -1);
			#region Imbuing
	 //	   SetSaveFlag(ref flags, SaveFlag.TimesImbued, m_TimesImbued != 0);
			#endregion
 
			writer.WriteEncodedInt((int)flags);
 
			if (GetSaveFlag(flags, SaveFlag.Resource))
				writer.WriteEncodedInt((int)m_Resource);
 
			if (GetSaveFlag(flags, SaveFlag.Attributes))
				m_AosAttributes.Serialize(writer);
 
			if (GetSaveFlag(flags, SaveFlag.ClothingAttributes))
				m_AosClothingAttributes.Serialize(writer);
 
			if (GetSaveFlag(flags, SaveFlag.SkillBonuses))
				m_AosSkillBonuses.Serialize(writer);
 
			if (GetSaveFlag(flags, SaveFlag.Resistances))
				m_AosResistances.Serialize(writer);
 
			if (GetSaveFlag(flags, SaveFlag.MaxHitPoints))
				writer.WriteEncodedInt((int)m_MaxHitPoints);
 
			if (GetSaveFlag(flags, SaveFlag.HitPoints))
				writer.WriteEncodedInt((int)m_HitPoints);
 
			if (GetSaveFlag(flags, SaveFlag.Crafter))
				writer.Write((Mobile)m_Crafter);
 
			if (GetSaveFlag(flags, SaveFlag.Quality))
				writer.WriteEncodedInt((int)m_Quality);
 
			if (GetSaveFlag(flags, SaveFlag.StrReq))
				writer.WriteEncodedInt((int)m_StrReq);
		}
Deser
Code:
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);
 
			int version = reader.ReadInt();
 
			switch (version)
			{
				case 6:
					{
						#region SF Imbuing
						//SF Imbuing
						{
							m_TimesImbued = reader.ReadInt();
 
							Physical_Modded = reader.ReadBool();
							Fire_Modded = reader.ReadBool();
							Cold_Modded = reader.ReadBool();
							Poison_Modded = reader.ReadBool();
							Energy_Modded = reader.ReadBool();
						}
						#endregion
 
						#region Mondain's Legacy Sets
						SetFlag sflags = (SetFlag)reader.ReadEncodedInt();
 
						if (GetSaveFlag(sflags, SetFlag.Attributes))
							m_SetAttributes = new AosAttributes(this, reader);
						else
							m_SetAttributes = new AosAttributes(this);
 
						if (GetSaveFlag(sflags, SetFlag.ArmorAttributes))
							m_SetSelfRepair = (new AosArmorAttributes(this, reader)).SelfRepair;
 
						if (GetSaveFlag(sflags, SetFlag.SkillBonuses))
							m_SetSkillBonuses = new AosSkillBonuses(this, reader);
						else
							m_SetSkillBonuses = new AosSkillBonuses(this);
 
						if (GetSaveFlag(sflags, SetFlag.PhysicalBonus))
							m_SetPhysicalBonus = reader.ReadEncodedInt();
 
						if (GetSaveFlag(sflags, SetFlag.FireBonus))
							m_SetFireBonus = reader.ReadEncodedInt();
 
						if (GetSaveFlag(sflags, SetFlag.ColdBonus))
							m_SetColdBonus = reader.ReadEncodedInt();
 
						if (GetSaveFlag(sflags, SetFlag.PoisonBonus))
							m_SetPoisonBonus = reader.ReadEncodedInt();
 
						if (GetSaveFlag(sflags, SetFlag.EnergyBonus))
							m_SetEnergyBonus = reader.ReadEncodedInt();
 
						if (GetSaveFlag(sflags, SetFlag.SetHue))
							m_SetHue = reader.ReadEncodedInt();
 
						if (GetSaveFlag(sflags, SetFlag.LastEquipped))
							m_LastEquipped = reader.ReadBool();
 
						if (GetSaveFlag(sflags, SetFlag.SetEquipped))
							m_SetEquipped = reader.ReadBool();
 
						if (GetSaveFlag(sflags, SetFlag.SetSelfRepair))
							m_SetSelfRepair = reader.ReadEncodedInt();
						#endregion
 
						goto case 5;
					}
				case 5:
					{
						SaveFlag flags = (SaveFlag)reader.ReadEncodedInt();
 
						if (GetSaveFlag(flags, SaveFlag.Resource))
							m_Resource = (CraftResource)reader.ReadEncodedInt();
						else
							m_Resource = DefaultResource;
 
						if (GetSaveFlag(flags, SaveFlag.Attributes))
							m_AosAttributes = new AosAttributes(this, reader);
						else
							m_AosAttributes = new AosAttributes(this);
 
						if (GetSaveFlag(flags, SaveFlag.ClothingAttributes))
							m_AosClothingAttributes = new AosArmorAttributes(this, reader);
						else
							m_AosClothingAttributes = new AosArmorAttributes(this);
 
						if (GetSaveFlag(flags, SaveFlag.SkillBonuses))
							m_AosSkillBonuses = new AosSkillBonuses(this, reader);
						else
							m_AosSkillBonuses = new AosSkillBonuses(this);
 
						if (GetSaveFlag(flags, SaveFlag.Resistances))
							m_AosResistances = new AosElementAttributes(this, reader);
						else
							m_AosResistances = new AosElementAttributes(this);
 
						if (GetSaveFlag(flags, SaveFlag.MaxHitPoints))
							m_MaxHitPoints = reader.ReadEncodedInt();
 
						if (GetSaveFlag(flags, SaveFlag.HitPoints))
							m_HitPoints = reader.ReadEncodedInt();
 
						if (GetSaveFlag(flags, SaveFlag.Crafter))
							m_Crafter = reader.ReadMobile();
 
						if (GetSaveFlag(flags, SaveFlag.Quality))
							m_Quality = (ClothingQuality)reader.ReadEncodedInt();
						else
							m_Quality = ClothingQuality.Regular;
 
						if (GetSaveFlag(flags, SaveFlag.StrReq))
							m_StrReq = reader.ReadEncodedInt();
						else
							m_StrReq = -1;
 
						if (GetSaveFlag(flags, SaveFlag.PlayerConstructed))
							m_PlayerConstructed = true;
 
						break;
					}
				case 4:
					{
						m_Resource = (CraftResource)reader.ReadInt();
 
						goto case 3;
					}
				case 3:
					{
						m_AosAttributes = new AosAttributes(this, reader);
						m_AosClothingAttributes = new AosArmorAttributes(this, reader);
						m_AosSkillBonuses = new AosSkillBonuses(this, reader);
						m_AosResistances = new AosElementAttributes(this, reader);
 
						goto case 2;
					}
				case 2:
					{
						m_PlayerConstructed = reader.ReadBool();
						goto case 1;
					}
				case 1:
					{
						m_Crafter = reader.ReadMobile();
						m_Quality = (ClothingQuality)reader.ReadInt();
						break;
					}
				case 0:
					{
						m_Crafter = null;
						m_Quality = ClothingQuality.Regular;
						break;
					}
			}
 
			#region Mondain's Legacy Sets
			if (m_SetAttributes == null)
				m_SetAttributes = new AosAttributes(this);
 
			if (m_SetSkillBonuses == null)
				m_SetSkillBonuses = new AosSkillBonuses(this);
			#endregion
 
			if (version < 2)
				m_PlayerConstructed = true; // we don't know, so, assume it's crafted
 
			if (version < 3)
			{
				m_AosAttributes = new AosAttributes(this);
				m_AosClothingAttributes = new AosArmorAttributes(this);
				m_AosSkillBonuses = new AosSkillBonuses(this);
				m_AosResistances = new AosElementAttributes(this);
			}
 
			if (version < 4)
				m_Resource = DefaultResource;
 
			if (m_MaxHitPoints == 0 && m_HitPoints == 0)
				m_HitPoints = m_MaxHitPoints = Utility.RandomMinMax(InitMinHits, InitMaxHits);
 
			Mobile parent = Parent as Mobile;
 
			if (parent != null)
			{
				if (Core.AOS)
					m_AosSkillBonuses.AddTo(parent);
 
				AddStatBonuses(parent);
				parent.CheckStatTimers();
			}
		}
 
Last edited:
I see no obvious difference between the two ...

But what is the original "Deserialize" ? I mean, the one from where the latest World Save was done ?


Sent from my iPhone using Tapatalk
 
The original didnt have any of the Mondain's Legacy sets coding in it in either the Ser or Deser. Its only needed in BaseClothing for the Humility Cloak & SacrificeSolerettes.. for the ISet codes & such. I can add every bit of the sets coding into it except for the Ser/Deser stuff & everything is fine compile wise.. no clothing deletions at all. And rebooting the tester after a save gives me no troubles. But add in the Ser/Deser coding & reboot... it wants to delete clothing items.
 
Last edited:
I just discovered that they have the VirtueSet V2 in the server files.... along with the original set I put in (requires the ISet). V2 doesnt require the ISet, so I'm just reverting the BaseClothing.cs back to the servers original and saying screw it. lol Now I should be able to log in & test things.... or find new errors to gripe about. :D
 
Oh yeah.. I relaxed for about an hour & then the fan on my video card died.. Spent the next couple hours walking around town trying to get a replacement card. Finally ended up having to order one & pay for next day shipping. I'm currently running mine with no fan attached, but with a small fan blowing into the tower to try to help keep it cool. No rest for the wicked & the righteous dont need any.... And since I need some rest..... I must be wicked. lol
 
At least you had a fan laying around. It'd be a lot harder to type if you had to be leaning over blowing into the tower all night.
 
That would have made matters worse... I'm full of hot air, my breath stinks & I'm kind of blonde. Not sure a dizzy, blonde coder is a good thing to have around. :p
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back