1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-13 07:47:14 +03:00

148 Commits

Author SHA1 Message Date
Athanasius
cd02d1664a Change EDDB system_url to use SystemAddress
* This means storing this.system_address from both cmdr_data and journal_entry.  NB: If the current value in the event or data is 'None' it will retain the previous value.  Without this Journal entries without SystemAddress erase the stored value.
 * The station_url() fallback to system_url() similarly uses this.system_address in the call.

Addresses #512
2020-07-01 15:51:14 +01:00
Athanasius
f6b3109a09 Remove the last of the {stations,systems}.p code from EDDB plugin
There is one tiny regression for a very, very corner case.

  In 3.46 if you use EDDB as the 'Station' provider and:

	1. Dock at Station A, in System X
	2. Jump out to System Y, which is also populated
	3. Exit out of the game
	4. (Re-)Start EDMC
	5. Hit 'Update' to manually trigger CAPI data retrieval

you will see a "×" character as the Station Name, and can click on it to
take you to the EDDB *System* page.  It is only there because of EDMC
using systems.p to check if System Y is populated.

  With this version in that circumstance there's no way to know that
System Y is populated, so the code assumes not and doesn't show the
"×", and thus there's nothing to click to go to the EDDB *System* page
for System Y.

  But so long as the user is actually running the game and EDMC together
then populated status is detected from Journal events and the "×" will
be there whenever you're undocked but in a populated system.
  Caveat: We know Frontier have allowed some systems that are
technically populated, but show a Population of zero.  This code assumes
that means they're *not* populated.
2020-07-01 15:51:14 +01:00
Athanasius
0541e404ec Track system population in monitor, and use in eddb
EDDB station link now triggers off this.system_population, which is
received via monitor passing 'Population' through in Startup, Location,
FSDJump and CarrierJump events.

  One fewer use cases for systems.p (populated status in this case).
2020-07-01 15:51:14 +01:00
Athanasius
ad81339495 Check eddb.system_name is set before attempting to quote it
urllib.parse.quote does *not* like being passed None.
2020-07-01 15:51:14 +01:00
Athanasius
6ed7590ba9 Update eddb.station_marketid from CarrierJump as well
This shouldn't actually be necessary, the marketid shouln't change
because of a jump, and would have been picked up from the other events
anyway, but it should do no harm to set it again from this.
2020-07-01 15:51:14 +01:00
Athanasius
2df8610e42 eddb: Ensure system_name is quoted for URL 2020-07-01 15:51:14 +01:00
Athanasius
1a11202aea Implement tracking station MarketID, and use in eddb plugin
* Adds monitor.station_marketid, tracked at the same points as
   monitor.station (name).
 * Changes EDDB plugin to also track its own this.station_marketid so
   that it can be used in /market-id/ EDDB URL.
   This removes a use case for stations.p file.
2020-07-01 15:51:14 +01:00
Athanasius
553c7980c1 Change EDDB system_url() to using by-name URL
This removes a use case for systems.p file
2020-07-01 15:51:14 +01:00
Athanasius
89f113e190 Use Preferences Save Serial Number instead of flag
* new class `PrefsVersion` in prefs.py.  A singleton `prefsSaved` (note
   case) is created.
 * When new preferences are added and require defaults on first run the
   code should use:

     `if prefsVersion.shouldSetDefaults(<prior release version>, [<optional old test>]):`

   to check if defaults should be set in preferences.  So if prior release
   was '3.4.6.0' and you've added a new preference with defaults you should
   call this with '3.4.6.0' as the first argument.
   The <optional old test> is really only for historical purposes, as a
   fallback in case no 'PrefsVersion' has yet been set in the user's
   Registry/settings file.
 * Any code that adds such a new preference **MUST** make changes to the
   `versions` dictionary in the PrefsVersion class.
     1. Add the predicted next version to the dictionary, with number one
        higher than 'current'
     2. Set 'current' equal to that new value.
   Obviously if other post-last-release code has already done this then you
   don't need to.

   Failure to update the versions dictionary in this manner will lead to an
   Exception being raised, and the code the preferences are for failing
   (i.e. EDDN means no EDDN tab on Settings).

Closes #407
2020-07-01 15:33:42 +01:00
Athanasius
63c2ff52e9 Fix an Output/EDDN option combination causing defaults to get re-set
Change Output and EDDN options to only get set to defaults if key 'PrefsDidSave' is not present and true.  This gets a value of 0x1 saved any time preferences are applied.

The issue was that if you had sufficient options set such that the saved 'output' value was 0x0 then that would evaluate to false and cause the defaults to get set.

Fixes #407
2020-06-29 14:32:25 +01:00
Athanasius
259bb3bbd6 Merge branch 'release-final-python27' into python3 2020-06-21 16:43:02 +01:00
Jonathan Harris
c62d110448 Plugin migration 2020-06-21 16:33:13 +01:00
Athanasius
6ff9dbc3bf plugins/edsy.py: De-future 2020-06-21 16:23:01 +01:00
Athanasius
02bcbf2685 plugins/eddb.py: De-future 2020-06-21 16:23:01 +01:00
Athanasius
4a7f4cd450 plugins/inara.py: De-future 2020-06-21 16:23:01 +01:00
Athanasius
35867cd3f9 plugins/edsm.py: De-future 2020-06-21 16:23:01 +01:00
Athanasius
93a65b02f5 plugins/eddn.py: De-future 2020-06-21 16:23:01 +01:00
Athanasius
143d6e717a plugins/eddn.py: De-future 2020-06-21 16:23:01 +01:00
Athanasius
faf5bee834 Fixes plugins/eddn massaging of economies and prohibited data 2020-06-21 16:23:00 +01:00
Athanasius
753fdedbdf Fixes plugins/coriolis.py to appear in settings, and confirms click-through works
*) Code and imports brought in line with edsy plugin
  *) 'Coriolis' now appears in Settings > Configuration > Shipyard
    dropdown
  *) Confirmed that with this active a valid build opens on coriolis.io
2020-06-21 16:23:00 +01:00
Athanasius
0d893c1c56 Gets plugins/edsy.py working. The usual string vs. bytes shenanigans. 2020-06-21 16:23:00 +01:00
Athanasius
ce460712e2 Ensure we definitely can add mandatory fields to EDDN messages
This came to light due to python3 not liking try['StarPos'] =
list(this.coordinates) if this.coordinates was None.  As the comment
says these three fields are mandatory, ensure we can actually set them
appropriately, and display an error if not.
2020-06-21 16:23:00 +01:00
Athanasius
bebc3648b8 plugins/inara.py: No need for encode('utf-8') 2020-06-21 16:23:00 +01:00
Athanasius
fd4acae9a5 plugins/eddn.py: encode() un-necessary 2020-06-21 16:23:00 +01:00
Athanasius
e73db981a8 Fixes EDDN sending to be working.
NB: Due to, I assume, EDDN relay de-duplication of messages, it's been
difficult to 100% test this.  No errors thrown, and stock/release EDMC
also doesn't result in a new message arriving at my EDDN consumer.
2020-06-21 16:23:00 +01:00
Athanasius
e7545e174f Use .items() instead of .iteritems() 2020-06-21 16:23:00 +01:00
Athanasius
90b05d22c5 Now runs without console errors so far as pressing 'Update' is concerned.
There's an error on the console about an iterator when doing so
though.
2020-06-21 16:23:00 +01:00
Bernd Gollesch
38ba48c713 added carrier data to CarrierJump event 2020-06-18 17:46:16 +01:00
Bernd Gollesch
098613ea0a There is now an api event for 'CarrierJump' -> 'addCommanderTravelCarrierJump' 2020-06-18 17:46:06 +01:00
Bernd Gollesch
02649b8c6f there is also a 'Factions' list in the 'CarrierJump' event 2020-06-18 17:44:22 +01:00
Bernd Gollesch
b45df6b4fd keep track of location if the carrier you're docked at jumps 2020-06-18 17:44:14 +01:00
Bernd Gollesch
8db229585d send 'CarrierJump' event to EDDN 2020-06-18 17:36:51 +01:00
Bernd Gollesch
690ef067b0 keep track of system location if fleet carrier jumps while docked 2020-06-18 17:35:35 +01:00
VAKazakov
994624d83b
changing division by int to float, as suggested 2020-03-05 11:52:34 +03:00
VAKazakov
1984e25e50
Fixing reputation values error
"Inara setCommanderReputationMinorFaction, The reputation value exceeds the valid range"
2020-03-04 22:43:47 +03:00
Jonathan Harris
034c0b5bd2 Send SAASignalsFound events to EDDN 2019-10-03 19:22:58 +01:00
Jonathan Harris
e9a23c67dc Send correct opponentName for Interdicted and Interdiction events
Fixes #459
2019-10-02 18:50:06 +01:00
Jonathan Harris
09de1adc91 Make replay file line-buffered (#448)
Squashed commit of the following:

commit d42bb0add648ba52e56dd03a48ef9e1d09fdbda0
Author: Jonathan Harris <jonathan@marginal.org.uk>
Date:   Fri Sep 13 19:36:14 2019 +0100

    Use line buffering when creating replay file.

commit 1b6e499e2c306b66708a9fd210d1db1771c4c78f
Author: Athanasius <github@miggy.org>
Date:   Thu Sep 12 17:30:59 2019 +0100

    Use line buffering for replay file.

      By default it takes a lot of data being written to the file for it to
    be flushed.  Or exiting EDMC.  So, let's reduce the chances of data
    loss.
2019-09-13 19:46:20 +01:00
Jonathan Harris
02d4da30d5 Don't give error if system coordinates unknown
Fixes #446
2019-09-13 19:46:05 +01:00
Athanasius
59b738fbf0 eddn cmdr_data not actually checking 'send to EDDN' option. (#445) 2019-09-13 19:45:20 +01:00
Jonathan Harris
d8b5884b05 Notify plugins of Inara ship, system and station IDs
Fixes #425
2019-07-06 15:28:48 +01:00
Jonathan Harris
de9760c4d2 Update EDSY URL 2019-06-19 09:31:48 +01:00
Jonathan Harris
ca0c650955 Add influence and reputation gain to setCommanderMissionCompleted 2019-02-16 17:52:36 +00:00
Jonathan Harris
37a1f0dd23 Notify other plugins of system's EDSM status 2019-01-28 17:22:14 +00:00
Jonathan Harris
1dc6d04954 Factor in Horizons flag when de-duplicating 2019-01-25 18:05:42 +00:00
Jonathan Harris
2f154ffd03 Check economies when setting Horizons flag
Fixes #391
2019-01-10 17:09:49 +00:00
Jonathan Harris
f41b418a63 Look for "ELITE_HORIZONS_V_PLANETARY_LANDINGS" sku in cAPI data
to set Horizons flag. Should always hit at least Int_PlanetApproachSuite if Horizons.
2019-01-10 01:42:03 +00:00
Jonathan Harris
4900969bd9 cAPI data doesn't seem to reliably reflect whether user has Horizons 2019-01-10 01:12:09 +00:00
Jonathan Harris
728ef3f599 Add "horizons" flag to outfitting and shipyard messages 2019-01-08 22:54:39 +00:00
Jonathan Harris
22c94d0c5c Don't modify Journal FSDJump/Location entry Factions in-place
Fixes #375
2019-01-06 23:23:38 +00:00