mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-14 16:27:13 +03:00
CAPI: Add logger.warning() for *why* we raise ServerLagging
This commit is contained in:
parent
a0b310f72e
commit
88b56b6913
@ -899,14 +899,19 @@ class AppWindow(object):
|
||||
|
||||
elif auto_update and not monitor.state['OnFoot'] and not data['commander'].get('docked'):
|
||||
# auto update is only when just docked
|
||||
logger.warning(f"{auto_update!r} and not {monitor.state['OnFoot']!r} and "
|
||||
f"not {data['commander'].get('docked')!r}")
|
||||
raise companion.ServerLagging()
|
||||
|
||||
elif data['lastSystem']['name'] != monitor.system:
|
||||
# CAPI system must match last journal one
|
||||
logger.warning(f"{data['lastSystem']['name']!r} != {monitor.system!r}")
|
||||
raise companion.ServerLagging()
|
||||
|
||||
elif data['lastStarport']['name'] != monitor.station:
|
||||
if monitor.state['OnFoot'] and monitor.station:
|
||||
logger.warning(f"({data['lastStarport']['name']!r} != {monitor.station!r}) AND "
|
||||
f"{monitor.state['OnFoot']!r} and {monitor.station!r}")
|
||||
raise companion.ServerLagging()
|
||||
|
||||
else:
|
||||
@ -916,16 +921,22 @@ class AppWindow(object):
|
||||
|
||||
if last_station != monitor.station:
|
||||
# CAPI lastStarport must match
|
||||
logger.warning(f"({data['lastStarport']['name']!r} != {monitor.station!r}) AND "
|
||||
f"{last_station!r} != {monitor.station!r}")
|
||||
raise companion.ServerLagging()
|
||||
|
||||
self.holdofftime = querytime + companion.holdoff
|
||||
|
||||
elif not monitor.state['OnFoot'] and data['ship']['id'] != monitor.state['ShipID']:
|
||||
# CAPI ship must match
|
||||
logger.warning(f"not {monitor.state['OnFoot']!r} and "
|
||||
f"{data['ship']['id']!r} != {monitor.state['ShipID']!r}")
|
||||
raise companion.ServerLagging()
|
||||
|
||||
elif not monitor.state['OnFoot'] and data['ship']['name'].lower() != monitor.state['ShipType']:
|
||||
# CAPI ship type must match
|
||||
logger.warning(f"not {monitor.state['OnFoot']!r} and "
|
||||
f"{data['ship']['name'].lower()!r} != {monitor.state['ShipType']!r}")
|
||||
raise companion.ServerLagging()
|
||||
|
||||
else:
|
||||
|
@ -671,6 +671,8 @@ class Session(object):
|
||||
if services.get('commodities'):
|
||||
marketdata = self.query(URL_MARKET)
|
||||
if last_starport_name != marketdata['name'] or last_starport_id != int(marketdata['id']):
|
||||
logger.warning(f"{last_starport_name!r} != {marketdata['name']!r}"
|
||||
f" or {last_starport_id!r} != {int(marketdata['id'])!r}")
|
||||
raise ServerLagging()
|
||||
|
||||
else:
|
||||
@ -679,6 +681,8 @@ class Session(object):
|
||||
if services.get('outfitting') or services.get('shipyard'):
|
||||
shipdata = self.query(URL_SHIPYARD)
|
||||
if last_starport_name != shipdata['name'] or last_starport_id != int(shipdata['id']):
|
||||
logger.warning(f"{last_starport_name!r} != {shipdata['name']!r} or "
|
||||
f"{last_starport_id!r} != {int(shipdata['id'])!r}")
|
||||
raise ServerLagging()
|
||||
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user