Skip to content

Commit e3fd024

Browse files
committed
[修改]1. 修改Actor的处理
1 parent 4103be5 commit e3fd024

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

GameFrameX.Core/Actors/Actor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public Actor(long id, ActorType type)
110110
Type = type;
111111
WorkerActor = new WorkerActor(id);
112112

113-
if (type == ActorType.Player)
113+
if (type < ActorType.Separator)
114114
{
115115
Tell(() => SetAutoRecycle(true));
116116
}

GameFrameX.Core/Actors/ActorManager.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public static Task<T> GetComponentAgent<T>() where T : IComponentAgent
8383
internal static async Task<Actor> GetOrNew(long actorId)
8484
{
8585
var actorType = ActorIdGenerator.GetActorType(actorId);
86-
if (actorType == ActorType.Player)
86+
if (actorType < ActorType.Separator)
8787
{
8888
var now = DateTime.Now;
8989
if (ActiveTimeDic.TryGetValue(actorId, out var activeTime)
@@ -278,7 +278,7 @@ public static Task RoleCrossDay(int openServerDay)
278278
{
279279
foreach (var actor in ActorMap.Values)
280280
{
281-
if (actor.Type == ActorType.Player)
281+
if (actor.Type < ActorType.Separator)
282282
{
283283
actor.Tell(() => actor.CrossDay(openServerDay));
284284
}
@@ -339,7 +339,7 @@ async Task Work()
339339
b = 0;
340340
foreach (var actor in ActorMap.Values)
341341
{
342-
if (actor.Type < ActorType.Separator && actor.Type != ActorType.Player)
342+
if (actor.Type > ActorType.Separator)
343343
{
344344
b++;
345345

GameFrameX.Core/Components/ComponentRegister.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public static Task Init(Assembly assembly = null)
8888

8989
ComponentActorDic[type] = actorType;
9090

91-
if (actorType == ActorType.Player)
91+
if (actorType < ActorType.Separator)
9292
{
9393
if (type.GetCustomAttribute(typeof(FuncAttribute)) is FuncAttribute funcAttr)
9494
{

0 commit comments

Comments
 (0)