mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-03 17:10:59 +03:00
Log server lagging
This commit is contained in:
parent
8e233fdeaf
commit
e314f64464
@ -448,7 +448,7 @@ class AppWindow:
|
|||||||
raise companion.CmdrError() # Companion API return doesn't match Journal
|
raise companion.CmdrError() # Companion API return doesn't match Journal
|
||||||
elif ((auto_update and not data['commander'].get('docked')) or
|
elif ((auto_update and not data['commander'].get('docked')) or
|
||||||
(data['lastSystem']['name'] != monitor.system) or
|
(data['lastSystem']['name'] != monitor.system) or
|
||||||
((monitor.station or data['commander']['docked']) and data['lastStarport']['name'] != monitor.station) or
|
((data['commander']['docked'] and data['lastStarport']['name'] or None) != monitor.station) or
|
||||||
(data['ship']['id'] != monitor.state['ShipID']) or
|
(data['ship']['id'] != monitor.state['ShipID']) or
|
||||||
(data['ship']['name'].lower() != monitor.state['ShipType'])):
|
(data['ship']['name'].lower() != monitor.state['ShipType'])):
|
||||||
raise companion.ServerLagging()
|
raise companion.ServerLagging()
|
||||||
@ -483,7 +483,7 @@ class AppWindow:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
elif not data['commander'].get('docked'):
|
elif not data['commander'].get('docked'):
|
||||||
if not event and not retrying:
|
if auto_update and not retrying:
|
||||||
# Silently retry if we got here by 'Automatically update on docking' and the server hasn't caught up
|
# Silently retry if we got here by 'Automatically update on docking' and the server hasn't caught up
|
||||||
self.w.after(int(SERVER_RETRY * 1000), lambda:self.getandsend(event, True))
|
self.w.after(int(SERVER_RETRY * 1000), lambda:self.getandsend(event, True))
|
||||||
return # early exit to avoid starting cooldown count
|
return # early exit to avoid starting cooldown count
|
||||||
@ -536,6 +536,7 @@ class AppWindow:
|
|||||||
# Companion API problem
|
# Companion API problem
|
||||||
except (companion.ServerError, companion.ServerLagging) as e:
|
except (companion.ServerError, companion.ServerLagging) as e:
|
||||||
if retrying:
|
if retrying:
|
||||||
|
print 'Lagging: %s,%s != %s,%s' % (data['lastSystem']['name'], data['commander']['docked'] and data['lastStarport']['name'] or 'undocked', monitor.system, monitor.station)
|
||||||
self.status['text'] = unicode(e)
|
self.status['text'] = unicode(e)
|
||||||
play_bad = True
|
play_bad = True
|
||||||
else:
|
else:
|
||||||
|
@ -392,8 +392,8 @@ class EDLogs(FileSystemEventHandler):
|
|||||||
self.coordinates = tuple(entry['StarPos'])
|
self.coordinates = tuple(entry['StarPos'])
|
||||||
elif self.system != entry['StarSystem']:
|
elif self.system != entry['StarSystem']:
|
||||||
self.coordinates = None # Docked event doesn't include coordinates
|
self.coordinates = None # Docked event doesn't include coordinates
|
||||||
self.system = entry['StarSystem'] == 'ProvingGround' and 'CQC' or entry['StarSystem']
|
(self.system, self.station) = (entry['StarSystem'] == 'ProvingGround' and 'CQC' or entry['StarSystem'],
|
||||||
self.station = entry.get('StationName') # May be None
|
entry.get('StationName')) # May be None
|
||||||
self.stationtype = entry.get('StationType') # May be None
|
self.stationtype = entry.get('StationType') # May be None
|
||||||
elif entry['event'] == 'SupercruiseExit':
|
elif entry['event'] == 'SupercruiseExit':
|
||||||
self.planet = entry.get('Body') if entry.get('BodyType') == 'Planet' else None
|
self.planet = entry.get('Body') if entry.get('BodyType') == 'Planet' else None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user