HMCL-dev / HMCL-dev/HMCL

[Feature] 在整合包内同名文件更新了哈希时支持优先覆盖为服务器版本

Open
#3,495 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
10.1k
Forks
934
Avg merge
1d 5h
Merged PRs (30d)
82

Description

描述 | Description

话说hmcl的服务器在线更新功能,似乎不会更新诸如server.dat这样的内容

我更新了server-mainfest.json之后,server.dat因为已经存在,而且会被玩家的mc客户端修改;因此新的server.dat不会被下载并覆盖。

代码的行为是:新文件会下载,被删除的文件会删除
但是玩家已经修改的文件不会做处理
https://github.com/HMCL-dev/HMCL/blob/main/HMCLCore/src/main/java/org/jackhuang/hmcl/mod/server/ServerModpackCompletionTask.java#L135

这和Git冲突有类似的想法,服务器上有一个新“提交”,客户端也产生了一个新“提交”;
现在的行为是merge时总是采用客户端的提交

是否可以考虑提供一个update behaviour标记,通知HMCL应当采用服务器的新提交?
{
"path": "mods/abc.jar",
"hash": "abcabc",
"update": "force",
},
如果没有此标记则保留现在的默认行为,即冲突时采用客户端版本。

原因 | Reason

这样可以更新服务器地址等其他内容
当然这样会覆盖玩家原有的设置,需要服务器更新提供者注意。

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with HMCLCore/src/main/java/org/jackhuang/hmcl/mod/server/ServerModpackCompletionTask.java around line 135 and review the server-mainfest.json behavior described in the issue. Trace how new, deleted, and already-modified client files are handled. Done means a manifest entry can request server-version replacement while entries without it retain the current client-version conflict behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
desktop
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.