public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); int count; bool idocannc = false; m_Region = new HouseRegion(this); switch (version) { case 20: { m_NPCData = reader.ReadUInt32(); goto case 19; } case 19: { m_RestartDecay = reader.ReadTimeSpan(); goto case 18; } case 18: { m_Flags = (ImplFlags)reader.ReadUInt32(); goto case 17; } case 17: { m_UpgradeCosts = reader.ReadUInt32(); goto case 16; } case 16: { m_LockBoxData = reader.ReadUInt32(); goto case 15; } case 15: { m_SecurePremises = reader.ReadBool(); goto case 14; } case 14: { idocannc = reader.ReadBool(); goto case 13; } case 13: { m_DecayMinutesStored = reader.ReadDouble(); m_NeverDecay = reader.ReadBool(); goto case 11; //note, this isn't a mistake - we want to skip 12 } case 12: { DateTime tempDT = reader.ReadDeltaTime(); //StructureDecayTime = reader.ReadDeltaTime(); m_DecayMinutesStored = (tempDT - DateTime.Now).TotalMinutes; m_NeverDecay = reader.ReadBool(); goto case 11; } case 11: { m_MaxLockBoxes = reader.ReadInt(); m_LockBoxCount = reader.ReadInt(); goto case 9; } case 10: // just a signal for updates case 9: { m_Visits = reader.ReadInt(); goto case 8; } case 8: { m_Price = reader.ReadInt(); goto case 7; } case 7: { m_Access = reader.ReadMobileList(); goto case 6; } case 6: { m_BuiltOn = reader.ReadDateTime(); m_LastTraded = reader.ReadDateTime(); goto case 5; } case 5: // just removed fields case 4: { m_Addons = reader.ReadItemList(); goto case 3; } case 3: { count = reader.ReadInt(); m_Secures = new ArrayList(count); for (int i = 0; i < count; ++i) { SecureInfo info = new SecureInfo(reader); if (info.Item != null) { info.Item.IsSecure = true; info.Item.CancelFreezeTimer(); // don't initiate for Deserialize m_Secures.Add(info); } } goto case 2; } case 2: { m_Public = reader.ReadBool(); goto case 1; } case 1: { m_Region.GoLocation = reader.ReadPoint3D(); goto case 0; } case 0: { if (version < 16) { LockBoxCeling = (uint)m_MaxLockBoxes * 2; // high limit LockBoxFloor = (uint)m_MaxLockBoxes; // low limit } if (version < 12) { Refresh(); m_NeverDecay = false; } if (version < 4) m_Addons = new ArrayList(); if (version < 7) m_Access = new ArrayList(); if (version < 8) m_Price = DefaultPrice; m_Owner = reader.ReadMobile(); if (version < 5) { count = reader.ReadInt(); for (int i = 0; i < count; i++) reader.ReadRect2D(); } UpdateRegionArea(); Region.AddRegion(m_Region); m_CoOwners = reader.ReadMobileList(); m_Friends = reader.ReadMobileList(); m_Bans = reader.ReadMobileList(); m_Sign = reader.ReadItem() as HouseSign; m_Trash = reader.ReadItem() as TrashBarrel; m_Doors = reader.ReadItemList(); m_LockDowns = reader.ReadItemList(); for (int i = 0; i < m_LockDowns.Count; ++i) { Item item = m_LockDowns[i] as Item; if (item != null) { item.IsLockedDown = true; item.CancelFreezeTimer(); // don't initiate for Deserialize } } if (version < 3) { ArrayList items = reader.ReadItemList(); m_Secures = new ArrayList(items.Count); for (int i = 0; i < items.Count; ++i) { Container c = items[i] as Container; if (c != null) { c.IsSecure = true; m_Secures.Add(new SecureInfo(c, SecureLevel.CoOwners)); } } } m_MaxLockDowns = reader.ReadInt(); m_MaxSecures = reader.ReadInt(); if ((Map == null || Map == Map.Internal) && Location == Point3D.Zero) Delete(); if (m_Owner != null) { ArrayList list = (ArrayList)m_Table[m_Owner]; if (list == null) m_Table[m_Owner] = list = new ArrayList(); list.Add(this); } break; } } // patch m_NPCData to hold the default barkeep count if (version < 20) MaximumBarkeepCount = 2; if (version <= 1) ChangeSignType(0xBD2);//private house, plain brass sign if (version < 10) { /* NOTE: This can exceed the house lockdown limit. It must be this way, because * we do not want players' items to decay without them knowing. Or not even * having a chance to fix it themselves. */ Timer.DelayCall(TimeSpan.Zero, new TimerCallback(FixLockdowns_Sandbox)); } if (idocannc) // idoc announcement was running when we saved, re-create it { string[] lines = new string[1]; lines[0] = String.Format("Lord British has condemned the estate of {0} near {1}.", this.Owner.Name, DescribeLocation()); m_IDOC_Broadcast_TCE = new TownCrierEntry(lines, TimeSpan.FromMinutes(m_DecayMinutesStored), Serial.MinusOne); GlobalTownCrierEntryList.Instance.AddEntry(m_IDOC_Broadcast_TCE); } }