Skip to content

Commit

Permalink
BUG修复: 修复如果在服务器排队时打开软件, 会因connector超过最大重试次数而报错的问题 Zzaphkiel#157
Browse files Browse the repository at this point in the history
  • Loading branch information
Hpero4 committed Jan 6, 2024
1 parent 9f0742d commit b4a2672
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
11 changes: 5 additions & 6 deletions app/lol/listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,20 @@ class LolProcessExistenceListener(QThread):

def __init__(self, tasklistPath, parent):
self.tasklistPath = tasklistPath
self.isClientRunning = False

super().__init__(parent)

def run(self):
isRunning = False

while True:
pid = getLolProcessPid(self.tasklistPath)
if pid != 0:
if not isRunning:
isRunning = True
if not self.isClientRunning:
self.isClientRunning = True
self.lolClientStarted.emit(pid)
else:
if isRunning and not isLolGameProcessExist():
isRunning = False
if self.isClientRunning and not isLolGameProcessExist():
self.isClientRunning = False
self.lolClientEnded.emit()

self.msleep(2000)
Expand Down
1 change: 1 addition & 0 deletions app/view/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ def _():
except RetryMaximumAttempts:
# 若超出最大尝试次数, 则认为lcu未就绪(如大区排队中), 捕获到该异常时不抛出, 等待下一个emit
connector.close()
self.processListener.isClientRunning = False
return

self.isClientProcessRunning = True
Expand Down

0 comments on commit b4a2672

Please sign in to comment.