60 lines
1.7 KiB
C#
60 lines
1.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using ServerCore; using ServerBase;
|
|
using ServerCommon;
|
|
|
|
|
|
namespace GameServer
|
|
{
|
|
public class NoticeChatTicker : EntityTicker
|
|
{
|
|
|
|
public NoticeChatTicker(double onTickIntervalMilliseconds, CancellationTokenSource? cts)
|
|
: base(EntityType.NoticeChatTicker, onTickIntervalMilliseconds, cts)
|
|
{
|
|
}
|
|
|
|
public override async Task onTaskTick()
|
|
{
|
|
Stopwatch? stopwatch = null;
|
|
var event_tid = string.Empty;
|
|
|
|
var server_logic = GameServerApp.getServerLogic();
|
|
ArgumentNullException.ThrowIfNull(server_logic);
|
|
var server_config = server_logic.getServerConfig();
|
|
ArgumentNullException.ThrowIfNull(server_config);
|
|
|
|
if (true == server_config.PerformanceCheckEnable)
|
|
{
|
|
event_tid = System.Guid.NewGuid().ToString("N");
|
|
stopwatch = Stopwatch.StartNew();
|
|
}
|
|
|
|
await GameServerApp.getServerLogic().getNoticeChatManager().UpdateChat();
|
|
|
|
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()}";
|
|
}
|
|
}
|
|
}
|