baseline: OpenMU upstream b5a0961 (fresh source)
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
// <copyright file="PeriodicTaskGameServerState.cs" company="MUnique">
|
||||
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
|
||||
// </copyright>
|
||||
|
||||
namespace MUnique.OpenMU.GameLogic.PlugIns.PeriodicTasks;
|
||||
|
||||
/// <summary>
|
||||
/// Game server state per event.
|
||||
/// </summary>
|
||||
public class PeriodicTaskGameServerState
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PeriodicTaskGameServerState"/> class.
|
||||
/// </summary>
|
||||
/// <param name="context">The context.</param>
|
||||
public PeriodicTaskGameServerState(IGameContext context)
|
||||
{
|
||||
this.Context = context;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the context to which this state belongs.
|
||||
/// </summary>
|
||||
public IGameContext Context { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the next run in UTC.
|
||||
/// </summary>
|
||||
public DateTime NextRunUtc { get; set; } = DateTime.UtcNow;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the UTC timestamp of when the last event run started.
|
||||
/// Used to prevent a new event from starting before the previous task duration has elapsed.
|
||||
/// </summary>
|
||||
public DateTime LastRunUtc { get; set; } = DateTime.MinValue;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the state.
|
||||
/// </summary>
|
||||
public PeriodicTaskState State { get; set; } = PeriodicTaskState.NotStarted;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the description about the state.
|
||||
/// </summary>
|
||||
public virtual string Description => string.Empty;
|
||||
}
|
||||
Reference in New Issue
Block a user