From 8c9e9e4117df2573a287a75d93f48802a51da32c Mon Sep 17 00:00:00 2001 From: YDL <1368269699@QQ.COM> Date: Fri, 23 Sep 2022 11:05:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=88=BF=E4=B8=BB=E8=BF=9B=E5=85=A5=E6=88=BF?= =?UTF-8?q?=E9=97=B4=E4=B8=8D=E9=9C=80=E8=A6=81=E5=AF=86=E7=A0=81=E9=AA=8C?= =?UTF-8?q?=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AX.WebDrillServer/Hubs/FireDeductionHub.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/AX.WebDrillServer/Hubs/FireDeductionHub.cs b/AX.WebDrillServer/Hubs/FireDeductionHub.cs index 0895d37..a96ba61 100644 --- a/AX.WebDrillServer/Hubs/FireDeductionHub.cs +++ b/AX.WebDrillServer/Hubs/FireDeductionHub.cs @@ -126,26 +126,29 @@ namespace AX.WebDrillServer.Hubs resultData.enterResult = RoomEnterResult.NoUserExist; return resultData; } - var roomHas = roomManager.GetRoom(enterInfo.RoomId, enterInfo.Password); - if (roomHas != null)//获取到要进入的房间跟用户信息 + if (enterInfo.UserId == room.Owner)//房主免密 + { + enterInfo.Password = room.Password; + } + if (enterInfo.Password == room.Password) { roomManager.AddUser(user); - user.RoomId = roomHas.RoomId; + user.RoomId = room.RoomId; RoommateChangeData data = new() { ChangeType = RoommateChangeType.Add, FireDeductionUser = user, - FireDeductionUsers = roomHas.Users + FireDeductionUsers = room.Users }; //通知web端刷新房间用户列表 - await Clients.Group(roomHas.RoomId).SendAsync("callWeb_changeRoomate", data); + await Clients.Group(room.RoomId).SendAsync("callWeb_changeRoomate", data); - resultData.RoomId = roomHas.RoomId; + resultData.RoomId = room.RoomId; resultData.enterResult = RoomEnterResult.Success; return resultData; } else - { + {//密码错误 resultData.enterResult = RoomEnterResult.RoomError; return resultData; }