1
0
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:
Jonathan Harris 2017-12-03 17:14:18 +00:00
parent 6fd492e910
commit 95f96c1c03
2 changed files with 3 additions and 1 deletions

View File

@ -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):

View File

@ -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):