This commit is contained in:
1 parent
d38015562a
commit
8fbc7fed7d
8 files changed
+10
-29
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user