mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-12 23:37:14 +03:00
Merge pull request #2347 from colsw/stateupdate
Include 'missing?' Loadout event properties in 'state'
This commit is contained in:
commit
9a9246cec3
@ -655,6 +655,10 @@ Content of `state` (updated to the current journal entry):
|
||||
| `ShipType` | `str` | Internal name for the current ship type |
|
||||
| `HullValue` | `int` | Current ship value, excluding modules |
|
||||
| `ModulesValue` | `int` | Value of the current ship's modules |
|
||||
| `UnladenMass` | `float` | Unladen mass of current ship |
|
||||
| `CargoCapacity` | `int` | Max cargo capacity of current ship |
|
||||
| `MaxJumpRange` | `float` | Unladen jump range of current ship |
|
||||
| `FuelCapacity` | `dict[str,float]` | Current max capacity of Main & Reserve tanks |
|
||||
| `Rebuy` | `int` | Current ship's rebuy cost |
|
||||
| `Modules` | `dict` | Currently fitted modules |
|
||||
| `NavRoute` | `dict` | Last plotted multi-hop route[1] |
|
||||
|
10
monitor.py
10
monitor.py
@ -141,6 +141,10 @@ class EDLogs(FileSystemEventHandler):
|
||||
'ShipType': None,
|
||||
'HullValue': None,
|
||||
'ModulesValue': None,
|
||||
'UnladenMass': None,
|
||||
'CargoCapacity': None,
|
||||
'MaxJumpRange': None,
|
||||
'FuelCapacity': None,
|
||||
'Rebuy': None,
|
||||
'Modules': None,
|
||||
'CargoJSON': None, # The raw data from the last time cargo.json was read
|
||||
@ -680,6 +684,12 @@ class EDLogs(FileSystemEventHandler):
|
||||
self.state['ShipType'] = self.canonicalise(entry['Ship'])
|
||||
self.state['HullValue'] = entry.get('HullValue') # not present on exiting Outfitting
|
||||
self.state['ModulesValue'] = entry.get('ModulesValue') # not present on exiting Outfitting
|
||||
self.state['UnladenMass'] = entry.get('UnladenMass')
|
||||
self.state['CargoCapacity'] = entry.get('CargoCapacity')
|
||||
self.state['MaxJumpRange'] = entry.get('MaxJumpRange')
|
||||
self.state['FuelCapacity'] = {}
|
||||
self.state['FuelCapacity']['Main'] = entry.get('FuelCapacity')['Main']
|
||||
self.state['FuelCapacity']['Reserve'] = entry.get('FuelCapacity')['Reserve']
|
||||
self.state['Rebuy'] = entry.get('Rebuy')
|
||||
# Remove spurious differences between initial Loadout event and subsequent
|
||||
self.state['Modules'] = {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user