Skip to content

Commit

Permalink
Fixed timeout logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuuko Shionji committed Oct 17, 2023
1 parent 1735625 commit 29736ef
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions Logic/OSCTimer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,11 @@ public static class OSCTimer {

public static async Task OnIncParam(OscMessage message) {
var shouldAdd = (bool)message.Arguments[0];
if (input_delay > 0 & shouldAdd) {
if (DateTime.Now > lastAdded) {
Console.WriteLine($"Param recieved - Attempting to add {inc_step} minute(s)");
lastAdded = DateTime.Now.AddMilliseconds(input_delay);
}
else {
ColorConsole.WithYellowText.WriteLine($"Restricted by input delay until: " + lastAdded);
}
}
else if (shouldAdd) {
if (shouldAdd) {
Console.WriteLine($"Param recieved - Attempting to add {inc_step} seconds(s)");
AddTime(inc_step);
if (input_delay > 0 && DateTime.Now < lastAdded) {
ColorConsole.WithYellowText.WriteLine($"Restricted by input delay until: " + lastAdded);
} else AddTime(inc_step);
}
}

Expand Down

0 comments on commit 29736ef

Please sign in to comment.