-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Move current hourly task implementation to NextTimeAmountTask - Implemented a new hourly task which occurs wgen transitioning from x:59 to y:00.
- Loading branch information
1 parent
b7f6059
commit 22b5634
Showing
3 changed files
with
50 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Arrowgene.Ddon.Shared.Model.Scheduler; | ||
using System; | ||
|
||
namespace Arrowgene.Ddon.GameServer.Tasks | ||
{ | ||
public abstract class NextTimeAmountTask : SchedulerTask | ||
{ | ||
public uint Hours { get; } | ||
public uint Minutes { get; } | ||
|
||
public NextTimeAmountTask(TaskType type, uint hours, uint minutes = 0) : base(ScheduleInterval.Hourly, type) | ||
{ | ||
Hours = hours; | ||
Minutes = minutes; | ||
} | ||
|
||
public override long NextTimestamp() | ||
{ | ||
return new DateTimeOffset(DateTime.Now.AddHours(Hours).AddMinutes(Minutes)).ToUnixTimeSeconds(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters