Example #1
0
		public override void Serialize(GenericWriter writer)
		{
			base.Serialize(writer);

			writer.Write((int)20); // version

			// version 20 - Adam
			writer.WriteUInt32(m_NPCData);

			// version 19 - Adam
			writer.Write(m_RestartDecay);

			//version 18 - Adam
			writer.WriteUInt32((System.UInt32)m_Flags);

			//version 17 - Adam
			writer.WriteUInt32(m_UpgradeCosts);

			//version 16 - Adam
			writer.WriteUInt32(m_LockBoxData);

			//version 15 - Pix
			writer.Write(m_SecurePremises);

			//version 14 - TK - store bool if IDOC Announcement is running
			writer.Write((bool)(m_IDOC_Broadcast_TCE != null));

			//version 13 - Pix. - store minutes instead of timespan
			writer.Write(m_DecayMinutesStored);

			//version 12 - Pix. - house decay variables
			//writer.WriteDeltaTime( StructureDecayTime );
			writer.Write(m_NeverDecay);
			//end version 12 additions

			writer.Write(m_MaxLockBoxes);

			// use the Property to insure we have an accurate count
			writer.Write(LockBoxCount);

			writer.Write((int)m_Visits);

			writer.Write((int)m_Price);

			writer.WriteMobileList(m_Access);

			writer.Write(m_BuiltOn);
			writer.Write(m_LastTraded);

			writer.WriteItemList(m_Addons, true);

			writer.Write(m_Secures.Count);

			for (int i = 0; i < m_Secures.Count; ++i)
				((SecureInfo)m_Secures[i]).Serialize(writer);

			writer.Write(m_Public);

			writer.Write(BanLocation);

			writer.Write(m_Owner);

			// Version 5 no longer serializes region coords
			/*writer.Write( (int)m_Region.Coords.Count );
			foreach( Rectangle2D rect in m_Region.Coords )
			{
				writer.Write( rect );
			}*/

			writer.WriteMobileList(m_CoOwners, true);
			writer.WriteMobileList(m_Friends, true);
			writer.WriteMobileList(m_Bans, true);

			writer.Write(m_Sign);
			writer.Write(m_Trash);

			writer.WriteItemList(m_Doors, true);
			writer.WriteItemList(m_LockDowns, true);
			//writer.WriteItemList( m_Secures, true );

			writer.Write((int)m_MaxLockDowns);
			writer.Write((int)m_MaxSecures);

			/* -- Adam: This code no longer applies as you cannot lock down containers
			 * that are not 'deco' in a public building. Furthermore, you cannot lock down
			 * items inside of a container.
			// Items in locked down containers that aren't locked down themselves must decay!
			//6/24/04 - Pix: this functionality shouldn't happen for private houses with our
			//	lockbox concept.
			if( m_Public )  
			{
				for ( int i = 0; i < m_LockDowns.Count; ++i )
				{
					Item item = (Item)m_LockDowns[i];

					if ( item is Container && !(item is BaseBoard) )
					{
						Container cont = (Container)item;
						ArrayList children = cont.Items;

						for ( int j = 0; j < children.Count; ++j )
						{
							Item child = (Item)children[j];

							if ( child.Decays && !child.IsLockedDown && !child.IsSecure && (child.LastMoved + child.DecayTime) <= DateTime.Now )
								Timer.DelayCall( TimeSpan.Zero, new TimerCallback( child.Delete ) );
						}
					}
				}
			}
			*/
		}