HMCL-docs/modpack/serverpack.html
2026-03-15 12:44:04 +00:00

2 lines
9.8 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!doctype html><html lang="zh" class="no-js"><head><meta charset="utf-8"><title>服务端自动更新整合包制作教程 - HMCL 文档</title><meta name="description" content="创建可自动更新的服务器整合包"><meta property="og:type" content="article"><meta property="og:locale" content="zh"><meta property="og:site_name" content="HMCL 文档"><meta property="og:title" content="服务端自动更新整合包制作教程"><meta property="og:url" content="https://docs.hmcl.net/modpack/serverpack.html"><meta property="og:description" content="创建可自动更新的服务器整合包"><meta property="article:published_time" content="2021-08-22T23:18:02+08:00"><meta property="article:modified_time" content="2025-12-06T09:37:00+08:00"><link rel="canonical" href="https://docs.hmcl.net/modpack/serverpack.html"><link href="/feed.xml" type="application/atom+xml" rel="alternate" title="HMCL 文档 Feed"><meta name="viewport" content="width=device-width, initial-scale=1.0"> <script> document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/g, '') + ' js '; window.enable_copy_code_button = true; </script><link rel="stylesheet" href="/assets/css/main.css"><link rel="stylesheet" href="/assets/lib/fontawesome/css/all.min.css"> <noscript><link rel="stylesheet" href="/assets/lib/fontawesome/css/all.min.css"></noscript> <script src="/assets/js/settings.js"></script> <script src="/assets/js/theme.js"></script><link rel="shortcut icon" href="/favicon.ico"><link rel="stylesheet" id="skin"></head><body class="layout--document" dir="ltr"><nav class="skip-links"><ul><li><a href="#site-nav" class="screen-reader-shortcut">转到主导航栏</a></li><li><a href="#main" class="screen-reader-shortcut">转到内容</a></li><li><a href="#footer" class="screen-reader-shortcut">转到底部</a></li></ul></nav><div class="masthead"><div class="masthead__inner-wrap"><div class="masthead__menu"><nav id="site-nav" class="greedy-nav"> <a class="site-logo" href="/"><img src="/assets/img/hmcl.png" alt="HMCL 文档"></a> <a class="site-title" href="/"> HMCL 文档 </a><ul class="visible-links"><li class="masthead__menu-item"> <a href="/settings.html" >设置</a></li></ul><button class="greedy-nav__toggle hidden" type="button"> <span class="visually-hidden">切换菜单</span><div class="navicon"></div></button><ul class="hidden-links hidden"></ul></nav></div></div></div><div class="initial-content"><div id="main" role="main"><div class="sidebar sticky"><nav class="nav__list"> <input id="ac-toc" name="accordion-toc" type="checkbox" /> <label for="ac-toc">切换菜单</label><ul class="nav__items"><li> <span class="nav__sub-title">问题集合</span><ul><li><a href="/faq.html">常见问题</a></li><li><a href="/launcher/">启动器使用相关</a></li><li><a href="/modpack/">整合包帮助</a></li><li><a href="/multiplayer/">多人联机帮助</a></li></ul></li><li> <span class="nav__sub-title">使用者帮助</span><ul><li><a href="/launcher/isolation.html">版本隔离</a></li><li><a href="/launcher/offline-skin.html">设置离线皮肤</a></li><li><a href="/launcher/auto-installing.html">HMCL 的自动安装使用教程</a></li><li><a href="/launcher/shader.html">安装光影</a></li><li><a href="/launcher/set-item-details.html">设置项详解</a></li></ul></li><li> <span class="nav__sub-title">开发者帮助</span><ul><li><a href="/launcher/datapack.html">制作 HMCL 格式的数据包</a></li><li><a href="/modpack/serverpack.html" class="active">制作整合包</a></li><li><a href="/launcher/authlib-injector.html">添加默认 authlib-injector 验证服务器</a></li></ul></li><li> <span class="nav__sub-title">更新日志</span><ul><li><a href="/changelog/stable.html">稳定版</a></li><li><a href="/changelog/dev.html">开发版</a></li></ul></li><li> <span class="nav__sub-title">其他</span><ul><li><a href="/eula/hmcl.html">用户协议</a></li><li><a href="/contribution.html">贡献指南</a></li><li><a href="https://hmcl.huangyuhui.net">项目官网</a></li><li><a href="https://github.com/HMCL-dev/HMCL">项目仓库</a></li><li><a href="https://github.com/HMCL-dev/HMCL-docs">文档仓库</a></li></ul></li></ul></nav></div><article class="page" itemscope itemtype="https://schema.org/CreativeWork"><meta itemprop="headline" content="服务端自动更新整合包制作教程"><meta itemprop="description" content="创建可自动更新的服务器整合包"><meta itemprop="datePublished" content="2021-08-22T23:18:02+08:00"><meta itemprop="dateModified" content="2025-12-06T09:37:00+08:00"><div class="page__inner-wrap"><header><h1 id="page-title" class="page__title" itemprop="headline"> <a href="https://docs.hmcl.net/modpack/serverpack.html" itemprop="url">服务端自动更新整合包制作教程 </a></h1></header><section class="page__content" itemprop="text"><aside class="sidebar__right sticky"><nav class="toc"><header><h4 class="nav__title"><i class="fas fa-file-alt"></i> 目录</h4></header><ul class="toc__menu"><li><a href="#第一步导出整合包">第一步:导出整合包</a></li><li><a href="#第二步导入整合包">第二步:导入整合包</a></li><li><a href="#第三步部署整合包更新服务器">第三步:部署整合包更新服务器</a></li><li><a href="#第四步更新整合包">第四步:更新整合包</a></li></ul></nav></aside><img src="https://hits.zkitefly.eu.org/?tag=https%3A%2F%2Fdocs.hmcl.net%2Fmodpack%2Fserverpack.html" alt="Hits" decoding="async"><div class="notice--info"><p>本文由 huanghongxun 创建。</p></div><p>HMCL 允许服务器管理员借助服务端自动更新整合包来实现自动分发整合包更新,这将大大方便有需要频繁更新游戏客户端 Mod、配置等信息的服务器管理员。</p><p>HMCL 需要服务器管理员额外提供一个 HTTP 服务器(只需要能提供静态文件服务,比如 Apache 和 Nginx 皆可)来提供检查整合包更新并允许 HMCL 下载更新文件。</p><h2 id="第一步导出整合包">第一步:导出整合包</h2><p>在 HMCL 中右键做好的客户端版本,选择<code class="language-plaintext highlighter-rouge">导出整合包</code></p><p><img src="/assets/img/docs/serverpack/img1.png" alt=""></p><p>选择导出为<code class="language-plaintext highlighter-rouge">服务器自动更新整合包</code></p><p><img src="/assets/img/docs/serverpack/img2.png" alt=""></p><p>填写整合包信息,整合包下载链接前缀如何填写请看下文</p><p><img src="/assets/img/docs/serverpack/img3.png" alt=""></p><p>选择需要包含在整合包内的文件后将产生整合包压缩文件</p><h2 id="第二步导入整合包">第二步:导入整合包</h2><p>接着创建一个全新的空文件夹,将启动器复制进去</p><p><img src="/assets/img/docs/serverpack/img4.png" alt=""></p><p>运行启动器,并导入刚才导出的整合包,导入完成后,这个文件夹(这里叫“新整合包”)可以打包发给玩家。</p><h2 id="第三步部署整合包更新服务器">第三步:部署整合包更新服务器</h2><p>你可以借助 Apache、Nginx 等支持静态文件的 HTTP 服务器软件提供文件。首先,决定好整合包下载链接前缀,比如我希望 HMCL 从远程服务器的 http://www.site.com/modpack 目录下存放整合包的更新信息,则在之前导出整合包的整合包下载前缀中填写 http://www.site.com/modpack。</p><p><img src="/assets/img/docs/serverpack/img5.png" alt=""></p><p>上图为导出的服务器自动更新整合包压缩文件的内容,你需要将这个整合包解压到 http://www.site.com/modpack 下。也就是说,从 http://www.site.com/modpack/server-manifest.json 这个链接下载下来的文件必须和上图中整合包压缩文件中的 server-manifest.json 文件一致并且http://www.site.com/modpack/overrides 是一个文件夹,里面存放了整合包文件,比如:</p><p><img src="/assets/img/docs/serverpack/img6.png" alt=""></p><p>整合包压缩文件 test.zip/overrides/mods/Advancement_Book-1.12-1.0.3.jar 文件必须可以从 http://www.site.com/modpack/overrides/mods/Advancement_Book-1.12-1.0.3.jar 该目录下载下来,且文件内容一致。那么至此更新服务器就部署完成了。</p><h2 id="第四步更新整合包">第四步:更新整合包</h2><p>如果你需要更新整合包,那么将新的整合包经过第一步导出新的整合包压缩文件,并解压到类似 http://www.site.com/modpack 文件夹下即可完成新整合包的部署。</p></section><footer class="page__meta"><p class="page__date"><strong><i class="fas fa-fw fa-calendar-alt" aria-hidden="true"></i> 更新时间:</strong> <time class="dt-published" datetime="2025-12-06">2025-12-06</time></p></footer><nav class="pagination"> <a href="#" class="pagination--pager disabled">上一页</a> <a href="/modpack/serverpack2.html" class="pagination--pager" title="配置客户端自动更新(宝塔面板)">下一页</a></nav></div></article></div></div><div id="footer" class="page__footer"><footer><div class="page__footer-follow"><ul class="social-icons"><li><strong>关注:</strong></li><li><a href="https://github.com/HMCL-dev/HMCL" rel="nofollow noopener noreferrer"><i class="fab fa-fw fa-github" aria-hidden="true"></i> Github</a></li><li><a href="https://beian.miit.gov.cn" rel="nofollow noopener noreferrer"><i class="fas fa-link" aria-hidden="true"></i> 粤ICP备18071565号</a></li><li><a href="/feed.xml"><i class="fas fa-fw fa-rss-square" aria-hidden="true"></i> Feed</a></li></ul></div><div class="page__footer-copyright">&copy; 2026 <a href="mailto:hmcl@huangyuhui.net">huanghongxun</a>. 技术来自于 <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/jekyll-themes/minimal-mistakes/" rel="nofollow">Minimal Mistakes</a>.</div></footer></div><script src="/assets/js/main.min.js"></script> <script src="/assets/js/plugins/jquery.auto-redirect.js"></script></body></html>