52 lines
1.4 KiB
C#
52 lines
1.4 KiB
C#
using System.Diagnostics;
|
|
|
|
using ServerCommon;
|
|
using ServerCore; using ServerBase;
|
|
|
|
|
|
namespace GameServer;
|
|
|
|
public class SystemMailCheckTicker : EntityTicker
|
|
{
|
|
public SystemMailCheckTicker(double onTickIntervalMilliseconds, CancellationTokenSource? cts)
|
|
: base(EntityType.SystemMailCheckTicker, onTickIntervalMilliseconds, cts)
|
|
{
|
|
|
|
}
|
|
|
|
|
|
public override async Task onTaskTick()
|
|
{
|
|
Stopwatch? stopwatch = null;
|
|
var event_tid = string.Empty;
|
|
|
|
var server_logic = GameServerApp.getServerLogic();
|
|
var server_config = server_logic.getServerConfig();
|
|
|
|
if (true == server_config.PerformanceCheckEnable)
|
|
{
|
|
event_tid = System.Guid.NewGuid().ToString("N");
|
|
stopwatch = Stopwatch.StartNew();
|
|
}
|
|
|
|
await server_logic.getSystemMailManager().refreshDB();
|
|
//await server_logic.getSystemMailManager().notifyNewSystemMail();
|
|
|
|
if (null != stopwatch)
|
|
{
|
|
var elapsed_msec = stopwatch.ElapsedMilliseconds;
|
|
stopwatch.Stop();
|
|
Log.getLogger().debug($"{GetType()} Ticker Stopwatch Stop : ETID:{event_tid}, ElapsedMSec:{elapsed_msec}, TickIntervalMSec:{getOnTickIntervalMilliseconds()}");
|
|
}
|
|
}
|
|
|
|
public override string toBasicString()
|
|
{
|
|
return $"{this.getTypeName()}";
|
|
}
|
|
|
|
public override string toSummaryString()
|
|
{
|
|
return $"{this.getTypeName()}";
|
|
}
|
|
} |