private void HandleEnterRoom(ClientPeer client) { if (Sessions.matchSession.IsMatching(client)) // 已在队列中则不管 { return; } //先进入房间 MatchRoom room = Sessions.matchSession.EnterRoom(client); UserInfoDto userInfoDto = DatabaseManager.CreateUserInfoDto(client.userId); //然后向其他房间内用户广播进入房间信息 room.Broadcast(OpCode.match, MatchCode.EnterBrd, userInfoDto, client); //最后向客户端返回当前的房间信息 MatchRoomDto matchRoomDto = room.CreateMatchRoomDto(); client.SendNetMsg(OpCode.match, MatchCode.EnterSRes, matchRoomDto); }