mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-14 00:07:14 +03:00
Send "ShutDown" event to plugins on quitting to Main Menu
This commit is contained in:
parent
6fd492e910
commit
95f96c1c03
@ -116,7 +116,7 @@ This gets called when EDMC sees a new entry in the game's journal. `state` is a
|
||||
|
||||
A special "StartUp" entry is sent if EDMC is started while the game is already running. In this case you won't receive initial events such as "LoadGame", "Rank", "Location", etc. However the `state` dictionary will reflect the cumulative effect of these missed events.
|
||||
|
||||
Similarly, a special "ShutDown" entry is sent when the game is quitted while EDMC is running. This event is not sent when EDMC is running on a different machine or when quitting to the main menu, so you should not *rely* on receiving this event.
|
||||
Similarly, a special "ShutDown" entry is sent when the game is quitted while EDMC is running. This event is not sent when EDMC is running on a different machine so you should not *rely* on receiving this event.
|
||||
|
||||
```python
|
||||
def journal_entry(cmdr, is_beta, system, station, entry, state):
|
||||
|
@ -506,6 +506,8 @@ class EDLogs(FileSystemEventHandler):
|
||||
if not self.live and entry['event'] not in [None, 'Fileheader']:
|
||||
self.live = True
|
||||
self.event_queue.append('{ "timestamp":"%s", "event":"StartUp" }' % strftime('%Y-%m-%dT%H:%M:%SZ', gmtime()))
|
||||
elif self.live and entry['event'] == 'Music' and entry.get('MusicTrack') == 'MainMenu':
|
||||
self.event_queue.append('{ "timestamp":"%s", "event":"ShutDown" }' % strftime('%Y-%m-%dT%H:%M:%SZ', gmtime()))
|
||||
return entry
|
||||
|
||||
def game_running(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user