mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2026-11-28 03:32:23 +03:00
Merge pull request #2372 from dvdmuckle/powerplay-2.0-additions
Add code to track PP2.0 rank, merits, etc
This commit is contained in:
3 files changed
+25
No files matched your search
@@ -688,6 +688,7 @@ Content of `state` (updated to the current journal entry):
|
|||||||
| `StationName`[3] | `Optional[str]` | Name of the station we're docked at, if applicable |
|
| `StationName`[3] | `Optional[str]` | Name of the station we're docked at, if applicable |
|
||||||
| `MarketID`[3] | `Optional[str]` | MarketID of the station we're docked at, if applicable |
|
| `MarketID`[3] | `Optional[str]` | MarketID of the station we're docked at, if applicable |
|
||||||
| `StationType`[3] | `Optional[str]` | Type of the station we're docked at, if applicable |
|
| `StationType`[3] | `Optional[str]` | Type of the station we're docked at, if applicable |
|
||||||
|
| `Powerplay` | `dict` | `dict` of information on Powerplay
|
||||||
|
|
||||||
[1] - Contents of `NavRoute` not changed if a `NavRouteClear` event is seen,
|
[1] - Contents of `NavRoute` not changed if a `NavRouteClear` event is seen,
|
||||||
but plugins will see the `NavRouteClear` event.
|
but plugins will see the `NavRouteClear` event.
|
||||||
@@ -836,6 +837,12 @@ the 'Body' name value.
|
|||||||
|
|
||||||
`StationName`, `MarketID`, and `StationType` added to the `state` dictionary.
|
`StationName`, `MarketID`, and `StationType` added to the `state` dictionary.
|
||||||
|
|
||||||
|
New in version 5.13.0:
|
||||||
|
|
||||||
|
`state` now has `Powerplay`, a `dict` including `Rank`, `Merits`, `Power`,
|
||||||
|
`TimePledged`, and `Votes`. `Votes` should only be populated if playing in
|
||||||
|
legacy mode, as it is no longer a concept in the current version of the game.
|
||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
##### Synthetic Events
|
##### Synthetic Events
|
||||||
|
|||||||
+14
@@ -179,6 +179,13 @@ class EDLogs(FileSystemEventHandler):
|
|||||||
'StationName': None,
|
'StationName': None,
|
||||||
|
|
||||||
'NavRoute': None,
|
'NavRoute': None,
|
||||||
|
'Powerplay': {
|
||||||
|
'Power': None,
|
||||||
|
'Rank': None,
|
||||||
|
'Merits': None,
|
||||||
|
'Votes': None,
|
||||||
|
'TimePledged': None,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
def start(self, root: 'tkinter.Tk') -> bool: # noqa: CCR001
|
def start(self, root: 'tkinter.Tk') -> bool: # noqa: CCR001
|
||||||
@@ -1839,6 +1846,13 @@ class EDLogs(FileSystemEventHandler):
|
|||||||
# There should be a `Backpack` event as you 'come to' in the
|
# There should be a `Backpack` event as you 'come to' in the
|
||||||
# new location, so no need to zero out BackPack here.
|
# new location, so no need to zero out BackPack here.
|
||||||
|
|
||||||
|
elif event_type == 'powerplay':
|
||||||
|
self.state['Powerplay']['Power'] = entry.get('Power', '')
|
||||||
|
self.state['Powerplay']['Rank'] = entry.get('Rank', 0)
|
||||||
|
self.state['Powerplay']['Merits'] = entry.get('Merits', 0)
|
||||||
|
self.state['Powerplay']['Votes'] = entry.get('Votes', 0)
|
||||||
|
self.state['Powerplay']['TimePledged'] = entry.get('TimePledged', 0)
|
||||||
|
|
||||||
return entry
|
return entry
|
||||||
|
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
|
|||||||
@@ -548,6 +548,10 @@ def journal_entry( # noqa: C901, CCR001
|
|||||||
power_defect_data = {'powerName': entry["ToPower"], 'rankValue': 1}
|
power_defect_data = {'powerName': entry["ToPower"], 'rankValue': 1}
|
||||||
new_add_event('setCommanderRankPower', entry['timestamp'], power_defect_data)
|
new_add_event('setCommanderRankPower', entry['timestamp'], power_defect_data)
|
||||||
|
|
||||||
|
elif event_name == 'Powerplay':
|
||||||
|
power_data = {'powerName': entry["Power"], 'rankValue': entry["Rank"], 'meritsValue': entry["Merits"]}
|
||||||
|
new_add_event('setCommanderRankPower', entry['timestamp'], power_data)
|
||||||
|
|
||||||
# Ship change
|
# Ship change
|
||||||
if event_name == 'Loadout' and this.shipswap:
|
if event_name == 'Loadout' and this.shipswap:
|
||||||
this.loadout = make_loadout(state)
|
this.loadout = make_loadout(state)
|
||||||
|
|||||||
Reference in new issue
Block a user