BUTR 服务器信息

BUTR 服务器信息

提供扩展服务器信息端点的专用服务器模块(HTTP GET /butr/v1/server)。为 Vortex 服务器浏览器和一键集合发布已加载的模组和客户端要求。

[center]
[size=6][b]Bannerlord.ServerInfo[/b][/size]
[size=4]扩展的服务器信息端点[/size]
[url=https://github.com/BUTR/BUTR.ServerTools][b]GitHub 仓库[/b][/url]
[/center]
[line]

[size=5][b]概述[/b][/size]
[b]Bannerlord.ServerInfo[/b] 是一个专为《骑马与砍杀 II:霸主》自定义多人服务器设计的专用服务器模组。它会检查并发布服务器上运行的确切模组列表,并指示玩家需要哪些模组才能连接。

外部工具和启动器扩展(例如 [b]Vortex Server Browser[/b])会查询此端点,以便玩家在加入之前查看所需模组、版本兼容性以及直接下载链接。

数据通过 HTTP 在服务器现有游戏端口上以 TCP 方式提供,路径为 [font=Courier New]GET /butr/v1/server[/font]。这利用了已用于提供原版服务器端点(如 [font=Courier New]/maps/list[/font])的内嵌 ASP.NET Core Web 主机,无需额外端口或外部 Web 服务器。

[line]

[size=5][b]主要特性[/b][/size]
[list]
[][b]自动模组发现与分类[/b]:已加载的服务器模组会使用游戏大厅的原生会话模型直接进行发现和分类。大厅在连接时强制要求的核心模组会标记为 [font=Courier New]"required": true[/font],而可选的客户端模组([font=Courier New]MultiplayerOptional[/font])则标记为 [font=Courier New]"required": false[/font]。[/]
[][b]Vortex 一键合集[/b]:引导玩家前往 Nexus Mods 合集,使他们可以在 Vortex 中一键安装所有必需的服务器模组。[/]
[][b]自定义下载链接与元数据[/b]:提供直接的 Nexus Mods ID、自定义 URL 以及社区链接(Discord、网站、服务器描述)。[/]
[][b]隐藏管理模组[/b]:可通过 [font=Courier New]hiddenServerModules[/font] 将服务器端管理工具从公开列表中排除。[/]
[][b]零 Harmony / 零补丁[/b]:不会对游戏代码进行补丁、不使用 Harmony,也不修改游戏程序集。基于干净的基线 ASP.NET Core 抽象进行编译。[/]
[][b]实时重载命令[/b]:可即时更新 [font=Courier New]server-info.json[/font],并使用专用服务器控制台命令 [font=Courier New]reload_server_info[/font] 重载,无需重启服务器。[/]
[][b]通用兼容性[/b]:单个下载支持从 [b]v1.0.0 到最新测试版[/b] 的所有专用服务器版本。[/]
[/list]
[line]

[size=5][b]面向服务器所有者[/b][/size]
[size=4][b]1. 安装[/b][/size]
[list=1]
[]下载 [font=Courier New]Bannerlord.ServerInfo[/font] 并解压到专用服务器的 [font=Courier New]Modules[/font] 文件夹中。[/]
[]将其添加到模块启动参数中:
[code]MODULESNativeMultiplayer
Bannerlord.ServerInfo*MODULES[/code][/]
[
]确保服务器的游戏端口除 UDP 外还开放 [b]TCP 流量[/b]。玩家通过 UDP 连接,而服务器浏览器通过 TCP 查询服务器信息。[/*]
[/list]
[quote]由于该模组使用 [font=Courier New]Server[/font] 模组类别,连接的游戏客户端永远不需要安装它。[/quote]
[size=4][b]2. 配置(server-info.json)[/b][/size]
编辑 [font=Courier New]Modules/Bannerlord.ServerInfo/server-info.json[/font] 以提供社区链接、下载 ID 或合集:

[code]{
"description": "Siege every evening, EU timezone.",
"links": [
{ "label": "Discord", "url": "https://discord.gg/yourserver" }
],
"clientModules": [
// Direct download links for mods hosted on Nexus Mods
{ "id": "CustomArmorMod", "nexusMods": { "modId": 1234, "fileId": 5678 } },
// Recommend client-only optional mods not installed on the server
{ "id": "CustomUiMod", "name": "Custom UI Mod", "version": "v1.0.0", "url": "https://..." }
],
// Nexus Mods collection allowing players to install all mods at once
"nexusMods": {
"collection": { "slug": "your-collection-slug", "revision": 1 }
},
// Server-only modules to omit from public listings (e.g. admin tools)
"hiddenServerModules": [ "PrivateAdminTools" ]
}[/code]
在专用服务器控制台中运行 [font=Courier New]reload_server_info[/font] 即可在不重启服务器的情况下应用更改。

[line]

图片与描述由 Gemini 生成。