Skip to content

Commit

Permalink
[修改]1. 修改ActorID的Session处理
Browse files Browse the repository at this point in the history
  • Loading branch information
AlianBlank committed Aug 21, 2024
1 parent d234561 commit ca7d533
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions GameFrameX.Launcher/Common/Session/SessionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand All @@ -63,9 +63,9 @@ public static Session Get(string sessionId)
/// <param name="sessionId">链接ID</param>
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;
Expand All @@ -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);
}
}

Expand Down

0 comments on commit ca7d533

Please sign in to comment.