Skip to content

Commit ca7d533

Browse files
committed
[修改]1. 修改ActorID的Session处理
1 parent d234561 commit ca7d533

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

GameFrameX.Launcher/Common/Session/SessionManager.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ public static void KickOffLineByUserId(long roleId)
4040
var roleSession = SessionMap.Values.FirstOrDefault(m => m.RoleId == roleId);
4141
if (roleSession != null)
4242
{
43-
if (SessionMap.TryRemove(roleSession.Id, out var value) && ActorManager.HasActor(roleSession.RoleId))
43+
if (SessionMap.TryRemove(roleSession.Id, out var value) && ActorManager.HasActor(roleSession.ActorId))
4444
{
45-
EventDispatcher.Dispatch(roleSession.RoleId, (int)EventId.SessionRemove);
45+
EventDispatcher.Dispatch(roleSession.ActorId, (int)EventId.SessionRemove);
4646
}
4747
}
4848
}
@@ -63,9 +63,9 @@ public static Session Get(string sessionId)
6363
/// <param name="sessionId">链接ID</param>
6464
public static Session Remove(string sessionId)
6565
{
66-
if (SessionMap.TryRemove(sessionId, out var value) && ActorManager.HasActor(value.RoleId))
66+
if (SessionMap.TryRemove(sessionId, out var value) && ActorManager.HasActor(value.ActorId))
6767
{
68-
EventDispatcher.Dispatch(value.RoleId, (int)EventId.SessionRemove);
68+
EventDispatcher.Dispatch(value.ActorId, (int)EventId.SessionRemove);
6969
}
7070

7171
return value;
@@ -79,9 +79,9 @@ public static Task RemoveAll()
7979
{
8080
foreach (var session in SessionMap.Values)
8181
{
82-
if (ActorManager.HasActor(session.RoleId))
82+
if (ActorManager.HasActor(session.ActorId))
8383
{
84-
EventDispatcher.Dispatch(session.RoleId, (int)EventId.SessionRemove);
84+
EventDispatcher.Dispatch(session.ActorId, (int)EventId.SessionRemove);
8585
}
8686
}
8787

0 commit comments

Comments
 (0)