Skip to content

Conversation

@burningtnt
Copy link
Member

@burningtnt burningtnt commented Dec 5, 2025

本 PR 重构了 HMCL 下载陶瓦联机的代码。

现在,HMCL 会为每个平台下载一个 -pkg.tar.gz 平台包(Platform Bundle)(或用户手动拖入文件)。之后,两种方式将共用同一安装代码。在此调整过后,我们将能够便捷地在 Windows 平台上提供多个 DLL 以解决部分设备上缺失运行环境的问题。

此外,HMCL 现在将在用户加入联机房间时显示 p2p 难度。这将告知用户当前连接所需的大概时间,并为社区成员提供直观的 NAT 状态显示。

本 PR 还包含以下次要变化:

  • 移动陶瓦联机的 版本号过时版本正则表达式 到 libs.version.toml 中;
  • 在编译期下载陶瓦联机,自动计算哈希值并嵌入 terracotta.json 中;
  • 提供 Simple Voice Chat 实验性兼容;
  • 支持非中国大陆地区 - 非中国大陆地区联机(注:不支持中国大陆地区 - 非中国大陆地区);
  • 静态链接 MSVC 相关库以解决缺失 VCRUNTIME.DLL 相关问题;
  • 应 Easy Tier 社区管理员要求,移除陶瓦联机界面左下角【关于 EasyTier 文本】;
  • 移除 version_recent 支持。

介于 HMCL 端的重构已全部完成,我先将本 PR 标记为 'Ready for review'。但请注意:陶瓦联机上仍有部分问题需要解决,因而当前 PR 不可合并。

@burningtnt burningtnt marked this pull request as draft December 5, 2025 14:06
terracotta.sudo_installing=HMCL 需要验证您的密码才能安装联机核心
terracotta.difficulty.easiest=当前网络状态极好:稍等一下就成功!
terracotta.difficulty.simple=当前网络状态较好:建立连接需要一段时间……
terracotta.difficulty.medium=当前网络状态中等:已启用抗干扰备用隧道,但需要更长时间(甚至失败)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要改成半角。Glavo 在 Gradle 自动检测规则中添加了这个。

Suggested change
terracotta.difficulty.medium=当前网络状态中等:已启用抗干扰备用隧道,但需要更长时间甚至失败
terracotta.difficulty.medium=当前网络状态中等:已启用抗干扰备用隧道,但需要更长时间 (甚至失败)

@burningtnt
Copy link
Member Author

陶瓦的 FreeBSD 构建似乎坏了 :(

@Glavo
Copy link
Member

Glavo commented Dec 6, 2025

你重新运行一下 GitHub Action?看起来可能是网络错误导致的。

@burningtnt
Copy link
Member Author

你重新运行一下 GitHub Action?看起来可能是网络错误导致的。

已多次重试,均无法正常运行

@Glavo
Copy link
Member

Glavo commented Dec 11, 2025

这个功能作用大吗?我感觉好像不是特别有用。

@burningtnt
Copy link
Member Author

这个功能作用大吗?我感觉好像不是特别有用。

按照过去几个月的经验,大部分问题表现为卡在“加入房间中”界面。我希望新添加的 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.
@burningtnt burningtnt changed the title 在加入联机房间时显示 p2p 难度 重构陶瓦下载功能 并 在加入联机房间时显示 p2p 难度 Dec 27, 2025
@burningtnt
Copy link
Member Author

介于 HMCL 端的重构已全部完成,我先将本 PR 标记为 'Ready for review'。

但请注意:陶瓦联机上仍有部分问题需要解决,因而当前 PR 不可合并。

@burningtnt burningtnt marked this pull request as ready for review December 27, 2025 12:02
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.
@burningtnt
Copy link
Member Author

希望 Glavo 能够先审查 HMCL 这边的重构。

SimpleVoiceChat 相关问题仍需上游 EasyTier 提供修复。

Copy link
Contributor

Copilot AI left a 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.

@burningtnt
Copy link
Member Author

已将计算陶瓦哈希的代码移动到 upgradeTerracottaConfig 任务

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants