fix: Fixes TimeSpan rounding issues (#1610)
### Summary TLDR - .NET Framework rounded TimeSpan (and some DateTime) methods to the nearest millisecond. This was actually _expected_ accidentally for parts of RunUO. We are aiming to fix this and clean up some other bad assumptions. Closes #1604
This commit is contained in:
parent
98727d13b3
commit
331f24cb71
16 changed files with 91 additions and 87 deletions
|
|
@ -330,12 +330,11 @@ namespace Server.Saves
|
|||
|
||||
if (archiveCreated)
|
||||
{
|
||||
var elapsed = stopWatch.Elapsed.TotalSeconds;
|
||||
logger.Information(
|
||||
"Created {Period} archive at {Path} ({Elapsed:F2} seconds)",
|
||||
archivePeriodStrLower,
|
||||
archiveFilePath,
|
||||
elapsed
|
||||
stopWatch.Elapsed.TotalSeconds
|
||||
);
|
||||
|
||||
var i = minimum;
|
||||
|
|
|
|||
|
|
@ -95,9 +95,7 @@ namespace Server.Saves
|
|||
|
||||
private static void BroadcastWarning()
|
||||
{
|
||||
var s = (int)Warning.TotalSeconds;
|
||||
var m = s / 60;
|
||||
s %= 60;
|
||||
var m = Math.DivRem((int)Math.Round(Warning.TotalSeconds), 60, out var s);
|
||||
|
||||
if (m > 0 && s > 0)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue