Skip to content

Commit 452b372

Browse files
committed
fix: 修正跨天逻辑中driver角色计数与跨天天数计算
修复ActorManager中遍历ActorMap时未排除driver角色导致计数错误的问题 优化ServerComponentAgent跨天定时器中跨天天数计算,使用实际经过天数而非固定值 #55
1 parent f52e1fa commit 452b372

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

GameFrameX.Core/Actors/ActorManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ async Task Work()
448448
b = 0;
449449
foreach (var actor in ActorMap.Values)
450450
{
451-
if (actor.Type > GlobalConst.ActorTypeSeparator)
451+
if (actor.Type > GlobalConst.ActorTypeSeparator && actor.Type != driverActorType)
452452
{
453453
b++;
454454

GameFrameX.Hotfix/Logic/Server/ServerComponentAgent.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,10 @@ private class CrossDayTimeHandler : TimerHandler<ServerComponentAgent>
327327
protected override async Task HandleTimer(ServerComponentAgent agent, GameEventArgs gameEventArgs)
328328
{
329329
LogHelper.Debug($"ServerCompAgent.CrossDayTimeHandler.跨天定时器执行{TimerHelper.CurrentDateTimeWithUtcFormat()}");
330-
await ActorManager.RoleCrossDay(1);
331-
await ActorManager.CrossDay(1, GlobalConst.ActorTypeServer);
330+
var crossDays = TimerHelper.GetCrossDaysWithUtc(agent.State.FirstStartTime);
331+
332+
await ActorManager.RoleCrossDay(crossDays);
333+
await ActorManager.CrossDay(crossDays, GlobalConst.ActorTypeServer);
332334
}
333335
}
334336

0 commit comments

Comments
 (0)