Skip to content

Commit

Permalink
Updated status check for engineer table to account for sleep 0 it wil…
Browse files Browse the repository at this point in the history
…l now give a sleep 0 implant 4-5 seconds of no check-in before marking offline. Also changed the offline multiplier to 3 from 2 to help with round-trip times.
  • Loading branch information
DragoQCC committed Apr 1, 2023
1 parent 284a408 commit 59fdd3f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion HardHatC2Client/Pages/Engineers.razor
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,13 @@
{
// if engineer LastSeen is in the past then Status is offline
// add 5 seconds to the LastSeen to make sure the engineer is still online
if (engineer.LastSeen.AddSeconds(engineer.Sleep*2) < DateTime.Now)
int sleepTime = engineer.Sleep;
//makes it so the ui wont auto timeout engineers at sleep 0 unless they dont check in for 4-5 seconds
if (sleepTime == 0)
{
sleepTime = 2;
}
if (engineer.LastSeen.AddSeconds(sleepTime*3) < DateTime.Now)
{
engineer.Status = "Offline";
}
Expand Down

0 comments on commit 59fdd3f

Please sign in to comment.