From ca7d533fb27acaa2e15e615ea84c18331fc37332 Mon Sep 17 00:00:00 2001 From: Blank Date: Wed, 21 Aug 2024 18:35:32 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E6=94=B9]1.=20=E4=BF=AE=E6=94=B9Acto?= =?UTF-8?q?rID=E7=9A=84Session=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GameFrameX.Launcher/Common/Session/SessionManager.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/GameFrameX.Launcher/Common/Session/SessionManager.cs b/GameFrameX.Launcher/Common/Session/SessionManager.cs index b0ee6b9..caf97b1 100644 --- a/GameFrameX.Launcher/Common/Session/SessionManager.cs +++ b/GameFrameX.Launcher/Common/Session/SessionManager.cs @@ -40,9 +40,9 @@ public static void KickOffLineByUserId(long roleId) var roleSession = SessionMap.Values.FirstOrDefault(m => m.RoleId == roleId); if (roleSession != null) { - if (SessionMap.TryRemove(roleSession.Id, out var value) && ActorManager.HasActor(roleSession.RoleId)) + if (SessionMap.TryRemove(roleSession.Id, out var value) && ActorManager.HasActor(roleSession.ActorId)) { - EventDispatcher.Dispatch(roleSession.RoleId, (int)EventId.SessionRemove); + EventDispatcher.Dispatch(roleSession.ActorId, (int)EventId.SessionRemove); } } } @@ -63,9 +63,9 @@ public static Session Get(string sessionId) /// 链接ID public static Session Remove(string sessionId) { - if (SessionMap.TryRemove(sessionId, out var value) && ActorManager.HasActor(value.RoleId)) + if (SessionMap.TryRemove(sessionId, out var value) && ActorManager.HasActor(value.ActorId)) { - EventDispatcher.Dispatch(value.RoleId, (int)EventId.SessionRemove); + EventDispatcher.Dispatch(value.ActorId, (int)EventId.SessionRemove); } return value; @@ -79,9 +79,9 @@ public static Task RemoveAll() { foreach (var session in SessionMap.Values) { - if (ActorManager.HasActor(session.RoleId)) + if (ActorManager.HasActor(session.ActorId)) { - EventDispatcher.Dispatch(session.RoleId, (int)EventId.SessionRemove); + EventDispatcher.Dispatch(session.ActorId, (int)EventId.SessionRemove); } }