mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-07 19:03:23 +03:00
Don't auto update System while in CQC.
This commit is contained in:
parent
5a63f3172c
commit
31d1f02043
11
monitor.py
11
monitor.py
@ -182,6 +182,9 @@ class EDLogs(FileSystemEventHandler):
|
|||||||
# e.g. "{18:11:44} System:22(Gamma Doradus) Body:3 Pos:(3.69928e+07,1.13173e+09,-1.75892e+08) \r\n" or "... NormalFlight\r\n" or "... Supercruise\r\n"
|
# e.g. "{18:11:44} System:22(Gamma Doradus) Body:3 Pos:(3.69928e+07,1.13173e+09,-1.75892e+08) \r\n" or "... NormalFlight\r\n" or "... Supercruise\r\n"
|
||||||
# Note that system name may contain parantheses, e.g. "Pipe (stem) Sector PI-T c3-5".
|
# Note that system name may contain parantheses, e.g. "Pipe (stem) Sector PI-T c3-5".
|
||||||
regexp = re.compile(r'\{(.+)\} System:\d+\((.+)\) Body:')
|
regexp = re.compile(r'\{(.+)\} System:\d+\((.+)\) Body:')
|
||||||
|
regexp_cqc = re.compile(r'\{.+\} \[PG\] (.+)')
|
||||||
|
|
||||||
|
cqc = False
|
||||||
|
|
||||||
# Seek to the end of the latest log file
|
# Seek to the end of the latest log file
|
||||||
logfile = self.logfile
|
logfile = self.logfile
|
||||||
@ -199,12 +202,20 @@ class EDLogs(FileSystemEventHandler):
|
|||||||
if loghandle:
|
if loghandle:
|
||||||
loghandle.close()
|
loghandle.close()
|
||||||
loghandle = open(logfile, 'rt')
|
loghandle = open(logfile, 'rt')
|
||||||
|
cqc = False
|
||||||
|
|
||||||
if logfile:
|
if logfile:
|
||||||
system = visited = None
|
system = visited = None
|
||||||
loghandle.seek(0, 1) # reset EOF flag
|
loghandle.seek(0, 1) # reset EOF flag
|
||||||
|
|
||||||
for line in loghandle:
|
for line in loghandle:
|
||||||
|
match = regexp_cqc.match(line)
|
||||||
|
if match:
|
||||||
|
if 'Joined a gameplay lobby' in match.group(1) or 'Created playlist lobby' in match.group(1) or 'Found matchmaking lobby object' in match.group(1):
|
||||||
|
cqc = True
|
||||||
|
elif 'Left a playlist lobby' in match.group(1) or 'Destroying playlist lobby' in match.group(1):
|
||||||
|
cqc = False
|
||||||
|
elif not cqc:
|
||||||
match = regexp.match(line)
|
match = regexp.match(line)
|
||||||
if match:
|
if match:
|
||||||
system, visited = match.group(2), match.group(1)
|
system, visited = match.group(2), match.group(1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user