JSON parse
Build and Push Docker Image / build-and-push (push) Successful in 15s

This commit is contained in:
ciomek committed 2026-08-16 13:23:26 +02:00
1 parent d38015562a
commit 8fbc7fed7d
8 files changed
+10 -29

No files matched your search

+1 -6
View File
@@ -8,7 +8,7 @@ from loon.redis.chunk import set_chunk_cache
from loon.web.users.state import user_threads, user_world_requests
async def world_handler(client, userdata, msg):
async def world_handler(client, userdata, msg, data):
chunk_topic = re.compile(r"^loon/world/chunk/(-?\d+)/(-?\d+)$")
match = chunk_topic.match(msg.topic)
@@ -16,11 +16,6 @@ async def world_handler(client, userdata, msg):
if not match:
return
try:
data = json.loads(msg.payload.decode())
except json.JSONDecodeError:
return
x, z = int(match.group(1)), int(match.group(2))
envelope = json.dumps({"topic": f"world/chunk/{x}/{z}", "payload": data})
coord = (x, z)