diff options
| author | Sho Sakuma <me@m1sk9.dev> | 2026-02-06 18:42:50 +0900 |
|---|---|---|
| committer | Sho Sakuma <me@m1sk9.dev> | 2026-02-06 18:42:50 +0900 |
| commit | 7f5f826eaf00edd30e116d5940dd139a9e1b04a5 (patch) | |
| tree | 69c1405bcfe1f9bfdcf8bff4218579ec82256921 | |
| parent | 0afd010990b8f73d6db5dfb1be353dcf163a63d3 (diff) | |
| download | LunaticChat-7f5f826eaf00edd30e116d5940dd139a9e1b04a5.tar.gz LunaticChat-7f5f826eaf00edd30e116d5940dd139a9e1b04a5.tar.bz2 LunaticChat-7f5f826eaf00edd30e116d5940dd139a9e1b04a5.zip | |
chore: Support Velocity docker
| -rw-r--r-- | docker/.gitignore | 3 | ||||
| -rw-r--r-- | docker/README.md | 214 | ||||
| -rw-r--r-- | docker/compose.yaml | 70 | ||||
| -rw-r--r-- | docker/velocity.toml | 5 |
4 files changed, 69 insertions, 223 deletions
diff --git a/docker/.gitignore b/docker/.gitignore index 16873f6..4c0fc30 100644 --- a/docker/.gitignore +++ b/docker/.gitignore @@ -1 +1,2 @@ -plugins/ +plugins-paper-*/ +plugins-velocity/ diff --git a/docker/README.md b/docker/README.md deleted file mode 100644 index 9efe09e..0000000 --- a/docker/README.md +++ /dev/null @@ -1,214 +0,0 @@ -# LunaticChat Docker Development Environment - -This directory contains Docker Compose configuration for testing LunaticChat with Velocity proxy integration. - -## Architecture - -``` -┌─────────────────┐ -│ Minecraft │ -│ Client │ -│ localhost:25577│ -└────────┬────────┘ - │ - v -┌─────────────────┐ -│ Velocity │ -│ Proxy │ -│ Port: 25577 │ -│ + LunaticChat │ -│ (Velocity) │ -└────────┬────────┘ - │ - v -┌─────────────────┐ -│ Paper Server │ -│ minecraft:25565│ -│ + LunaticChat │ -│ (Paper) │ -└─────────────────┘ -``` - -## Requirements - -- Docker -- Docker Compose -- Gradle (for building plugins) - -## Quick Start - -```bash -# Build plugins and start containers -./x start - -# View Minecraft server logs -./x logs - -# View Velocity proxy logs -./x vlogs - -# Restart containers -./x restart - -# Stop containers -./x stop - -# Clean up (remove volumes) -./x clean - -# Access RCON -./x rcon -``` - -## Configuration - -### LunaticChat Paper Plugin - -Configuration file: `docker/plugins/LunaticChat/config.yml` - -Key settings: -- `features.velocityIntegration.enabled: true` - Enables Velocity integration -- `debug: true` - Enables debug logging - -### Velocity Proxy - -Configuration file: `docker/velocity.toml` - -Key settings: -- `online-mode = false` - Offline mode for testing -- `player-info-forwarding-mode = "NONE"` - No player info forwarding -- `servers.minecraft = "minecraft:25565"` - Backend server connection - -## Testing Velocity Integration - -### 1. Start the environment - -```bash -./x start -``` - -Wait for both containers to start. You should see: -- Paper server: "Done! For help, type 'help'" -- Velocity: "Done (X.XXs)!" - -### 2. Connect with Minecraft client - -1. Open Minecraft Java Edition -2. Add a server with address: `localhost:25577` -3. Connect to the server - -### 3. Verify handshake - -When you join the server, LunaticChat will perform a handshake between Paper and Velocity. - -**Expected behavior:** -- Paper plugin sends handshake message to Velocity -- Velocity plugin validates plugin version and protocol version -- If compatible: connection succeeds, handshake logs appear in both containers -- If incompatible: Paper plugin disables itself with error message - -**Check logs:** - -Paper server: -```bash -./x logs | grep -i handshake -``` - -Expected output: -``` -[INFO]: [LunaticChat] Sending handshake to Velocity (Plugin: 0.8.0, Protocol: 1.0.0) -[INFO]: [LunaticChat] Velocity handshake successful with version 0.7.0 -``` - -Velocity proxy: -```bash -./x vlogs | grep -i handshake -``` - -Expected output: -``` -[INFO] [lunaticchat]: Received handshake from minecraft: Plugin=0.8.0, Protocol=1.0.0 -[INFO] [lunaticchat]: Handshake successful with minecraft -``` - -### 4. Test /lcv status command - -In-game or via RCON: -``` -/lcv status -``` - -Expected output: -- Paper Plugin Version -- Velocity Plugin Version -- Protocol Version -- Connection State: Connected -- Live status check results - -## Version Compatibility - -### Plugin Version Check -- **Rule:** Paper and Velocity plugin versions must match exactly -- **Example:** Paper 0.8.0 + Velocity 0.8.0 = ✓ PASS -- **Example:** Paper 0.8.0 + Velocity 0.7.0 = ✗ FAIL - -### Protocol Version Check -- **Rule:** MAJOR.MINOR must match (PATCH differences are OK) -- **Example:** Paper 1.0.0 + Velocity 1.0.1 = ✓ PASS -- **Example:** Paper 1.0.0 + Velocity 1.1.0 = ✗ FAIL -- **Example:** Paper 1.0.0 + Velocity 2.0.0 = ✗ FAIL - -## Troubleshooting - -### Paper plugin disabled on startup - -**Cause:** Handshake failed or timed out - -**Solutions:** -1. Check Velocity is running: `docker ps | grep velocity` -2. Check plugin versions match in both containers -3. Review error messages in Paper logs: `./x logs | grep ERROR` - -### "Handshake timeout" error - -**Cause:** Paper plugin couldn't reach Velocity proxy - -**Solutions:** -1. Verify network connectivity: `docker network inspect docker_minecraft-network` -2. Check Velocity logs for errors: `./x vlogs` -3. Restart containers: `./x restart` - -### Version mismatch errors - -**Cause:** Plugin versions don't match or protocol incompatible - -**Solutions:** -1. Rebuild both plugins: `./gradlew clean :platform-paper:shadowJar :platform-velocity:shadowJar` -2. Restart containers: `./x restart` -3. Verify versions in logs match - -## Network Details - -- **Velocity Public Port:** 25577 (connect here with Minecraft client) -- **Paper RCON Port:** 25575 (for remote commands) -- **Internal Network:** `minecraft-network` (bridge driver) -- **Paper Internal Address:** `minecraft:25565` (accessible from Velocity) - -## Useful Commands - -```bash -# Follow logs in real-time -docker compose -f docker/compose.yaml logs -f - -# Execute command in Minecraft server -docker compose -f docker/compose.yaml exec minecraft rcon-cli -> /list -> /lcv status - -# Shell access to containers -docker compose -f docker/compose.yaml exec minecraft bash -docker compose -f docker/compose.yaml exec velocity bash - -# View Velocity configuration -docker compose -f docker/compose.yaml exec velocity cat /server/velocity.toml -``` diff --git a/docker/compose.yaml b/docker/compose.yaml index 7ab8e19..f11bf95 100644 --- a/docker/compose.yaml +++ b/docker/compose.yaml @@ -7,13 +7,16 @@ services: volumes: - lunatic-debug-velocity-data:/server - ../platform-velocity/build/libs:/plugins:ro + - ./plugins-velocity:/data/plugins - ./velocity.toml:/server/velocity.toml environment: TYPE: "VELOCITY" MEMORY: "512M" ONLINE_MODE: "false" depends_on: - minecraft: + s1: + condition: service_healthy + s2: condition: service_healthy healthcheck: test: mc-health @@ -24,17 +27,65 @@ services: networks: - minecraft-network - minecraft: + s1: image: itzg/minecraft-server:java21 - container_name: debug-server + container_name: debug-server-s1 expose: - "25565" ports: - "25575:25575" volumes: - - lunatic-debug-minecraft-data:/data + - lunatic-debug-s1-data:/data + - ../platform-paper/build/libs:/plugins:ro + - ./plugins-paper-s1:/data/plugins + - ./bukkit.yml:/data/bukkit.yml + environment: + EULA: "TRUE" + TYPE: "PAPER" + VERSION: "1.21.11" + MEMORY: "1G" + + # デバッグ用高速化設定 + LEVEL_TYPE: "flat" + VIEW_DISTANCE: "3" + SIMULATION_DISTANCE: "3" + GENERATE_STRUCTURES: "false" + SPAWN_PROTECTION: "0" + ALLOW_NETHER: "false" + + # 権限関連 + OVERRIDE_SERVER_PROPERTIES: "true" + + ENABLE_RCON: "true" + RCON_PASSWORD: "minecraft" + RCON_PORT: 25575 + + DIFFICULTY: "peaceful" + MAX_PLAYERS: "3" + ONLINE_MODE: "false" + SYNC_SKIP_NEWER_IN_DESTINATION: "false" + networks: + - minecraft-network + healthcheck: + test: mc-health + start_period: 60s + interval: 10s + timeout: 5s + retries: 3 + tty: true + stdin_open: true + + s2: + image: itzg/minecraft-server:java21 + container_name: debug-server-s2 + expose: + - "25565" + ports: + - "25576:25575" + volumes: + - lunatic-debug-s2-data:/data - ../platform-paper/build/libs:/plugins:ro - - ./plugins:/data/plugins + - ./plugins-paper-s2:/data/plugins - ./bukkit.yml:/data/bukkit.yml environment: EULA: "TRUE" @@ -63,6 +114,12 @@ services: SYNC_SKIP_NEWER_IN_DESTINATION: "false" networks: - minecraft-network + healthcheck: + test: mc-health + start_period: 60s + interval: 10s + timeout: 5s + retries: 3 tty: true stdin_open: true @@ -71,5 +128,6 @@ networks: driver: bridge volumes: - lunatic-debug-minecraft-data: + lunatic-debug-s1-data: + lunatic-debug-s2-data: lunatic-debug-velocity-data: diff --git a/docker/velocity.toml b/docker/velocity.toml index 4d2cd19..1b5b374 100644 --- a/docker/velocity.toml +++ b/docker/velocity.toml @@ -60,11 +60,12 @@ show-plugins = false [servers] # Configure your servers here. Each key represents the server's name, and the value # represents the IP address of the server to connect to. -minecraft = "minecraft:25565" +s1 = "s1:25565" +s2 = "s2:25565" # In what order we should try servers when a player logs in or is kicked from a server. try = [ - "minecraft" + "s1" ] [forced-hosts] |
