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

@ -67,7 +67,7 @@ namespace Server.Engines.MyRunUO
OdbcCommand command = null;
OdbcTransaction transact = null;
DateTime start = DateTime.Now;
DateTime start = DateTime.UtcNow;
bool shouldWriteException = true;
@ -118,7 +118,7 @@ namespace Server.Engines.MyRunUO
try{ m_Sync.Close(); }
catch{}
Console.WriteLine( m_CompletionString, (DateTime.Now - start).TotalSeconds );
Console.WriteLine( m_CompletionString, (DateTime.UtcNow - start).TotalSeconds );
m_HasCompleted = true;
return;

View file

@ -125,7 +125,7 @@ namespace Server.Engines.MyRunUO
m_List = new ArrayList();
m_Collecting = new List<IAccount>();
m_StartTime = DateTime.Now;
m_StartTime = DateTime.UtcNow;
Console.WriteLine( "MyRunUO: Updating character database" );
}
@ -135,10 +135,10 @@ namespace Server.Engines.MyRunUO
try
{
shouldExit = Process( DateTime.Now + TimeSpan.FromSeconds( CpuInterval * CpuPercent ) );
shouldExit = Process( DateTime.UtcNow + TimeSpan.FromSeconds( CpuInterval * CpuPercent ) );
if ( shouldExit )
Console.WriteLine( "MyRunUO: Database statements compiled in {0:F2} seconds", (DateTime.Now - m_StartTime).TotalSeconds );
Console.WriteLine( "MyRunUO: Database statements compiled in {0:F2} seconds", (DateTime.UtcNow - m_StartTime).TotalSeconds );
}
catch ( Exception e )
{
@ -209,7 +209,7 @@ namespace Server.Engines.MyRunUO
++m_Index;
if ( DateTime.Now >= endTime )
if ( DateTime.UtcNow >= endTime )
break;
}
@ -549,7 +549,7 @@ namespace Server.Engines.MyRunUO
++m_Index;
if ( DateTime.Now >= endTime )
if ( DateTime.UtcNow >= endTime )
break;
}
@ -625,7 +625,7 @@ namespace Server.Engines.MyRunUO
++m_Index;
if ( DateTime.Now >= endTime )
if ( DateTime.UtcNow >= endTime )
break;
}

View file

@ -41,7 +41,7 @@ namespace Server.Engines.MyRunUO
if ( m_Command != null && !m_Command.HasCompleted )
return;
DateTime start = DateTime.Now;
DateTime start = DateTime.UtcNow;
Console.WriteLine( "MyRunUO: Updating status database" );
try