Server.Multis.BaseHouse.ChangeLocks C# (CSharp) Méthode

ChangeLocks() public méthode

public ChangeLocks ( Server.Mobile m ) : void
m Server.Mobile
Résultat void
		public void ChangeLocks( Mobile m )
		{
			uint keyValue = CreateKeys( m );

			if ( m_Doors != null )
			{
				for ( int i = 0; i < m_Doors.Count; ++i )
				{
					BaseDoor door = m_Doors[i] as BaseDoor;

					if ( door != null )
						door.KeyValue = keyValue;
				}
			}
		}

Usage Example

        public override void OnDoubleClick(Mobile m)
        {
            // housing inheritance - from one character to the next (of kin)
            if (Core.UOMO)
            {
                BaseHouse house = m_Structure;
                if (house != null && (house.Owner == null || house.Owner.Deleted))
                {                       // a new character on this account gets the house
                    if (house.CheckInheritance(m))
                    {
                        // final sanity
                        if (house.Deleted || !m.CheckAlive())
                        {
                            return;
                        }

                        house.Owner = m;
                        if (house.Public == false)
                        {
                            house.ChangeLocks(m);
                        }
                    }
                }
                /* fall through */
            }

            if (m_Structure != null)
            {
                if (m_Structure.IsFriend(m))
                {
                    m.SendLocalizedMessage(501293);    // Welcome back to the house, friend!

                    if (Core.UOSP)                     //refresh house
                    {
                        double dms = m_Structure.DecayMinutesStored;
                        m_Structure.Refresh();

                        //if we're more than one day (less than 14 days) from the max stored (15 days),
                        //then tell the friend that the house is refreshed
                        if (dms < TimeSpan.FromDays(14.0).TotalMinutes)
                        {
                            m.SendMessage("You refresh the house.");
                        }
                    }
                }

                if (m_Structure.IsAosRules)
                {
                    m.SendGump(new HouseGumpAOS(HouseGumpPageAOS.Information, m, m_Structure));
                }
                else
                {
                    m.SendGump(new HouseGump(m, m_Structure));
                }
            }
        }