BuildContest 图标

BuildContest

作者:rebot | 分类:模组

价格:0 墨喵币 下载量:0 点赞:0 版本 1.1-SNAPSHOT
本资源为搬运资源,原资源地址: https://modrinth.com/mod/buildcontest
资源信息

Minecraft 版本: 1.17 1.17.1 1.18 1.18.1 1.18.2 1.19 1.19.1 1.19.2 1.19.3 1.19.4 1.20 1.20.1 1.20.2 1.20.3 1.20.4 1.20.5 1.20.6 1.21 1.21.1

平台: velocity

标签: management

资源介绍

BuildContest Plugin

BuildContest is a Velocity plugin that simplifies the setup of dedicated servers for each team in a building contest. The plugin uses Docker Compose to start sub-servers and automatically transfers players to their respective sub-servers for the contest. Team configurations and server information are persistently stored.

Features

  • Automatic Sub-Server Creation: Create team servers using HTTP API calls with Docker Compose, and register them with Velocity.
  • Automatic Player Transfer: Players are automatically transferred to their corresponding sub-servers when joining the main server.
  • Permission Control: Authenticate HTTP requests using Bearer Token.
  • Prevent Duplicate Participation: When adding a team, if a player already exists in another team, they cannot join other teams.

Installation Steps

  1. Prepare the Environment

    • Install Velocity proxy server.
    • Ensure Docker and Docker Compose are installed and properly configured.
  2. Create a Minecraft Contest Server Image (Sub-Server)

    • It's recommended to use Little Wrench as the server base.
    • Set the port to 25565 and ensure it can be accessed correctly via the proxy, including proper forwarding-mode settings.
    • Create a Dockerfile for building the server image.
    • Build the image, e.g., docker build -t minecraft-contest:latest .
    • Create a docker-compose.yml file for starting the sub-server.
  3. Download the Plugin

  4. Configure the Plugin

    • Place the plugin jar file in the plugins/ directory of Velocity.
    • Start the Velocity server once to generate the configuration files, then stop the server to adjust settings.
  5. Configure Files

    • Modify config.yml in the plugins/BuilderContest/ directory to set up ports and other settings.
    • Place docker-compose-default.yml in the plugin directory as the template for starting sub-servers.
  6. Start the Server

    • Start the server and retrieve the bearer-token from the generated config.yml.

Configuration File Description

config.yml

ktor:
  http-port: 8080 # HTTP service port.
  port-start: 30000 # Starting port for sub-servers.
  bearer-token: # Bearer Token; leave this empty on first use.
  allow-host: "*" # Allowed host addresses.

docker-compose-default.yml Example

  • Use #SERVER_NAME_PLACEHOLDER as the placeholder for the Docker container name.
  • Use #SERVER_PORT_PLACEHOLDER as the placeholder for the port.
    version: '3.8'
    services:
    minecraft_server:
      image: minecraft-contest:latest
      container_name: "#SERVER_NAME_PLACEHOLDER"
      ports:
        - #SERVER_PORT_PLACEHOLDER:25565
      volumes:
        # Mount the local world directory to the specified path in the container
        - ./worlds/#SERVER_NAME_PLACEHOLDER/world:/app/world
      environment:
        EULA: "TRUE"
      restart: unless-stopped

Usage Instructions

HTTP API

  • After the plugin starts, an HTTP service will be launched on port 8080 by default.
  • Key API endpoint:
    • Add Team: POST /team/add, requires Bearer Token authentication, with teamId, teamName, and members as payload fields.

Example Request

curl --location --request POST 'http://localhost:8080/team/add' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer sSCj4piDoEfV2zIo_C8lD7S4ul0YlVOyBr2BkKpdsTI (Retrieve this from config.yml)' \
--data-raw '{
    "teamId": "team_1",
    "teamName": "Team 1",
    "members": ["Hanamizu_", "user1"]
}'
下载太慢?试试 墨喵加速站,支持 Modrinth 和外网直链高速下载! 用的人越多,下载的越快!
下载与版本
评论(0)
登录 后发表评论。

暂无评论,抢个沙发吧~

举报此资源

请登录后举报

🔥 相关推荐
Ender Eyes

价格:0 墨喵币
下载量:0

查看详情
OPPistons

价格:0 墨喵币
下载量:0

查看详情
Atlas

价格:0 墨喵币
下载量:0

查看详情
EGAcraft

价格:0 墨喵币
下载量:0

查看详情