From 80305412ad87a5d1a9e3ce8ce19190ee4bdfdd40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Wed, 26 Jun 2024 22:59:01 +0800 Subject: [PATCH] vmpause --- LunaTranslator/LunaTranslator/LunaTranslator.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/LunaTranslator/LunaTranslator/LunaTranslator.py b/LunaTranslator/LunaTranslator/LunaTranslator.py index 8afb4e6e..ac654f32 100644 --- a/LunaTranslator/LunaTranslator/LunaTranslator.py +++ b/LunaTranslator/LunaTranslator/LunaTranslator.py @@ -906,8 +906,11 @@ class MAINUI: _t = time.time() def isok(gameuid): - savehook_new_data[gameuid]["statistic_playtime"] += _t - __t - if self.__currentexe == name_: + # 可能开着程序进行虚拟机暂停,导致一下子多了很多时间。不过测试vbox上应该没问题 + maybevmpaused = (_t - __t) > 60 + if not maybevmpaused: + savehook_new_data[gameuid]["statistic_playtime"] += _t - __t + if (not maybevmpaused) and (self.__currentexe == name_): self.traceplaytime( uid2gamepath[gameuid], self.__statistictime - 1, _t, False )