mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-17 01:22:19 +03:00
re #1198 work around +size suffixes in CAPI responses
Co-authored-by: A_D <A-UNDERSCORE-D@users.noreply.github.com>
This commit is contained in:
parent
6e7ef6d80d
commit
f1ef557dee
16
companion.py
16
companion.py
@ -670,6 +670,9 @@ class Session(object):
|
||||
logger.warning("No lastStarport name!")
|
||||
return data
|
||||
|
||||
# WORKAROUND: n/a | 06-08-2021: Issue 1198 and https://issues.frontierstore.net/issue-detail/40706 -- strip "+" chars off star port names returned by the CAPI
|
||||
last_starport_name = last_starport["name"] = last_starport_name.rstrip(" +")
|
||||
|
||||
services = last_starport.get('services', {})
|
||||
if not isinstance(services, dict):
|
||||
# Odyssey Alpha Phase 3 4.0.0.20 has been observed having
|
||||
@ -687,23 +690,24 @@ 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}")
|
||||
if last_starport_id != int(marketdata['id']):
|
||||
logger.warning(f"{last_starport_id!r} != {int(marketdata['id'])!r}")
|
||||
raise ServerLagging()
|
||||
|
||||
else:
|
||||
marketdata['name'] = last_starport_name
|
||||
data['lastStarport'].update(marketdata)
|
||||
|
||||
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}")
|
||||
if last_starport_id != int(shipdata['id']):
|
||||
logger.warning(f"{last_starport_id!r} != {int(shipdata['id'])!r}")
|
||||
raise ServerLagging()
|
||||
|
||||
else:
|
||||
shipdata['name'] = last_starport_name
|
||||
data['lastStarport'].update(shipdata)
|
||||
# WORKAROUND END
|
||||
|
||||
return data
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user