Skip to content

Commit

Permalink
修复了一个send协程锁队列导致的顺序问题
Browse files Browse the repository at this point in the history
  • Loading branch information
egametang committed Jul 17, 2024
1 parent 4b2e7c0 commit d0782e7
Showing 1 changed file with 1 addition and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,9 @@ private static async ETTask SendInner(this MessageLocationSenderOneType self, lo

Scene root = self.Root();

if (messageLocationSender.ActorId != default)
{
messageLocationSender.LastSendOrRecvTime = TimeInfo.Instance.ServerNow();
root.GetComponent<MessageSender>().Send(messageLocationSender.ActorId, message);
return;
}

long instanceId = messageLocationSender.InstanceId;

using (await root.Root().GetComponent<CoroutineLockComponent>().Wait(CoroutineLockType.MessageLocationSender, entityId))
using (await root.GetComponent<CoroutineLockComponent>().Wait(CoroutineLockType.MessageLocationSender, entityId))
{
if (messageLocationSender.InstanceId != instanceId)
{
Expand Down Expand Up @@ -140,12 +133,6 @@ public static async ETTask<IResponse> Call(this MessageLocationSenderOneType sel

Scene root = self.Root();

if (messageLocationSender.ActorId != default)
{
messageLocationSender.LastSendOrRecvTime = TimeInfo.Instance.ServerNow();
return await root.GetComponent<MessageSender>().Call(messageLocationSender.ActorId, request);
}

long instanceId = messageLocationSender.InstanceId;

using (await root.GetComponent<CoroutineLockComponent>().Wait(CoroutineLockType.MessageLocationSender, entityId))
Expand Down

0 comments on commit d0782e7

Please sign in to comment.