Skip to content

在陶瓦联机界面启动游戏时禁用离线皮肤功能#4916

Merged
Glavo merged 3 commits intoHMCL-dev:mainfrom
Glavo:terracotta-skin
Dec 18, 2025
Merged

在陶瓦联机界面启动游戏时禁用离线皮肤功能#4916
Glavo merged 3 commits intoHMCL-dev:mainfrom
Glavo:terracotta-skin

Conversation

@Glavo
Copy link
Member

@Glavo Glavo commented Dec 3, 2025

No description provided.

@Glavo Glavo requested a review from burningtnt December 3, 2025 08:43
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 disables the offline skin functionality when launching games from the Terracotta (陶瓦) multiplayer interface to prevent potential conflicts or issues during multiplayer gameplay.

Key changes:

  • Added a new logInWithoutSkin() method to OfflineAccount that returns authentication info without loading skin configurations
  • Introduced a disableOfflineSkin flag in LauncherHelper to conditionally disable offline skin loading
  • Modified HMCLGameRepository.getLaunchOptions() to return a Builder instead of a completed LaunchOptions object, allowing further configuration before launch

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
HMCLCore/src/main/java/org/jackhuang/hmcl/auth/offline/OfflineAccount.java Added logInWithoutSkin() method to provide authentication without skin loading capabilities; refactored logIn() to use the new method
HMCL/src/main/java/org/jackhuang/hmcl/game/LauncherHelper.java Added disableOfflineSkin field and setter; modified login logic to use logInWithoutSkin() when flag is enabled; sets daemon to false when offline skin is disabled
HMCL/src/main/java/org/jackhuang/hmcl/game/HMCLGameRepository.java Changed return type from LaunchOptions to LaunchOptions.Builder to allow additional configuration
HMCL/src/main/java/org/jackhuang/hmcl/ui/terracotta/TerracottaPage.java Updated launch callback to call setDisableOfflineSkin() when launching from Terracotta interface; removed unused import
HMCL/src/main/java/org/jackhuang/hmcl/ui/terracotta/TerracottaControllerPage.java Updated launch callback to call setDisableOfflineSkin() when launching from Terracotta controller interface

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}

public AuthInfo logInWithoutSkin() throws AuthenticationException {
// Using "legacy" user type here because "mojang" user type may cause "invalid session token" or "disconnected" when connecting to a game server.
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

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

The comment mentions using "legacy" user type, but the code actually uses AuthInfo.USER_TYPE_MSA which is "msa", not "legacy". The comment should be updated to accurately reflect the user type being used, or the code should be changed to use AuthInfo.USER_TYPE_LEGACY if that was the original intent.

Suggested change
// Using "legacy" user type here because "mojang" user type may cause "invalid session token" or "disconnected" when connecting to a game server.
// Using "msa" user type here to avoid potential "invalid session token" or "disconnected" issues when connecting to a game server.

Copilot uses AI. Check for mistakes.
@Glavo Glavo merged commit 567bd15 into HMCL-dev:main Dec 18, 2025
8 checks passed
@Glavo Glavo deleted the terracotta-skin branch December 18, 2025 13:18
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.

2 participants