mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-14 00:07:14 +03:00
Update stations database from eddb.
But override eddb to always send market and outfitting data for planetary and "suspended" stations - https://community.elitedangerous.com/galnet/uid/568a999f9657ba5e0986a8de
This commit is contained in:
parent
62a786955d
commit
2fa300d6b1
12
eddb.py
12
eddb.py
@ -44,6 +44,10 @@ class EDDB:
|
||||
if __name__ == "__main__":
|
||||
import json
|
||||
|
||||
# still send market and outfitting for currently "suspended" stations -
|
||||
# https://community.elitedangerous.com/galnet/uid/568a999f9657ba5e0986a8de
|
||||
suspended = set([659, 39328, 5672, 30402, 30653, 21901, 11335])
|
||||
|
||||
# system_name by system_id
|
||||
systems = dict([(x['id'], str(x['name'])) for x in json.loads(open('systems.json').read())])
|
||||
|
||||
@ -59,6 +63,12 @@ if __name__ == "__main__":
|
||||
cPickle.dump(system_ids, open('systems.p', 'wb'), protocol = cPickle.HIGHEST_PROTOCOL)
|
||||
|
||||
# station_id by (system_id, station_name)
|
||||
station_ids = dict([((x['system_id'], str(x['name'])), (x['id'], (EDDB.HAS_MARKET if x['has_market'] else 0) | (EDDB.HAS_OUTFITTING if x['has_outfitting'] else 0) | (EDDB.HAS_SHIPYARD if x['has_shipyard'] else 0))) for x in stations])
|
||||
station_ids = dict([(
|
||||
(x['system_id'], str(x['name'])),
|
||||
(x['id'],
|
||||
(EDDB.HAS_MARKET if x['has_market'] or x['is_planetary'] or x['id'] in suspended else 0) |
|
||||
(EDDB.HAS_OUTFITTING if x['has_outfitting'] or x['is_planetary'] or x['id'] in suspended else 0) |
|
||||
(EDDB.HAS_SHIPYARD if x['has_shipyard'] else 0)))
|
||||
for x in stations])
|
||||
cPickle.dump(station_ids, open('stations.p', 'wb'), protocol = cPickle.HIGHEST_PROTOCOL)
|
||||
|
||||
|
BIN
stations.p
BIN
stations.p
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user