Skip to content
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

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

Open
Simba98 opened this issue Dec 14, 2024 · 0 comments

Comments

@Simba98
Copy link

Simba98 commented Dec 14, 2024

描述 | 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

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

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

No branches or pull requests

1 participant