Send ship id to EDSM on sale

This commit is contained in:
Jonathan Harris committed 2016-10-28 11:56:36 +01:00
1 parent 70e9976a34
commit e8d93979f0
2 files changed
+6

No files matched your search

+2
View File
@@ -529,6 +529,8 @@ class AppWindow:
# Send ship info to EDSM on startup or change
if entry['event'] in [None, 'LoadGame', 'ShipyardNew', 'ShipyardSwap']:
self.edsm.setshipid(monitor.shipid)
elif entry['event'] in ['ShipyardBuy', 'ShipyardSell']:
self.edsm.sellship(entry.get('SellShipID'))
# Write EDSM log on change
if monitor.mode and entry['event'] in ['Location', 'FSDJump']:
+4
View File
@@ -171,3 +171,7 @@ class EDSM:
def setshipid(self, shipid):
if shipid is not None:
self.call('api-commander-v1/set-ship-id', '&shipId=%d' % shipid)
def sellship(self, shipid):
if shipid is not None:
self.call('api-commander-v1/sell-ship', '&shipId=%d' % shipid)