24 lines
1.1 KiB
GDScript
24 lines
1.1 KiB
GDScript
# client_main —— 打包客户端的入口场景根(main_scene = res://client_main.tscn)。
|
||
#
|
||
# 只做一件事:起 AppFlow(登录 → 选人 → 进游戏 串场控制器)。
|
||
# 资源目录由 AssetRoot 决定:默认 res://../assets(开发树),打包后设环境变量
|
||
# MT_ASSETS 指向真实资源目录即可(见 project/asset_root.gd)。
|
||
extends Node
|
||
|
||
const AppFlow = preload("res://app_flow.gd")
|
||
|
||
func _ready() -> void:
|
||
# 打包 app 从 Finder/open 启动时没有 shell 环境;40250 服务器使用 classic
|
||
# DH2/CTR 协议,因此默认固定到 classic,同时保留 MT_PROTOCOL 覆盖能力。
|
||
if OS.get_environment("MT_PROTOCOL").is_empty():
|
||
OS.set_environment("MT_PROTOCOL", "classic")
|
||
# 移动端:APK/IPA 里没有资源 —— 挂载外部的 assets.zip(adb push / ios-deploy 上传)。
|
||
AssetPack.ensure()
|
||
var root := AssetRoot.path()
|
||
if not AssetRoot.available():
|
||
push_warning("[client] 资源目录不存在:%s —— MT_ASSETS 环境变量 / assets.zip(adb push 到 files/)" % root)
|
||
var af := AppFlow.new()
|
||
af.name = "AppFlow"
|
||
add_child(af)
|
||
af.start(root)
|