1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-17 17:42:20 +03:00

Send ship id to EDSM on sale

This commit is contained in:
Jonathan Harris 2016-10-28 00:26:59 +01:00
parent 70e9976a34
commit e8d93979f0
2 changed files with 6 additions and 0 deletions

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']:

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)