當前位置: 首頁>>代碼示例>>C#>>正文


C# TimerEntry.Start方法代碼示例

本文整理匯總了C#中WCell.Core.Timers.TimerEntry.Start方法的典型用法代碼示例。如果您正苦於以下問題:C# TimerEntry.Start方法的具體用法?C# TimerEntry.Start怎麽用?C# TimerEntry.Start使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WCell.Core.Timers.TimerEntry的用法示例。


在下文中一共展示了TimerEntry.Start方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: InitializeRegeneration

		/// <summary>
		/// Initializes the regeneration-timers.
		/// Gets called automatically for default NPCs.
		/// </summary>
		public void InitializeRegeneration()
		{
			this.UpdatePowerRegen();
			m_RegenerationDelay = RegenTickDelay;
			m_regenTimer = new TimerEntry(0.0f, m_RegenerationDelay, Regen);
			m_regenTimer.Start();
			m_regenerates = true;
		}
開發者ID:ray2006,項目名稱:WCell,代碼行數:12,代碼來源:Unit.cs

示例2: OnDeath

		protected override void OnDeath()
		{
			m_record.LastDeathTime = DateTime.Now;
			MarkDead();
            Achievements.CheckPossibleAchievementUpdates(AchievementCriteriaType.DeathAtMap, (uint)MapId, 1);
            Achievements.CheckPossibleAchievementUpdates(AchievementCriteriaType.DeathInDungeon, (uint)MapId, 1);
			// start release timer
			m_corpseReleaseTimer = new TimerEntry(dt => ReleaseCorpse());
			m_corpseReleaseTimer.Start(Corpse.AutoReleaseDelay, 0);

		}
開發者ID:remixod,項目名稱:netServer,代碼行數:11,代碼來源:Character.cs

示例3: OnTaxiStart

		internal void OnTaxiStart()
		{
			UnitFlags |= UnitFlags.Influenced;
			IsOnTaxi = true;

			//taxi interpolation timer
			taxiTime = 0;
			m_TaxiMovementTimer = new TimerEntry(0, TaxiMgr.InterpolationDelay, TaxiTimerCallback);
			m_TaxiMovementTimer.Start();
			IsEvading = true;
		}
開發者ID:ray2006,項目名稱:WCell,代碼行數:11,代碼來源:Unit.cs

示例4: OnDeath

		protected override void OnDeath()
		{
			m_record.LastDeathTime = DateTime.Now;
			MarkDead();

			// start release timer
			m_corpseReleaseTimer = new TimerEntry(dt => ReleaseCorpse());
			m_corpseReleaseTimer.Start(Corpse.AutoReleaseDelay, 0);
		}
開發者ID:Skizot,項目名稱:WCell,代碼行數:9,代碼來源:Character.cs

示例5: Start

		protected bool Start()
		{
			try
			{
				IsCached = AuthServerConfiguration.CacheAccounts;

				//I would have liked this to be a readonly field but it must be
				//initialised here otherwise in the ctor AccountReloadIntervalMs
				//wont have been init'd which would mean we cant customise the timer easily
				_accountsReloadTimer = new TimerEntry(0, AccountReloadIntervalMs, delay =>
				{
					if (Instance.IsCached)
						Instance.Resync();
				});
				_accountsReloadTimer.Start();
				AuthenticationServer.IOQueue.RegisterUpdatable(_accountsReloadTimer);

				if (Count == 0)
				{
					log.Info("Detected empty Account-database.");
					//if (!DoesAccountExist("Administrator"))
					//{
					//    CreateAccount("Administrator", DefaultAdminPW, null, RoleGroupInfo.HighestRole.Name, ClientId.Wotlk);
					//    log.Warn("Created new Account \"Administrator\" with same password.");
					//}
				}
			}
			catch (Exception e)
			{
				AuthDBMgr.OnDBError(e);
			}
			return true;
		}
開發者ID:origins,項目名稱:WCell,代碼行數:33,代碼來源:AccountMgr.cs

示例6: StartTimer

		internal void StartTimer()
		{
			m_timer = new TimerEntry(AuthenticationStoreMillis, 0, dl => Remove());
			m_timer.Start();
			AuthenticationServer.IOQueue.RegisterUpdatable(m_timer);
		}
開發者ID:remixod,項目名稱:netServer,代碼行數:6,代碼來源:AuthenticationRecord.cs

示例7: LoadDeathState

		private void LoadDeathState()
		{
			if (m_record.CorpseX != null)
			{
				// we were dead and released the corpse
				var map = World.GetMap(m_record.CorpseMap);
				if (map != null)
				{
					m_corpse = SpawnCorpse(false, false, map,
										   new Vector3(m_record.CorpseX.Value, m_record.CorpseY, m_record.CorpseZ), m_record.CorpseO);
					BecomeGhost();
				}
				else
				{
					// can't spawn corpse -> revive
					if (log.IsWarnEnabled)
					{
						log.Warn("Player {0}'s Corpse was spawned in invalid map: {1}", this, m_record.CorpseMap);
					}
				}
			}
			else if (m_record.Health == 0)
			{
				// we were dead and did not release yet
				var diff = DateTime.Now.Subtract(m_record.LastDeathTime).ToMilliSecondsInt() + Corpse.AutoReleaseDelay;
				m_corpseReleaseTimer = new TimerEntry(dt => ReleaseCorpse());

				if (diff > 0)
				{
					// mark dead and start release timer
					MarkDead();
					m_corpseReleaseTimer.Start(diff, 0);
				}
				else
				{
					// auto release
					ReleaseCorpse();
				}
			}
			else
			{
				// we are alive and kicking
			}
		}
開發者ID:MeaNone,項目名稱:WCell,代碼行數:44,代碼來源:Character.Maintenance.cs

示例8: StartTimer

		internal void StartTimer()
		{
			m_timer = new TimerEntry(AuthenticationStoreSeconds, 0f, dl => Remove());
			m_timer.Start();
			AuthenticationServer.Instance.RegisterUpdatable(m_timer);
		}
開發者ID:ray2006,項目名稱:WCell,代碼行數:6,代碼來源:AuthenticationRecord.cs


注:本文中的WCell.Core.Timers.TimerEntry.Start方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。