1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-21 11:27:38 +03:00

ShipID can be zero

This commit is contained in:
Jonathan Harris 2017-06-20 01:05:23 +01:00
parent 1eae133ed5
commit 65970dec03
2 changed files with 3 additions and 3 deletions

@ -447,7 +447,7 @@ class AppWindow:
elif ((auto_update and not data['commander'].get('docked')) or
(monitor.system and data['lastSystem']['name'] != monitor.system) or
(monitor.station and data['lastStarport']['name'] != monitor.station) or
(monitor.state['ShipID'] and data['ship']['id'] != monitor.state['ShipID']) or
(monitor.state['ShipID'] is not None and data['ship']['id'] != monitor.state['ShipID']) or
(monitor.state['ShipType'] and data['ship']['name'].lower() != monitor.state['ShipType'])):
raise companion.ServerLagging()
@ -820,7 +820,7 @@ class AppWindow:
self.status['text'] = _("Where are you?!") # Shouldn't happen
elif not data.get('ship') or not data['ship'].get('modules') or not data['ship'].get('name','').strip():
self.status['text'] = _("What are you flying?!") # Shouldn't happen
elif (monitor.state['ShipID'] and data['ship']['id'] != monitor.state['ShipID']) or (monitor.state['ShipType'] and data['ship']['name'].lower() != monitor.state['ShipType']):
elif (monitor.state['ShipID'] is not None and data['ship']['id'] != monitor.state['ShipID']) or (monitor.state['ShipType'] and data['ship']['name'].lower() != monitor.state['ShipType']):
self.status['text'] = _('Error: Server is lagging') # Raised when Companion API server is returning old data, e.g. when the servers are too busy
else:
self.status['text'] = ''

@ -187,7 +187,7 @@ class EDSM:
)
if coordinates:
args += '&x=%.3f&y=%.3f&z=%.3f' % coordinates
if shipid:
if shipid is not None:
args += '&shipId=%d' % shipid
reply = self.call('api-logs-v1/set-log', args)