-
Notifications
You must be signed in to change notification settings - Fork 807
重构陶瓦下载功能 并 在加入联机房间时显示 p2p 难度 #4929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
重构陶瓦下载功能 并 在加入联机房间时显示 p2p 难度 #4929
Conversation
| terracotta.sudo_installing=HMCL 需要验证您的密码才能安装联机核心 | ||
| terracotta.difficulty.easiest=当前网络状态极好:稍等一下就成功! | ||
| terracotta.difficulty.simple=当前网络状态较好:建立连接需要一段时间…… | ||
| terracotta.difficulty.medium=当前网络状态中等:已启用抗干扰备用隧道,但需要更长时间(甚至失败) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
需要改成半角。Glavo 在 Gradle 自动检测规则中添加了这个。
| terracotta.difficulty.medium=当前网络状态中等:已启用抗干扰备用隧道,但需要更长时间(甚至失败) | |
| terracotta.difficulty.medium=当前网络状态中等:已启用抗干扰备用隧道,但需要更长时间 (甚至失败) |
|
陶瓦的 FreeBSD 构建似乎坏了 :( |
|
你重新运行一下 GitHub Action?看起来可能是网络错误导致的。 |
已多次重试,均无法正常运行 |
|
这个功能作用大吗?我感觉好像不是特别有用。 |
按照过去几个月的经验,大部分问题表现为卡在“加入房间中”界面。我希望新添加的 p2p 难度提示能够告知用户当前连接所需时间,并为社区成员提供直观的 NAT 状态显示。 |
- Feature: Hide the port in mc address if it's 25565. - No longer declare Terracotta as game on macOS. - Display P2P difficulty. - Android Support. Update I18N.
|
介于 HMCL 端的重构已全部完成,我先将本 PR 标记为 'Ready for review'。 但请注意:陶瓦联机上仍有部分问题需要解决,因而当前 PR 不可合并。 |
Hide the port in mc address if it's 25565. Refactor EasyTier management API. No longer treat Terracotta as games on macOS. Display p2p difficulty. Integrate international EasyTier public servers. Bump EasyTier to v2.4.5-terracotta.1: Simple Voice Chat compatibility build(windows): statically link CRT on MSVC targets Feature: Publish Android so files and platform bundles only.
|
希望 Glavo 能够先审查 HMCL 这边的重构。 SimpleVoiceChat 相关问题仍需上游 EasyTier 提供修复。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the Terracotta multiplayer functionality in HMCL to use platform-specific bundles (-pkg.tar.gz) instead of individual executables. The refactoring improves the installation process and adds P2P connection difficulty indicators to inform users about expected connection times based on NAT types.
Key changes:
- Terracotta bundles are now downloaded at build time with hashes automatically computed and embedded in terracotta.json
- Version information and legacy version regex patterns moved to libs.version.toml for centralized configuration
- P2P difficulty levels (EASIEST, SIMPLE, MEDIUM, TOUGH) displayed when joining rooms to set user expectations
- Removed "About EasyTier" UI element and version_recent support per community request
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| gradle/libs.versions.toml | Adds terracotta version definitions and platform-specific bundle dependencies |
| HMCL/build.gradle.kts | Implements build-time download of terracotta packages with automatic hash calculation |
| HMCL/terracotta.json | Template configuration file replacing the old embedded JSON |
| HMCL/src/main/resources/assets/terracotta.json | Removed old static configuration in favor of build-time generated file |
| HMCLCore/src/main/java/org/jackhuang/hmcl/util/io/FileUtils.java | Adds POSIX file permission parsing utility for proper file permissions from tar archives |
| HMCL/src/main/java/org/jackhuang/hmcl/terracotta/TerracottaBundle.java | New class managing bundle download, extraction, and validation |
| HMCL/src/main/java/org/jackhuang/hmcl/terracotta/TerracottaMetadata.java | Refactored to use new bundle-based configuration with platform detection |
| HMCL/src/main/java/org/jackhuang/hmcl/terracotta/TerracottaManager.java | Separates download() and install() flows for better control over installation sources |
| HMCL/src/main/java/org/jackhuang/hmcl/terracotta/TerracottaState.java | Adds GuestConnecting state and Difficulty enum for P2P connection quality indication |
| HMCL/src/main/java/org/jackhuang/hmcl/terracotta/provider/*.java | Refactored provider hierarchy with AbstractTerracottaProvider base class |
| HMCL/src/main/java/org/jackhuang/hmcl/ui/terracotta/TerracottaPage.java | Removes "About EasyTier" navigation drawer item |
| HMCL/src/main/java/org/jackhuang/hmcl/ui/terracotta/TerracottaControllerPage.java | Adds UI for displaying P2P difficulty during guest connection |
| HMCL/src/main/resources/assets/lang/*.properties | Adds translations for difficulty levels and removes EasyTier references |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
已将计算陶瓦哈希的代码移动到 upgradeTerracottaConfig 任务 |
本 PR 重构了 HMCL 下载陶瓦联机的代码。
现在,HMCL 会为每个平台下载一个 -pkg.tar.gz 平台包(Platform Bundle)(或用户手动拖入文件)。之后,两种方式将共用同一安装代码。在此调整过后,我们将能够便捷地在 Windows 平台上提供多个 DLL 以解决部分设备上缺失运行环境的问题。
此外,HMCL 现在将在用户加入联机房间时显示 p2p 难度。这将告知用户当前连接所需的大概时间,并为社区成员提供直观的 NAT 状态显示。
本 PR 还包含以下次要变化:
介于 HMCL 端的重构已全部完成,我先将本 PR 标记为 'Ready for review'。但请注意:陶瓦联机上仍有部分问题需要解决,因而当前 PR 不可合并。