# -*- coding: utf-8 -*- """runtime 模块初始化:注册所有 ServerEnv 函数(三处同步注册之③)。 注册清单(与 ① runtime_service.py 实现、② __init__.py 导出 保持三处同步): build_entity_tree / load_world_runtime / runtime_status / runtime_event_dispatch / runtime_control """ from .runtime_service import ( build_entity_tree, load_world_runtime, runtime_status, runtime_event_dispatch, runtime_control, ) async def load_runtime(env): """挂载 runtime 模块到 ServerEnv(宿主应用 app/scense.py 在 init() 中调用)。 参数 env: ahserver.ServerEnv 单例。 返回值: env(供宿主链式调用)。 """ env.build_entity_tree = build_entity_tree env.load_world_runtime = load_world_runtime env.runtime_status = runtime_status env.runtime_event_dispatch = runtime_event_dispatch env.runtime_control = runtime_control return env