mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-05 09:53:33 +03:00
Store Fileheader
language, gameversion and build in monitor.state
This commit is contained in:
parent
e9e5352e37
commit
bac718aeff
@ -566,6 +566,9 @@ Content of `state` (updated to the current journal entry):
|
|||||||
|
|
||||||
| Field | Type | Description |
|
| Field | Type | Description |
|
||||||
| :------------- | :-------------------------: | :-------------------------------------------------------------------------------------------------------------- |
|
| :------------- | :-------------------------: | :-------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| `GameLanguage` | `Optional[str]` | `language` value from `Fileheader` event. |
|
||||||
|
| `GameVersion` | `Optional[str]` | `version` value from `Fileheader` event. |
|
||||||
|
| `GameBuild` | `Optional[str]` | `build` value from `Fileheader` event. |
|
||||||
| `Captain` | `Optional[str]` | Name of the commander who's crew you're on, if any |
|
| `Captain` | `Optional[str]` | Name of the commander who's crew you're on, if any |
|
||||||
| `Cargo` | `dict` | Current cargo. Note that this will be totals, and any mission specific duplicates will be counted together |
|
| `Cargo` | `dict` | Current cargo. Note that this will be totals, and any mission specific duplicates will be counted together |
|
||||||
| `CargoJSON` | `dict` | content of cargo.json as of last read. |
|
| `CargoJSON` | `dict` | content of cargo.json as of last read. |
|
||||||
|
@ -115,6 +115,9 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below
|
|||||||
# Cmdr state shared with EDSM and plugins
|
# Cmdr state shared with EDSM and plugins
|
||||||
# If you change anything here update PLUGINS.md documentation!
|
# If you change anything here update PLUGINS.md documentation!
|
||||||
self.state: Dict = {
|
self.state: Dict = {
|
||||||
|
'GameLanguage': None, # From `Fileheader
|
||||||
|
'GameVersion': None, # From `Fileheader
|
||||||
|
'GameBuild': None, # From `Fileheader
|
||||||
'Captain': None, # On a crew
|
'Captain': None, # On a crew
|
||||||
'Cargo': defaultdict(int),
|
'Cargo': defaultdict(int),
|
||||||
'Credits': None,
|
'Credits': None,
|
||||||
@ -497,13 +500,15 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below
|
|||||||
self.systemaddress = None
|
self.systemaddress = None
|
||||||
self.started = None
|
self.started = None
|
||||||
self.__init_state()
|
self.__init_state()
|
||||||
|
# In self.state as well, as that's what plugins get
|
||||||
|
self.stat['GameLanguage'] = entry['language']
|
||||||
|
self.stat['GameVersion'] = entry['gameversion']
|
||||||
|
self.stat['GameBuild'] = entry['build']
|
||||||
|
|
||||||
elif event_type == 'Commander':
|
elif event_type == 'Commander':
|
||||||
self.live = True # First event in 3.0
|
self.live = True # First event in 3.0
|
||||||
|
|
||||||
elif event_type == 'LoadGame':
|
elif event_type == 'LoadGame':
|
||||||
# alpha4
|
|
||||||
# Odyssey: bool
|
|
||||||
self.cmdr = entry['Commander']
|
self.cmdr = entry['Commander']
|
||||||
# 'Open', 'Solo', 'Group', or None for CQC (and Training - but no LoadGame event)
|
# 'Open', 'Solo', 'Group', or None for CQC (and Training - but no LoadGame event)
|
||||||
self.mode = entry.get('GameMode')
|
self.mode = entry.get('GameMode')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user