mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-10 04:12:15 +03:00
Suits: Log if a buy/sell event doesn't contain Price
This commit is contained in:
parent
203fb051b0
commit
30b8a5eead
24
monitor.py
24
monitor.py
@ -1021,7 +1021,11 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below
|
|||||||
}
|
}
|
||||||
|
|
||||||
# update credits
|
# update credits
|
||||||
self.state['Credits'] -= entry.get('Price', 0)
|
if price := entry.get('Price') is None:
|
||||||
|
logger.error(f"BuySuit didn't contain Price: {entry}")
|
||||||
|
|
||||||
|
else:
|
||||||
|
self.state['Credits'] -= price
|
||||||
|
|
||||||
elif event_type == 'SellSuit':
|
elif event_type == 'SellSuit':
|
||||||
# Remove from known suits
|
# Remove from known suits
|
||||||
@ -1044,7 +1048,11 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below
|
|||||||
logger.exception(f"SellSuit for a suit we didn't know about? {entry['SuitID']}")
|
logger.exception(f"SellSuit for a suit we didn't know about? {entry['SuitID']}")
|
||||||
|
|
||||||
# update credits total
|
# update credits total
|
||||||
self.state['Credits'] += entry.get('Price', 0)
|
if price := entry.get('Price') is None:
|
||||||
|
logger.error(f"SellSuit didn't contain Price: {entry}")
|
||||||
|
|
||||||
|
else:
|
||||||
|
self.state['Credits'] += price
|
||||||
|
|
||||||
elif event_type == 'UpgradeSuit':
|
elif event_type == 'UpgradeSuit':
|
||||||
# alpha4
|
# alpha4
|
||||||
@ -1088,7 +1096,11 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below
|
|||||||
# { "timestamp":"2021-04-29T11:10:51Z", "event":"BuyWeapon", "Name":"Wpn_M_AssaultRifle_Laser_FAuto",
|
# { "timestamp":"2021-04-29T11:10:51Z", "event":"BuyWeapon", "Name":"Wpn_M_AssaultRifle_Laser_FAuto",
|
||||||
# "Name_Localised":"TK Aphelion", "Price":125000, "SuitModuleID":1698372938719590 }
|
# "Name_Localised":"TK Aphelion", "Price":125000, "SuitModuleID":1698372938719590 }
|
||||||
# update credits
|
# update credits
|
||||||
self.state['Credits'] -= entry.get('Price', 0)
|
if price := entry.get('Price') is None:
|
||||||
|
logger.error(f"BuyWeapon didn't contain Price: {entry}")
|
||||||
|
|
||||||
|
else:
|
||||||
|
self.state['Credits'] -= price
|
||||||
|
|
||||||
elif event_type == 'SellWeapon':
|
elif event_type == 'SellWeapon':
|
||||||
# We're not actually keeping track of all owned weapons, only those in
|
# We're not actually keeping track of all owned weapons, only those in
|
||||||
@ -1108,7 +1120,11 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below
|
|||||||
break
|
break
|
||||||
|
|
||||||
# Update credits total
|
# Update credits total
|
||||||
self.state['Credits'] += entry.get('Price', 0)
|
if price := entry.get('Price') is None:
|
||||||
|
logger.error(f"SellWeapon didn't contain Price: {entry}")
|
||||||
|
|
||||||
|
else:
|
||||||
|
self.state['Credits'] += price
|
||||||
|
|
||||||
elif event_type == 'UpgradeWeapon':
|
elif event_type == 'UpgradeWeapon':
|
||||||
# We're not actually keeping track of all owned weapons, only those in
|
# We're not actually keeping track of all owned weapons, only those in
|
||||||
|
Loading…
x
Reference in New Issue
Block a user