250501 커밋
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
using System.Diagnostics;
|
||||
using Amazon.Runtime;
|
||||
using ServerBase;
|
||||
using ServerCommon;
|
||||
using ServerCore;
|
||||
|
||||
namespace GameServer;
|
||||
|
||||
public class GameModeLifeCycleTicker : EntityTicker
|
||||
{
|
||||
private Func<Task> m_task_tick;
|
||||
public GameModeLifeCycleTicker(EntityBase parent, Int32 onTickIntervalMilliseconds, Func<Task> taskTick)
|
||||
: base(EntityType.GameModeLifeCycleTicker, parent, onTickIntervalMilliseconds, null)
|
||||
{
|
||||
m_task_tick = taskTick;
|
||||
}
|
||||
public override async Task onTaskTick()
|
||||
{
|
||||
var result = new Result();
|
||||
var err_msg = string.Empty;
|
||||
|
||||
Stopwatch? stopwatch = null;
|
||||
var event_tid = string.Empty;
|
||||
|
||||
var server_logic = GameServerApp.getServerLogic();
|
||||
var server_config = server_logic.getServerConfig();
|
||||
var seasonPassManager = server_logic.getSeasonPassManager();
|
||||
|
||||
if (true == server_config.PerformanceCheckEnable)
|
||||
{
|
||||
event_tid = System.Guid.NewGuid().ToString("N");
|
||||
stopwatch = Stopwatch.StartNew();
|
||||
}
|
||||
//logic 처리
|
||||
await m_task_tick();
|
||||
|
||||
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()}";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user