diff --git a/AX.WebDrillServer/Hubs/FireDeductionHub.cs b/AX.WebDrillServer/Hubs/FireDeductionHub.cs index a96ba61..1499ccc 100644 --- a/AX.WebDrillServer/Hubs/FireDeductionHub.cs +++ b/AX.WebDrillServer/Hubs/FireDeductionHub.cs @@ -92,7 +92,7 @@ namespace AX.WebDrillServer.Hubs //user.RoomId = room.RoomId; //room.Users.Add(user); - await Groups.AddToGroupAsync(user.ConnectionId, room.RoomId); + //await Groups.AddToGroupAsync(user.ConnectionId, room.RoomId); await Clients.All.SendAsync("callWeb_refreshRoomList", roomManager.GetAllRooms()); resultData.CreatedRoom = roomManager.RoomToInfo(room); @@ -140,6 +140,8 @@ namespace AX.WebDrillServer.Hubs FireDeductionUser = user, FireDeductionUsers = room.Users }; + //添加到通讯组中 + await Groups.AddToGroupAsync(user.ConnectionId, room.RoomId); //通知web端刷新房间用户列表 await Clients.Group(room.RoomId).SendAsync("callWeb_changeRoomate", data); @@ -191,6 +193,8 @@ namespace AX.WebDrillServer.Hubs FireDeductionUser = user, FireDeductionUsers = room.Users }; + //从通讯组中移出 + await Groups.RemoveFromGroupAsync(user.ConnectionId, room.RoomId); //通知web端刷新房间用户列表 await Clients.Group(room.RoomId).SendAsync("callWeb_changeRoomate", data);