From 7b8c113962a62c63563b9d0cc5e81811ebd0557b Mon Sep 17 00:00:00 2001 From: Athanasius Date: Thu, 29 Apr 2021 10:12:49 +0100 Subject: [PATCH] suits: Record a newly bought suit in monitor.state['Suits'] We can't fill in the 'id' field, but this is likely the FDevID of the suit type ? --- monitor.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/monitor.py b/monitor.py index baf79bfb..98dc4593 100644 --- a/monitor.py +++ b/monitor.py @@ -973,10 +973,22 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below # • Loadoutname pass - # `BuySuit` has no useful info as of 4.0.0.13 elif event_type == 'BuySuit': - # alpha4 - should have 'SuitID' + # alpha4 : + # { "timestamp":"2021-04-29T09:03:37Z", "event":"BuySuit", "Name":"UtilitySuit_Class1", + # "Name_Localised":"Maverick Suit", "Price":150000, "SuitID":1698364934364699 } + self.state['Suits'].update( + {entry['SuitID']: { + 'name': entry['Name'], + 'locName': entry.get('Name_Localised', entry['Name']), + # 'id': ???, # Is this an FDev ID for suit type ? + 'suitId': entry['SuitID'], + 'slots': [], + }} + ) + # update credits + self.state['Credits'] -= entry.get('Price', 0) pass elif event_type == 'SellSuit':