Skip to content

Commit

Permalink
[修改]1. 修改Actor的处理
Browse files Browse the repository at this point in the history
  • Loading branch information
AlianBlank committed Nov 18, 2024
1 parent 4103be5 commit e3fd024
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion GameFrameX.Core/Actors/Actor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public Actor(long id, ActorType type)
Type = type;
WorkerActor = new WorkerActor(id);

if (type == ActorType.Player)
if (type < ActorType.Separator)
{
Tell(() => SetAutoRecycle(true));
}
Expand Down
6 changes: 3 additions & 3 deletions GameFrameX.Core/Actors/ActorManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static Task<T> GetComponentAgent<T>() where T : IComponentAgent
internal static async Task<Actor> GetOrNew(long actorId)
{
var actorType = ActorIdGenerator.GetActorType(actorId);
if (actorType == ActorType.Player)
if (actorType < ActorType.Separator)
{
var now = DateTime.Now;
if (ActiveTimeDic.TryGetValue(actorId, out var activeTime)
Expand Down Expand Up @@ -278,7 +278,7 @@ public static Task RoleCrossDay(int openServerDay)
{
foreach (var actor in ActorMap.Values)
{
if (actor.Type == ActorType.Player)
if (actor.Type < ActorType.Separator)
{
actor.Tell(() => actor.CrossDay(openServerDay));
}
Expand Down Expand Up @@ -339,7 +339,7 @@ async Task Work()
b = 0;
foreach (var actor in ActorMap.Values)
{
if (actor.Type < ActorType.Separator && actor.Type != ActorType.Player)
if (actor.Type > ActorType.Separator)
{
b++;

Expand Down
2 changes: 1 addition & 1 deletion GameFrameX.Core/Components/ComponentRegister.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public static Task Init(Assembly assembly = null)

ComponentActorDic[type] = actorType;

if (actorType == ActorType.Player)
if (actorType < ActorType.Separator)
{
if (type.GetCustomAttribute(typeof(FuncAttribute)) is FuncAttribute funcAttr)
{
Expand Down

0 comments on commit e3fd024

Please sign in to comment.