mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-03 09:01:13 +03:00
Don't send ship info to EDSM if EDSM sync not requested or on a crew
Fixes #280
This commit is contained in:
parent
17f89afa0d
commit
7d022016fe
@ -191,8 +191,10 @@ def journal_entry(cmdr, is_beta, system, station, entry, state):
|
|||||||
this.lastlookup = False
|
this.lastlookup = False
|
||||||
this.system.update_idletasks()
|
this.system.update_idletasks()
|
||||||
|
|
||||||
|
this.multicrew = bool(state['Role'])
|
||||||
|
|
||||||
# Send interesting events to EDSM
|
# Send interesting events to EDSM
|
||||||
if config.getint('edsm_out') and not is_beta and not state['Role'] and credentials(cmdr) and entry['event'] not in this.discardedEvents:
|
if config.getint('edsm_out') and not is_beta and not this.multicrew and credentials(cmdr) and entry['event'] not in this.discardedEvents:
|
||||||
# Introduce transient states into the event
|
# Introduce transient states into the event
|
||||||
transient = {
|
transient = {
|
||||||
'_systemName': system,
|
'_systemName': system,
|
||||||
@ -242,17 +244,18 @@ def cmdr_data(data, is_beta):
|
|||||||
this.system.update_idletasks()
|
this.system.update_idletasks()
|
||||||
|
|
||||||
# Send ship info to EDSM
|
# Send ship info to EDSM
|
||||||
ship = companion.ship(data)
|
if config.getint('edsm_out') and not is_beta and not this.multicrew and credentials(data['commander']['name']):
|
||||||
if ship != this.lastship:
|
ship = companion.ship(data)
|
||||||
cmdr = data['commander']['name']
|
if ship != this.lastship:
|
||||||
timestamp = time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime())
|
cmdr = data['commander']['name']
|
||||||
this.queue.put((cmdr, {
|
timestamp = time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime())
|
||||||
'event': 'Coriolis', 'timestamp': timestamp, '_shipId': data['ship']['id'], 'url': coriolis.url(data, is_beta)
|
this.queue.put((cmdr, {
|
||||||
}))
|
'event': 'Coriolis', 'timestamp': timestamp, '_shipId': data['ship']['id'], 'url': coriolis.url(data, is_beta)
|
||||||
this.queue.put((cmdr, {
|
}))
|
||||||
'event': 'EDShipyard', 'timestamp': timestamp, '_shipId': data['ship']['id'], 'url': edshipyard.url(data, is_beta)
|
this.queue.put((cmdr, {
|
||||||
}))
|
'event': 'EDShipyard', 'timestamp': timestamp, '_shipId': data['ship']['id'], 'url': edshipyard.url(data, is_beta)
|
||||||
this.lastship = ship
|
}))
|
||||||
|
this.lastship = ship
|
||||||
|
|
||||||
|
|
||||||
# Worker thread
|
# Worker thread
|
||||||
|
Loading…
x
Reference in New Issue
Block a user