LADX: Support magpie tracker's sendfull button (#1701)

This commit is contained in:
zig-for 2023-04-14 21:47:36 -07:00 committed by GitHub
parent e716b50f8c
commit 02ef6cee47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -148,7 +148,7 @@ class MagpieBridge:
checks = None
item_tracker = None
ws = None
features = []
async def handler(self, websocket):
self.ws = websocket
while True:
@ -156,9 +156,12 @@ class MagpieBridge:
if message["type"] == "handshake":
logger.info(
f"Connected, supported features: {message['features']}")
if "items" in message["features"]:
self.features = message["features"]
if message["type"] in ("handshake", "sendFull"):
if "items" in self.features:
await self.send_all_inventory()
if "checks" in message["features"]:
if "checks" in self.features:
await self.send_all_checks()
# Translate renamed IDs back to LADXR IDs
@staticmethod