|
|
|
@ -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; |
|
|
|
|
} |
|
|
|
|