mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-18 09:57:40 +03:00
Look for logs in Elite Dangerous: Horizons folder.
This commit is contained in:
parent
6df3ab72e8
commit
90fc174181
32
monitor.py
32
monitor.py
@ -177,7 +177,7 @@ class EDLogs(FileSystemEventHandler):
|
|||||||
self.logfile = event.src_path
|
self.logfile = event.src_path
|
||||||
|
|
||||||
def worker(self):
|
def worker(self):
|
||||||
# e.g. "{18:11:44} System:22(Gamma Doradus) Body:3 Pos:(3.69928e+07,1.13173e+09,-1.75892e+08) \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:')
|
||||||
|
|
||||||
@ -277,13 +277,14 @@ class EDLogs(FileSystemEventHandler):
|
|||||||
if not RegQueryValueEx(subkey, 'InstallLocation', 0, ctypes.byref(valtype), None, ctypes.byref(valsize)) and valtype.value == REG_SZ:
|
if not RegQueryValueEx(subkey, 'InstallLocation', 0, ctypes.byref(valtype), None, ctypes.byref(valsize)) and valtype.value == REG_SZ:
|
||||||
valbuf = ctypes.create_unicode_buffer(valsize.value / 2)
|
valbuf = ctypes.create_unicode_buffer(valsize.value / 2)
|
||||||
if not RegQueryValueEx(subkey, 'InstallLocation', 0, ctypes.byref(valtype), valbuf, ctypes.byref(valsize)):
|
if not RegQueryValueEx(subkey, 'InstallLocation', 0, ctypes.byref(valtype), valbuf, ctypes.byref(valsize)):
|
||||||
custpath = join(valbuf.value, 'Products')
|
base = join(valbuf.value, 'Products')
|
||||||
if isdir(custpath):
|
if isdir(base):
|
||||||
for d in listdir(custpath):
|
for game in ['elite-dangerous-64', 'FORC-FDEV-D-1']: # Assume Horizons if both found
|
||||||
if d.startswith('FORC-FDEV-D-1') and isfile(join(custpath, d, 'AppConfig.xml')) and isdir(join(custpath, d, 'Logs')):
|
for d in listdir(base):
|
||||||
RegCloseKey(subkey)
|
if d.startswith(game) and isfile(join(base, d, 'AppConfig.xml')) and isdir(join(base, d, 'Logs')):
|
||||||
RegCloseKey(key)
|
RegCloseKey(subkey)
|
||||||
return join(custpath, d, 'Logs')
|
RegCloseKey(key)
|
||||||
|
return join(base, d, 'Logs')
|
||||||
RegCloseKey(subkey)
|
RegCloseKey(subkey)
|
||||||
i += 1
|
i += 1
|
||||||
RegCloseKey(key)
|
RegCloseKey(key)
|
||||||
@ -293,13 +294,14 @@ class EDLogs(FileSystemEventHandler):
|
|||||||
ctypes.windll.shell32.SHGetSpecialFolderPathW(0, programs, CSIDL_PROGRAM_FILESX86, 0)
|
ctypes.windll.shell32.SHGetSpecialFolderPathW(0, programs, CSIDL_PROGRAM_FILESX86, 0)
|
||||||
applocal = ctypes.create_unicode_buffer(MAX_PATH)
|
applocal = ctypes.create_unicode_buffer(MAX_PATH)
|
||||||
ctypes.windll.shell32.SHGetSpecialFolderPathW(0, applocal, CSIDL_LOCAL_APPDATA, 0)
|
ctypes.windll.shell32.SHGetSpecialFolderPathW(0, applocal, CSIDL_LOCAL_APPDATA, 0)
|
||||||
for base in [join(programs.value, 'Steam', 'steamapps', 'common', 'Elite Dangerous', 'Products'),
|
for game in ['elite-dangerous-64', 'FORC-FDEV-D-1']: # Assume Horizons if both found
|
||||||
join(programs.value, 'Frontier', 'Products'),
|
for base in [join(programs.value, 'Steam', 'steamapps', 'common', 'Elite Dangerous', 'Products'),
|
||||||
join(applocal.value, 'Frontier_Developments', 'Products')]:
|
join(programs.value, 'Frontier', 'Products'),
|
||||||
if isdir(base):
|
join(applocal.value, 'Frontier_Developments', 'Products')]:
|
||||||
for d in listdir(base):
|
if isdir(base):
|
||||||
if d.startswith('FORC-FDEV-D-1') and isfile(join(base, d, 'AppConfig.xml')) and isdir(join(base, d, 'Logs')):
|
for d in listdir(base):
|
||||||
return join(base, d, 'Logs')
|
if d.startswith(game) and isfile(join(base, d, 'AppConfig.xml')) and isdir(join(base, d, 'Logs')):
|
||||||
|
return join(base, d, 'Logs')
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user