57 lines
1.7 KiB
C#
57 lines
1.7 KiB
C#
using System;
|
||
using Framework;
|
||
using System.ComponentModel;
|
||
|
||
public partial class SROptions
|
||
{
|
||
[Category("跨天检测"), DisplayName("检查节点-小时")]
|
||
public int Hours { get; set; }
|
||
|
||
[Category("跨天检测"), DisplayName("检查节点-分钟")]
|
||
public int Minutes { get; set; }
|
||
|
||
[Category("跨天检测"), DisplayName("检查节点-秒")]
|
||
public int Seconds { get; set; }
|
||
|
||
[Category("跨天检测"), DisplayName("设置检测时间")]
|
||
public void SetCheckTime()
|
||
{
|
||
if (Hours is < 0 or >= 24)
|
||
{
|
||
DebugUtil.LogError("GM设置检查时间单位小时错误,范围在0-23");
|
||
return;
|
||
}
|
||
|
||
if (Minutes is < 0 or >= 60)
|
||
{
|
||
DebugUtil.LogError("GM设置检查时间单位分钟错误,范围在0-59");
|
||
return;
|
||
}
|
||
|
||
if (Seconds is < 0 or >= 60)
|
||
{
|
||
DebugUtil.LogError("GM设置检查时间单位秒错误,范围在0-59");
|
||
return;
|
||
}
|
||
|
||
CrossDayChecker.Instance.SetCheckTime(new TimeSpan(Hours, Minutes, Seconds));
|
||
}
|
||
|
||
[Category("跨天检测"), DisplayName("发送跨天事件")]
|
||
public void SendCrossDay()
|
||
{
|
||
EventManager.Instance.Send(EventManager.EventName.CrossDay);
|
||
}
|
||
|
||
[Category("跨天检测"), DisplayName("直接发送跨周事件")]
|
||
public void SendCrossWeek()
|
||
{
|
||
EventManager.Instance.Send(EventManager.EventName.CrossWeek);
|
||
}
|
||
|
||
[Category("跨天检测"), DisplayName("直接发送跨月事件")]
|
||
public void SendCrossMonth()
|
||
{
|
||
EventManager.Instance.Send(EventManager.EventName.CrossMonth);
|
||
}
|
||
} |