Implement Core.TickCount

Convert movement, actions (lift/use), combat, and spells to use Core.TickCount and avoid DateTime caveats (performance, system time dependency, etc)
Refactor DateTime.Now to DateTime.UtcNow
Add LOS check for Iron Maiden addon
This commit is contained in:
Mark Sturgill 2013-10-06 03:21:18 -07:00
parent f99eefb288
commit d2c670f5c3
241 changed files with 842 additions and 831 deletions

View file

@ -26,7 +26,7 @@ namespace Server.Factions
public List<Candidate> Candidates { get { return m_Candidates; } }
public ElectionState State{ get{ return m_State; } set{ m_State = value; m_LastStateTime = DateTime.Now; } }
public ElectionState State{ get{ return m_State; } set{ m_State = value; m_LastStateTime = DateTime.UtcNow; } }
public DateTime LastStateTime{ get{ return m_LastStateTime; } }
[CommandProperty( AccessLevel.GameMaster )]
@ -47,7 +47,7 @@ namespace Server.Factions
case ElectionState.Campaign: period = CampaignPeriod; break;
}
TimeSpan until = (m_LastStateTime + period) - DateTime.Now;
TimeSpan until = (m_LastStateTime + period) - DateTime.UtcNow;
if ( until < TimeSpan.Zero )
until = TimeSpan.Zero;
@ -66,7 +66,7 @@ namespace Server.Factions
case ElectionState.Campaign: period = CampaignPeriod; break;
}
m_LastStateTime = DateTime.Now - period + value;
m_LastStateTime = DateTime.UtcNow - period + value;
}
}
@ -280,7 +280,7 @@ namespace Server.Factions
{
case ElectionState.Pending:
{
if ( (m_LastStateTime + PendingPeriod) > DateTime.Now )
if ( (m_LastStateTime + PendingPeriod) > DateTime.UtcNow )
break;
m_Faction.Broadcast( 1038023 ); // Campaigning for the Faction Commander election has begun.
@ -292,7 +292,7 @@ namespace Server.Factions
}
case ElectionState.Campaign:
{
if ( (m_LastStateTime + CampaignPeriod) > DateTime.Now )
if ( (m_LastStateTime + CampaignPeriod) > DateTime.UtcNow )
break;
if ( m_Candidates.Count == 0 )
@ -332,7 +332,7 @@ namespace Server.Factions
}
case ElectionState.Election:
{
if ( (m_LastStateTime + VotingPeriod) > DateTime.Now )
if ( (m_LastStateTime + VotingPeriod) > DateTime.UtcNow )
break;
m_Faction.Broadcast( 1038024 ); // The results for the Faction Commander election are in
@ -445,7 +445,7 @@ namespace Server.Factions
else
m_Address = IPAddress.None;
m_Time = DateTime.Now;
m_Time = DateTime.UtcNow;
}
public Voter( GenericReader reader, Mobile candidate )