Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: fixed try catch.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Apr 22, 2023
1 parent a4a55de commit 507135b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
10 changes: 8 additions & 2 deletions Resources/AnimationLockTime.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,11 @@
"3595": 0.6,
"3596": 0.1,
"3600": 0.6,
"3601": 0.6,
"3601": 0.1,
"3603": 0.1,
"3606": 0.6,
"3608": 0.6,
"3610": 0.1,
"3610": 0.6,
"3612": 0.6,
"3614": 0.6,
"3615": 0.1,
Expand Down Expand Up @@ -130,6 +131,7 @@
"7399": 0.6,
"7400": 0.6,
"7402": 0.6,
"7403": 0.6,
"7404": 0.6,
"7406": 0.6,
"7407": 0.6,
Expand Down Expand Up @@ -206,6 +208,7 @@
"16478": 0.8,
"16479": 0.6,
"16480": 1.5,
"16489": 0.6,
"16493": 0.6,
"16495": 0.6,
"16498": 0.6,
Expand All @@ -222,6 +225,9 @@
"17215": 0.1,
"18806": 0.35,
"18807": 0.35,
"18873": 0.6,
"18877": 0.6,
"18881": 0.6,
"19004": 0.6,
"19012": 0.6,
"19297": 0.6,
Expand Down
20 changes: 14 additions & 6 deletions RotationSolver.Basic/DataCenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,15 +281,23 @@ public static float DPSTaken
{
get
{
var recs = _damages.Where(r => DateTime.Now - r.ReceiveTime < TimeSpan.FromMilliseconds(5));
try
{
var recs = _damages.Where(r => DateTime.Now - r.ReceiveTime < TimeSpan.FromMilliseconds(5));

if (!recs.Any()) return 0;

var damages = recs.Sum(r => r.Ratio);

if(!recs.Any()) return 0;

var damages = recs.Sum(r => r.Ratio);
var time = recs.Last().ReceiveTime - recs.First().ReceiveTime + TimeSpan.FromMilliseconds(2.5f);

var time = recs.Last().ReceiveTime - recs.First().ReceiveTime + TimeSpan.FromMilliseconds(2.5f);
return damages / (float)time.TotalSeconds;

return damages / (float)time.TotalSeconds;
}
catch
{
return 0;
}
}
}

Expand Down

0 comments on commit 507135b

Please sign in to comment.