Skip to content

Latest commit

 

History

History
128 lines (118 loc) · 4.21 KB

README.zh.md

File metadata and controls

128 lines (118 loc) · 4.21 KB

BeatTogether-DockerCompose

en zh

使用 Docker Compose 部署 可扩展BeatTogether 服务器的简单指南。

如果你只是需要一个小型多人服务器,建议使用 UnifiedServer

欢迎使用讨论版 Discussions

如何开服

全新部署

  1. 确认你在使用Linux并且安装了Docker
  2. 克隆或者下载此仓库
  3. 按照你的需求修改json设置文件。 文档见下方.
  4. 确认你的当前工作目录(current working directory) 在这个仓库的根目录
  5. 运行 docker compose up -d 启动服务器
  6. 将这个服务器添加进 BeatTogether 的Mod的设置中。 详见下方

更新现有服务器

  1. 如果服务器还在运行,先执行 docker compose down 来停止服务器
  2. 执行 docker compose pull 以拉取最新镜像。
  3. 重要:用你的设置文件与此仓库中的文件进行对比,并在必要时更新你的设置文件。服务器更新可能导致设置文件结构发生变化
  4. 运行 docker compose up -d 启动服务器

Json 设置文件

  • 这里并不包含全部的选项,但涵盖了大部分重要设置
  • 你需要去阅读服务器源代码来找到更多的可用选项
  • 设置文件结构可能会随 BeatTogether 服务器的更新而发生变化。

主服务器

master.json

{
  "Urls": "http://0.0.0.0:8989",         // 用于主服务器监听的ip和端口
  "ServerConfiguration": {
    "AuthenticateClients": true          // 客户端是否需要被认证
  },
  "Serilog": {
    "File": {
      "FileSizeLimitBytes": "33554432",  // 最大日志文件大小 (这里是32M)
      "RetainedFileCountLimit": 8        // 最大日志文件数量
    }
  }
}

专用服务器

dedicated.json

{
  "ServerConfiguration": {
    "HostEndpoint": "192.168.1.250",     // 用于游戏客户端连接的服务器公网地址
    "BasePort": 30000,                   // 每个游戏房间的端口号从这里开始
    "MaximumSlots": 10000                // 最大房间数
  },
  "Serilog": {
    "File": {
      "FileSizeLimitBytes": "33554432",
      "RetainedFileCountLimit": 8
    }
  }
}

状态Api服务器

api.json

{
  "Urls": "http://0.0.0.0:23280",         // 用于api服务器监听的端口和地址  
  "Status": {
    "MinimumAppVersion": "1.37.0",        // 最低支持的游戏版本
    "ServerDisplayName": "My BeatTogether Server",
    "ServerDescription": "My Cross Platform Custom Song Multiplayer Server",
    "ServerImageUrl": "",
    "ServerSupportsPPModifiers": true,    // 服务器是否支持每个玩家不同的游戏修改项
    "ServerSupportsPPDifficulties": true, // 服务器是否支持每个玩家不同的难度
    "RequiredMods": [                     // 游戏mod的版本要求,如果安装了
      {
        "id": "MultiplayerCore",
        "version": "1.5.1"
      },
      {
        "id": "BeatTogether",
        "version": "2.0.0"
      },
      {
        "id": "BeatSaberPlus_SongOverlay",
        "version": "4.6.1"
      },
      {
        "id": "EditorEX",
        "version": "1.2.0"
      },
      {
        "id": "LeaderboardCore",
        "version": "1.2.2"
      }
    ]
  },
  "Serilog": {
    "File": {
      "FileSizeLimitBytes": "33554432",
      "RetainedFileCountLimit": 8
    }
  }
}

BeatTogether Mod 设置

BeatSaber/Userdata/中的BeatTogether.json

{
  ...
  "Servers": [
    ...
    {                                                       // 添加这一段
      "ServerName": "Some Server Name",
      "HostName": "192.168.1.250",                          // 主服务器的地址
      "ApiUrl": "http://192.168.1.250:8989",                // 将地址和端口替换为主服务器的
      "StatusUri": "http://192.168.1.250:23280/status",     // 将地址和端口替换为api服务器的
      "MaxPartySize": 10
    },
    ...
  ]
  ...
}