Server.Misc.GiftGiver.DelayGiveGift C# (CSharp) Méthode

DelayGiveGift() public méthode

public DelayGiveGift ( System.TimeSpan delay, Server.Mobile mob ) : void
delay System.TimeSpan
mob Server.Mobile
Résultat void
		public virtual void DelayGiveGift( TimeSpan delay, Mobile mob )
		{
			Timer.DelayCall( delay, new TimerStateCallback( DelayGiveGift_Callback ), mob );
		}

Usage Example

Exemple #1
0
        private static void EventSink_Login(LoginEventArgs e)
        {
            Account acct = e.Mobile.Account as Account;

            if (acct == null)
            {
                return;
            }

            DateTime now = DateTime.UtcNow;

            for (int i = 0; i < m_Givers.Count; ++i)
            {
                GiftGiver giver = m_Givers[i];

                if (now < giver.Start || now >= giver.Finish)
                {
                    continue; // not in the correct timefream
                }
                if (acct.Created > (giver.Start - giver.MinimumAge))
                {
                    continue; // newly created account
                }
                if (acct.LastLogin >= giver.Start)
                {
                    continue; // already got one
                }
                giver.DelayGiveGift(TimeSpan.FromSeconds(5.0), e.Mobile);
            }

            acct.LastLogin = now;
        }
All Usage Examples Of Server.Misc.GiftGiver::DelayGiveGift