mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-06 10:23:06 +03:00
Send ship id to EDSM on sale
This commit is contained in:
parent
70e9976a34
commit
e8d93979f0
@ -529,6 +529,8 @@ class AppWindow:
|
|||||||
# Send ship info to EDSM on startup or change
|
# Send ship info to EDSM on startup or change
|
||||||
if entry['event'] in [None, 'LoadGame', 'ShipyardNew', 'ShipyardSwap']:
|
if entry['event'] in [None, 'LoadGame', 'ShipyardNew', 'ShipyardSwap']:
|
||||||
self.edsm.setshipid(monitor.shipid)
|
self.edsm.setshipid(monitor.shipid)
|
||||||
|
elif entry['event'] in ['ShipyardBuy', 'ShipyardSell']:
|
||||||
|
self.edsm.sellship(entry.get('SellShipID'))
|
||||||
|
|
||||||
# Write EDSM log on change
|
# Write EDSM log on change
|
||||||
if monitor.mode and entry['event'] in ['Location', 'FSDJump']:
|
if monitor.mode and entry['event'] in ['Location', 'FSDJump']:
|
||||||
|
4
edsm.py
4
edsm.py
@ -171,3 +171,7 @@ class EDSM:
|
|||||||
def setshipid(self, shipid):
|
def setshipid(self, shipid):
|
||||||
if shipid is not None:
|
if shipid is not None:
|
||||||
self.call('api-commander-v1/set-ship-id', '&shipId=%d' % shipid)
|
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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user