提交记录修改Core/Servicers/Instances/Sleepdiscover.cs+7 −5看文件
| @@ -54,11 +54,11 @@ namespace Core.Servicers.Instances | ||
| 54 | 54 | if (e.Reason == SessionSwitchReason.RemoteDisconnect || e.Reason == SessionSwitchReason.ConsoleDisconnect) |
| 55 | 55 | { |
| 56 | 56 | // 与这台设备远程桌面连接断开 |
| 57 | 删除: Debug.WriteLine("与这台设备远程桌面连接断开"); | |
| 58 | 57 | if (status == SleepStatus.Wake) |
| 59 | 58 | { |
| 60 | 59 | status = SleepStatus.Sleep; |
| 61 | 60 | SleepStatusChanged?.Invoke(status); |
| 61 | 新增: Logger.Warn("与这台设备远程桌面连接断开"); | |
| 62 | 62 | } |
| 63 | 63 | } |
| 64 | 64 | } |
| @@ -89,20 +89,22 @@ namespace Core.Servicers.Instances | ||
| 89 | 89 | switch (e.Mode) |
| 90 | 90 | { |
| 91 | 91 | case PowerModes.Suspend: |
| 92 | 删除: //电脑休眠 | |
| 92 | 新增: // 电脑休眠 | |
| 93 | 93 | if (status == SleepStatus.Wake) |
| 94 | 94 | { |
| 95 | 95 | status = SleepStatus.Sleep; |
| 96 | 96 | SleepStatusChanged?.Invoke(status); |
| 97 | 新增: Logger.Warn("设备已休眠"); | |
| 97 | 98 | } |
| 98 | 99 | break; |
| 99 | 100 | case PowerModes.Resume: |
| 100 | 删除: //电脑恢复 | |
| 101 | 新增: // 电脑恢复 | |
| 101 | 102 | if (status == SleepStatus.Sleep) |
| 102 | 103 | { |
| 103 | 104 | playSoundStartTime = DateTime.MinValue; |
| 104 | 105 | status = SleepStatus.Wake; |
| 105 | 106 | SleepStatusChanged?.Invoke(status); |
| 107 | 新增: Logger.Warn("设备已恢复"); | |
| 106 | 108 | } |
| 107 | 109 | break; |
| 108 | 110 | } |
| @@ -197,9 +199,9 @@ namespace Core.Servicers.Instances | ||
| 197 | 199 | { |
| 198 | 200 | // 超过表示可能睡着了,切换状态 |
| 199 | 201 | status = SleepStatus.Sleep; |
| 202 | 新增: Logger.Info("[sleep] [1] time:" + timeSpan.TotalHours + ",start:" + playSoundStartTime); | |
| 200 | 203 | |
| 201 | 204 | playSoundStartTime = DateTime.MinValue; |
| 202 | 删除: Logger.Info("[sleep] [1] time:" + timeSpan.TotalHours + ",start:" + playSoundStartTime); | |
| 203 | 205 | SleepStatusChanged?.Invoke(status); |
| 204 | 206 | } |
| 205 | 207 | } |
| @@ -210,7 +212,7 @@ namespace Core.Servicers.Instances | ||
| 210 | 212 | { |
| 211 | 213 | // 没有播放声音且键盘休眠超时 |
| 212 | 214 | status = SleepStatus.Sleep; |
| 213 | 删除: Logger.Info("[sleep] [2]"); | |
| 215 | 新增: Logger.Info("[sleep] [2] " + pressKeyboardLastTime); | |
| 214 | 216 | |
| 215 | 217 | SleepStatusChanged?.Invoke(status); |
| 216 | 218 | } |

