| | |
| | | IO.FileUtils.WriteFileByBytes (roomListFilePath, System.Text.Encoding.UTF8.GetBytes (Newtonsoft.Json.JsonConvert.SerializeObject (roomFilePathList))); |
| | | } |
| | | |
| | | //2021-12-23 遍历所有文件找出所有的房间,解决调试软件上传后保留之前的设备列表 |
| | | var allFiles = IO.FileUtils.ReadFiles (); |
| | | var allRoomList = allFiles.FindAll ((obj) => obj.StartsWith("Room_")); |
| | | bool isHaveNewRoom = false; |
| | | foreach (var roomPath in allRoomList) { |
| | | if (!roomFilePathList.Contains (roomPath)) { |
| | | Utlis.WriteLine("发现新的房间:"+ roomPath); |
| | | roomFilePathList.Add (roomPath); |
| | | isHaveNewRoom = true; |
| | | } |
| | | } |
| | | if (isHaveNewRoom) { |
| | | Utlis.WriteLine ("有新的房间,重新保存一次最新的房间列表"); |
| | | IO.FileUtils.WriteFileByBytes (roomListFilePath, System.Text.Encoding.UTF8.GetBytes (Newtonsoft.Json.JsonConvert.SerializeObject (roomFilePathList))); |
| | | } |
| | | |
| | | foreach (var roomFilePath in roomFilePathList) { |
| | | var room = GetRoomByFilePath (roomFilePath); |
| | | if (null != room) { |