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

373 Commits

Author SHA1 Message Date
Athanasius
cba2f32cef plugins/eddn: export_journal_entry didn't have is_odyssey arg added 2021-05-15 08:17:58 +01:00
Athanasius
58c740bc6c plugins/eddn: Set odyssey flag in extra messages
1. journal outfitting
2. journal shipyard
3. journal commodities

As these are sourced from the additional .json files via a load over
`entry` contents we need to re-set `entry['odyssey']` and then make sure
we use it.
2021-05-12 18:18:41 +01:00
Athanasius
86a17e5e4c plugins/eddn: Utilise this.odyssey to augment CAPI-sourced messages
NB: Currently EDDN gateway doesn't have the updated schemas, so the
export_commodities() throws an exception and thus neither outfitting or
shipyard exports are even attempted.
2021-05-12 17:55:20 +01:00
Athanasius
8dfd638f28 plugins/eddn: Store Odyssey boolean in This state.
This is so we can access it in cmdr_data() as well.
2021-05-12 17:29:15 +01:00
Athanasius
97a6d07c51 plugins/eddn: Send bool 'odyssey' in all event messages.
This is so listeners can make decision on if/how/when to store data that
might be from base/horizons or Odyssey.
2021-05-12 17:14:58 +01:00
Athanasius
7f45953012 plugins/station: *Do* set station from BodyType/Body always
The 'if not this.station' was early paranoia when first getting things
working with Odyssey.  It prevents a relog from Horizons (i.e. different
location) from correctly picking up an Odyssey login station when
on-foot in concourse.

Also, EDSM was defaulting wrongly for this.station_marketid.  Not that
the plugin even *uses* that at this time.
2021-05-12 10:56:43 +01:00
Athanasius
844e6115e3 Also handle Embark (properly) in EDSM and Inara plugins. 2021-05-01 13:50:45 +01:00
Athanasius
02052dd90e EDDB: Don't blank station when Embarking OnStation to own ship. 2021-05-01 13:47:52 +01:00
Athanasius
22dbd4e048 EDDN: Fix building of "ships this station sells" list.
This likely hadn't been tested since a rewrite due to pre-Odyssey alpha
having broken CAPI without shipyard_list on normal stations.
2021-04-12 08:31:48 +01:00
A_D
d0bc006f9f Cleared final mypy errors in inara 2021-04-12 08:31:47 +01:00
Athanasius
878a247604 inara: A few final type fixups 2021-04-12 08:31:47 +01:00
Athanasius
aaceaf0f52 inara: More type fixing 2021-04-12 08:31:47 +01:00
Athanasius
7ef6c17fa1 inara: Fix 'fleet' type 2021-04-12 08:31:47 +01:00
Athanasius
3ea6dac00b inara: Further cleanup
* missing 'this' variables declared in This.__init__()
* Types up to end of journal_entry()
2021-04-12 08:31:47 +01:00
Athanasius
6e98cf04d9 inara: Begin conversion to 'This' class. 2021-04-12 08:31:47 +01:00
Athanasius
8cbf37624c Inara: Ignore cognitive complexity & snake_case a var 2021-04-12 08:31:47 +01:00
Athanasius
f494a948eb inara: Rename ALLCAPS function vars for padding. 2021-04-12 08:31:47 +01:00
Athanasius
9fd14a3980 Inara: Don't send a setCommanderReputationMajorFaction if we have no Reputations
Sure the `for k, v in ...` means not sending any that are empty/none,
but it will still send the event, just with *no* reputations.

When you're on a fresh character you have no reputations yet, so avoid
causing an Inara API error, including status line text.

Close #581
2021-04-12 08:31:47 +01:00
Athanasius
bc6557dd9c Quieten various TRACE log output.
* A lot of this is commented out.  It might be useful in the future, but
  is just too noisy for now.
* Changed the protocol webserver to info, as it is.
* Left the EDSM 'not 1XX, 2XX or 5XX' in as it's a warning, so 'pass's
  on the conditional bodies that would be empty now trace's are
  commented.
2021-04-12 08:31:47 +01:00
Athanasius
5edf8d5b59 Change monitor.state['on_foot'] to 'OnFoot' for consistency 2021-04-12 08:30:51 +01:00
Athanasius
734cb9ed11 Inara plugin now maintains Station Name when on_foot 2021-04-12 08:30:51 +01:00
Athanasius
bd4489974d EDSM plugin now maintaining Station Name when on_foot 2021-04-12 08:30:51 +01:00
Athanasius
f45f817fa2 EDDB plugin now setting Station name correctly on_foot
* monitor.on_foot is now monitor.state['on_foot'] as plugins need to
  access it.
* EDDB:journal_entry() now stores that in this.on_foot to check later.
* this.on_foot checked in cmdr_data() to actually set station name from
  that data if needs be.  This avoids setting it to STATION_UNDOCKED if
  data['commander']['docked'] is False, when we're on_foot.
2021-04-12 08:30:51 +01:00
Athanasius
567cfdb9ca Will now send data to EDDN when on-foot in-station.
NB: No shipyard in tests because data['ships']['shipyard_list'] is an
empty list.  This might be the bug not having been fixed, or the station
might genuinely have no ships for sale.  We have no way to check in
Odyssey Alpha Phase 1.
2021-04-12 08:30:51 +01:00
Athanasius
d585dd9233 Also str() appversion in EDSM and Inara plugins 2021-04-01 14:46:43 +01:00
Athanasius
b0bda6e982 EDDN: Convert appversion_nobuild() to str
Without this the JSON serialisation later on barfs on it.
2021-04-01 14:46:43 +01:00
Athanasius
567bda048d plugins/eddn: Ensure types on all 'this' variables. 2021-04-01 14:45:53 +01:00
Athanasius
501682c439 Split text following """ if entire docstring not single line. 2021-04-01 14:45:53 +01:00
Athanasius
7da15faaf3 plugins/eddn: Convert 'this' to a class for typing reasons.
* Typing hates the 'this' hack on module's __name__, so use a small
  class instead.
* Added missing `return None`s.
* Other typing cleanups.
2021-04-01 14:45:53 +01:00
Athanasius
921185f7ce plugins/eddn: Now fully docstring'ed. 2021-04-01 14:45:53 +01:00
Athanasius
2f9789afdd Update all code to use config.appversion() as a function
This *also* caught some instances where appversion_nobuild should
already have been used, so those were both changed and updated to a
function call.
2021-04-01 14:45:52 +01:00
Athanasius
f0c6b9efaa EDDN: Minor logging and format fixup to match 4.2.4 2021-04-01 14:45:52 +01:00
Athanasius
9a8daf665e EDDN: Restore 4.2.4 is_horizons() check in full 2021-04-01 14:45:52 +01:00
Athanasius
63be402cb4 EDDN: Restore safe_modules_and_ships() from 4.2.4 2021-04-01 14:45:52 +01:00
Athanasius
bc33bf1b19 Attempt to get develop back to code state before rebase on main. 2021-04-01 14:45:51 +01:00
Athanasius
d8fb17df9f plugins/eddn: Add paranoia about data in is_horizons()
A damaged station has `"modules": []`, so trips over modules.values().
2021-04-01 14:45:51 +01:00
Athanasius
933ec723bd plugins/eddn: Call requests.Session.close() in EDDN.close()
Avoids a `-W default` warning on shutdown.
2021-04-01 14:45:50 +01:00
Athanasius
6aa4ccaf90 plugins/edsm: Don't try to r.close(), that's not even valid 2021-04-01 14:45:50 +01:00
Athanasius
3d3674da5f plugins/edsm: Call requests.Session.close() after we've shutdown worker thread
This properly closes any sockets and avoids a -W default warning on
shutdown.
2021-04-01 14:45:50 +01:00
Athanasius
745c2ce8d2 edsm: Ensure Request handles are closed. 2021-04-01 14:45:50 +01:00
A_D
051245cf90 Renamed various config values to be backwards compatible 2021-04-01 14:45:48 +01:00
Athanasius
3ed08f0f7e plugins/inara: Avoid Tk event_generate() calls during shutdown
# Conflicts:
#	plugins/inara.py
2021-04-01 14:45:48 +01:00
Athanasius
db48b6eaad plugins/edsm: Avoid Tk event_generate() calls during shutdown
# Conflicts:
#	plugins/edsm.py
2021-04-01 14:45:48 +01:00
A_D
00629b7420 use _str versions of paths for string ops 2021-04-01 14:45:48 +01:00
A_D
b5a8c03980 Added missing whitespace 2021-04-01 14:45:48 +01:00
A_D
cd67f12f22 Fixed eddn event specific killswitch 2021-04-01 14:45:48 +01:00
A_D
b694bdc965 Added per-event killswitch 2021-04-01 14:45:48 +01:00
A_D
6374fbbeb8 Added event disabling
You can now disable specific event handlers in plugins
2021-04-01 14:45:47 +01:00
A_D
70087a27e4 Added total journal cutoff killswitches 2021-04-01 14:45:47 +01:00
A_D
8dca6783fc Fixed spelling, added utility methods 2021-04-01 14:45:47 +01:00