集中管理 NSSearchPathFor... 调用,避免散落,方便后续 ResourceUnzipper
(Phase 1.5)与 WebView 加载(Phase 1.10)复用。
- 新增 ylgamehall/Source/Resource/SandboxPaths.swift
- 基础:caches / documents / bundle
- 大厅 H5:lobbyRoot / lobbyIndex / lobbyVersionXML(基于 BundleConfig
当前渠道值动态拼接)
- 子游戏 H5:subGameRoot(_:) / subGameIndex(_:_:)(Phase 6 调用,
入参传 SwitchOverGameData 解出的 dir/start)
- 全部 enum + static,无状态,Swift 6 严格并发零负担
- RootViewController.viewDidLoad 补 SandboxPaths 烟雾打印 6 项路径,
便于首次启动 console 校验:
- lobbyIndex 应为 {Caches}/FtJf073.../gamehall/index.html
- lobbyVersionXML 应为 {Caches}/FtJf073.../gamehall/version.xml
- BuildProject 通过,synchronized group 自动收编新文件
55 lines
1.7 KiB
Swift
55 lines
1.7 KiB
Swift
//
|
|
// RootViewController.swift
|
|
// ylgamehall
|
|
//
|
|
// M0 阶段临时根控制器,后续将被 Coordinator + LobbyViewController 替换。
|
|
//
|
|
|
|
import UIKit
|
|
|
|
final class RootViewController: UIViewController {
|
|
|
|
override func viewDidLoad() {
|
|
super.viewDidLoad()
|
|
view.backgroundColor = .black
|
|
|
|
// Phase 1.2 烟雾测试:打印 ChannelConfig.plist 的 11 项渠道注入值
|
|
let cfg = BundleConfig.shared
|
|
print("""
|
|
[BundleConfig] 渠道注入读取结果:
|
|
qiniuDomain = \(cfg.qiniuDomain)
|
|
gameId = \(cfg.gameId)
|
|
channel = \(cfg.channel)
|
|
gameDir = \(cfg.gameDir)
|
|
gameStart = \(cfg.gameStart)
|
|
gameConfig = \(cfg.gameConfig)
|
|
market = \(cfg.market)
|
|
agent = \(cfg.agent)
|
|
appVersion = \(cfg.appVersion)
|
|
other = "\(cfg.other)"
|
|
appleConfig = "\(cfg.appleConfig)"
|
|
""")
|
|
|
|
// Phase 1.3 烟雾测试:打印 SandboxPaths 计算路径
|
|
print("""
|
|
[SandboxPaths] 路径计算结果:
|
|
caches = \(SandboxPaths.caches.path)
|
|
documents = \(SandboxPaths.documents.path)
|
|
bundle = \(SandboxPaths.bundle.path)
|
|
lobbyRoot = \(SandboxPaths.lobbyRoot.path)
|
|
lobbyIndex = \(SandboxPaths.lobbyIndex.path)
|
|
lobbyVersionXML = \(SandboxPaths.lobbyVersionXML.path)
|
|
""")
|
|
}
|
|
|
|
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
|
|
.landscape
|
|
}
|
|
|
|
override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation {
|
|
.landscapeRight
|
|
}
|
|
|
|
override var prefersStatusBarHidden: Bool { false }
|
|
}
|