2026-08-29 21:10:24 +08:00

29 lines
951 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# -*- 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