本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例6: StartTimer
internal void StartTimer()
{
m_timer = new TimerEntry(AuthenticationStoreMillis, 0, dl => Remove());
m_timer.Start();
AuthenticationServer.IOQueue.RegisterUpdatable(m_timer);
}
示例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
}
}
示例8: StartTimer
internal void StartTimer()
{
m_timer = new TimerEntry(AuthenticationStoreSeconds, 0f, dl => Remove());
m_timer.Start();
AuthenticationServer.Instance.RegisterUpdatable(m_timer);
}