1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-17 09:32:23 +03:00

3116 Commits

Author SHA1 Message Date
Athanasius
ad677d73f6 monitor.state: Group all Odyssey, and add other ShipLocker categories 2021-04-12 08:31:47 +01:00
Athanasius
c4df5b2822 DRY init of self.state
It's identical in both places, so use a common function.
2021-04-12 08:31:47 +01:00
Athanasius
b66d599508 Pre-Release 5.0.0-beta4: appversion and changelog 2021-04-12 08:31:47 +01:00
dependabot[bot]
874b688c09 build(deps-dev): bump pytest from 6.2.2 to 6.2.3
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.2.2 to 6.2.3.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.2.2...6.2.3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-12 08:31:47 +01:00
Athanasius
30db492212 Bump to Python 3.9.4
I can PyCharm debug with this, unlike 3.9.3 :)
2021-04-12 08:31:47 +01:00
Athanasius
27961c1513 AppWindow.getandsend: Only blank status text when we play the bad sound
AppWindow.getandsend() is set on a timer for all of StartUp, Location
and Docked.  This means it can trigger up to three times for a login
when docked.

Subsequent calls would hit the cooldown timer and blank the status text
blindly, hiding the 'Last Updated at' text.

To be honest I'm not sure it even needs blanking *then*.
2021-04-12 08:31:47 +01:00
Athanasius
88a3f6d73a Remove erroneous on-foot check for 'Where are you?!'
This causes the check to not work as intended on live and is a left-over
from before fixing the code to just use 'err'.
2021-04-12 08:31:47 +01:00
Athanasius
5c99ef1243 Fix CAPI update properly for on-foot/embarking.
* Stop relying on self.status['text'] as indicator, set and use `err`.
2021-04-12 08:31:47 +01:00
Athanasius
72d200f616 Detect when on-foot but no known station.
This will trigger the "Where are you?!" message, which now can happen.

I need to double-check this against live behaviour, and might move this
to a different check, as I think on live it's valid to query in-space.
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
33f0064dab Document edmc_data.py
* PLUGINS.md - now we only need mention this for such data.
* ChangeLog.md - pre-emptive section.
2021-04-12 08:31:47 +01:00
Athanasius
c17e6ecade collate.py: Also newline='\n' on other open-for-write 2021-04-12 08:31:47 +01:00
Athanasius
dbfa50739f collate.py: Use always '\n` line-ending on commodity file 2021-04-12 08:31:47 +01:00
Athanasius
32d87f68dd collate.py: Fix references to companion_category_map 2021-04-12 08:31:47 +01:00
Athanasius
5c5e5b507e monitor.py: Fix up legavy config.get() calls 2021-04-12 08:31:47 +01:00
Athanasius
ad8c63c64c Move util_ships.py ship_map to data.py ship_name_map
Also refactors data.py to edmc_data.py as I'm having weird issues with
PyCharm debugger not starting, and this seems to be to do with module
name clashes.
2021-04-12 08:31:47 +01:00
Athanasius
a80635fb46 td.py: Add comment about *not* moving some constants to data.py 2021-04-12 08:31:47 +01:00
Athanasius
dda5a86f3d Move Status.json flags into data.py
These aren't used by any core code, but at least one plugin uses one.
2021-04-12 08:31:46 +01:00
Athanasius
a47143a6a5 Move all static data from outfitting.py into data.py 2021-04-12 08:31:46 +01:00
Athanasius
b961ca814a Move edshipyard.py slot_map into data.py 2021-04-12 08:31:46 +01:00
Athanasius
02d1a8cf45 Move coriolis.py coriolis_ship_map into data.py 2021-04-12 08:31:46 +01:00
Athanasius
cc809de042 config.py: Remove 'protoype' comment about appversion being a function 2021-04-12 08:31:46 +01:00
Athanasius
5db62e48a3 Move companion.py category_map into data.py 2021-04-12 08:31:46 +01:00
Athanasius
5d289454a9 Move commodity.py bracketmap into data.py 2021-04-12 08:31:46 +01:00
Athanasius
ee9565564b Add new data.py file to hold all static data.
The aim here is to avoid static data in modules that contain code.  Why?
So that we can avoid some potential import loops when the 'inner' module
only wants static data but is already imported by the 'outer' module for
code purposes.
2021-04-12 08:31:46 +01:00
Athanasius
f2b89691c6 Python: Use 3.9.3 2021-04-12 08:31:46 +01:00
Athanasius
c1cf90bda3 Add comment about using .parent because non-main script is in library.zip 2021-04-12 08:31:46 +01:00
Athanasius
f16a367986 Use full path to open .gitversion out of paranoia. 2021-04-12 08:31:46 +01:00
Athanasius
0b88117844 chdir() to __file__ when not running frozen 2021-04-12 08:31:46 +01:00
Athanasius
103e856446 EDMarketConnector.py: Move chdir as early as possible
We need the config.py read of .gitversion to be from the right place.
2021-04-12 08:31:46 +01:00
Athanasius
7bbc8e86a2 Pre-Release 5.0.0-beta3: appversion and changelog
# Conflicts:
#	config.py
2021-04-12 08:31:40 +01:00
Athanasius
74a2b70a19 PLUGINS.md: Add ship_utils.ship_map to allowed imports 2021-04-12 08:30:51 +01:00
Athanasius
c26d1bce93 Comment out un-necessary logger.trace()
In monitor.py it was all that 'Location' event tracing.
2021-04-12 08:30:51 +01:00
Athanasius
3933dea479 Convert monitor.event_queue to a queue.Queue.
* We now use event_queue.empty() to see if it is indeed empty.
* Changed AppWindow.journal_event() to also use .empty() rather than
  `while True`.  Keeping the `'if not entry'` check just in case.
  This prevents it from calling monitor.get_entry() when the prior run
  through the loop has just emptied the queue.  Thus we'll only log when
  it genuinely IS unexpectedly empty.
* During *game* Shutdown we can send the synthetic 'Shutdown' event
  through, and then find and append the actual game 'Shutdown' event
  (i.e. this wasn't a crash, which is what the synthetic event is meant
  to react to).  But AppWindow.journal_event() loop picks up both events
  in one call, so the second <<JournalEvent>> sends it working on an
  empty queue.
  Thus we log in monitor.get_entry() only if the queue is empty *and*
  the game is still running.
* NB: Also adds 'Component' to the OTHER place montitor.state is
  initialised.
2021-04-12 08:30:51 +01:00
Athanasius
672c0d3d49 Don't log when monitor.get_entry() returns None
This is expected due to code using this just to 'tickle' a display
update.
2021-04-12 08:30:51 +01:00
Athanasius
8f2802fbcf monitor.py: Add support for Odyssey 'Component' materials. 2021-04-12 08:30:51 +01:00
A_D
5010f133a8 Added font override 2021-04-12 08:30:51 +01:00
Athanasius
cd2407c1c3 utils_ship: Correct fat-finger/bad replace on '\0' 2021-04-12 08:30:51 +01:00
Athanasius
b70efab345 companion.py: Another s/on_foot/OnFoot/ for monitor.state 2021-04-12 08:30:51 +01:00
Athanasius
5edf8d5b59 Change monitor.state['on_foot'] to 'OnFoot' for consistency 2021-04-12 08:30:51 +01:00
Athanasius
4be52fd259 Add comment about how/when system and station text is updated
It took me hours to track this down, due to the use of
parent.children(), so let's try to shorten that next time.
2021-04-12 08:30:51 +01:00
Athanasius
f40f6464b6 PLUGINS.md: Document state['on_foot']
* Also restore 'New in' bits to just below the table.
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
a09512f3b3 Mostly refactoring companion.ship_file_name() into util_ships.py
* Also prevent "You're not docked at a station!" for on_foot.
2021-04-12 08:30:51 +01:00
Athanasius
6fe86cd719 on_foot: Attempt to set correctly when state changes.
* For taxi-usage you 'Embark' on it to take the trip and 'Disembark'
  onto foot at the other end.
* Joining a multi-crew session will mean no longer being on foot.
* When quitting a multi-crew session we might miss that you're back
  on-foot.  Need to test.
2021-04-12 08:30:51 +01:00
Athanasius
b3cef1e29b Server Lagging check now works again.
Well, it doesn't now raise ServerLagging for a last Journal with a
LoadGame on-foot and in-station.

It does then cause "You're not docked at a station!" to show up.
2021-04-12 08:30:51 +01:00
Athanasius
b44320f47c Split large 'Server Lagging' test into multiple
Also adjusts the 'docked and station name matches' check to account for
being on-foot.
2021-04-12 08:30:51 +01:00