Skip to content

Commit 466a4cc

Browse files
committed
Add info to README and example config comments
1 parent e9c838a commit 466a4cc

File tree

2 files changed

+75
-0
lines changed

2 files changed

+75
-0
lines changed

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,57 @@
11
# Fake Minecraft Server
22

33
[![CI](https://github.com/OreQr/fake-minecraft-server/actions/workflows/ci.yml/badge.svg)](https://github.com/OreQr/fake-minecraft-server/actions/workflows/ci.yml)
4+
5+
Lightweight Rust implementation of a fake Minecraft server. It supports server list responses (status/ping) and connection attempts, useful for testing clients or as a placeholder server.
6+
7+
## Configuration
8+
9+
Server uses a YAML configuration file (`config.yml`). If no configuration is found, default values will be used.
10+
11+
You can specify a custom path to the configuration file by setting the `CONFIG_PATH` environment variable.
12+
13+
Example configuration file with comments is provided in [`config.example.yml`](https://github.com/OreQr/fake-minecraft-server/blob/master/config.example.yml).
14+
15+
### Default values:
16+
17+
```yaml
18+
debug: false
19+
20+
host: 127.0.0.1
21+
port: 25565
22+
23+
status:
24+
version:
25+
same: true
26+
27+
players:
28+
max: 20
29+
online: 0
30+
31+
motd: "§cFake Minecraft Server"
32+
favicon: server-icon.png
33+
34+
kick_message: "§c§lThis is a fake server!\n§eIt only responds to ping requests."
35+
```
36+
37+
## Debugging
38+
39+
To enable debug logging, you can either:
40+
41+
1. Set the environment variable:
42+
43+
```bash
44+
DEBUG=true
45+
# or Rust lang
46+
RUST_LOG="debug"
47+
```
48+
49+
2. Or enable debug in the config file:
50+
51+
```yaml
52+
debug: true
53+
```
54+
55+
## License
56+
57+
[MIT](https://github.com/OreQr/fake-minecraft-server/blob/master/LICENSE)

config.example.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,43 @@
1+
# Enable debug logging in addition to DEBUG/RUST_LOG environment variable
2+
debug: false
3+
4+
# IP address the server will listen on
15
host: 127.0.0.1
6+
# Port number the server will listen on (default Minecraft port is 25565)
27
port: 25565
38

9+
# Server status response configuration
410
status:
11+
# Version information shown in the server list
512
version:
13+
# Minecraft version string to display
614
name: 1.21.5
15+
# Protocol version number (see: https://minecraft.wiki/w/Data_version)
716
protocol: 770
17+
# If true, server will report same version as client
818
same: false
919

20+
# Player count and sample configuration
1021
players:
22+
# Maximum number of players shown in server list
1123
max: 20
24+
# Current player count shown in server list
1225
online: 0
26+
# Optional list of fake players to display in the server list
1327
sample:
1428
- name: Player1
1529
id: b3a2c344-e57e-43f9-97a6-494d060f0d01
1630
- name: Player2
1731
id: c349b9ff-5c76-4831-b06b-d62c14791339
1832

33+
# Server motd (description)
1934
motd: "§cFake Minecraft Server"
35+
36+
# Server icon configuration
37+
# Can be either:
38+
# 1. Path to a 64x64 PNG file
39+
# 2. Base64 data URI starting with "data:image/png;base64,"
2040
favicon: server-icon.png
2141

42+
# Message shown to players when they try to connect
2243
kick_message: "§c§lThis is a fake server!\n§eIt only responds to ping requests."

0 commit comments

Comments
 (0)