Click to see screenshots
25 |
26 |
27 | 
28 | 
29 | 
30 | 
31 |
32 |
33 |
34 |
35 | ## Features
36 |
37 | - Very efficient, lightweight & low-profile (~3KB RAM)
38 | - Supports Minecraft Java Edition 1.20.3+
39 | - Configure joining client occupation methods:
40 | - Hold: hold clients when server starts, relay when ready, without them noticing
41 | - Kick: kick clients when server starts, with a starting message
42 | - Forward: forward client to another IP when server starts
43 | - _Lobby: keep client in emulated server with lobby world, teleport to real server when ready ([experimental*](./docs/join-method-lobby.md))_
44 | - Customizable MOTD and login messages
45 | - Automatically manages `server.properties` (host, port and RCON settings)
46 | - Automatically block banned IPs from server within lazymc
47 | - Graceful server sleep/shutdown through RCON or `SIGTERM`
48 | - Real client IP on Minecraft server with `PROXY` header ([usage](./docs/proxy-ip.md))
49 | - Restart server on crash
50 | - Lockout mode
51 |
52 | ## Requirements
53 |
54 | - Linux, macOS or Windows
55 | - Minecraft Java Edition 1.6+
56 | - On Windows: RCON (automatically managed)
57 |
58 | Build requirements:
59 |
60 | - Rust 1.74 (MSRV)
61 |
62 | _Note: You must have access to the system to run the `lazymc` binary. If you're
63 | using a Minecraft shared hosting provider with a custom dashboard, you likely
64 | won't be able to set this up._
65 |
66 | ## Usage
67 |
68 | _Note: these instructions are for Linux & macOS, for Windows look
69 | [here](./docs/usage-windows.md)._
70 |
71 | Make sure you meet all [requirements](#requirements).
72 |
73 | Download the appropriate binary for your system from the [latest
74 | release][latest-release] page. On macOS you must [compile from
75 | source](#compile-from-source).
76 |
77 | Place the binary in your Minecraft server directory, rename it if you like.
78 | Open a terminal, go to the directory, and make sure you can invoke it:
79 |
80 | ```bash
81 | chmod a+x ./lazymc
82 | ./lazymc --help
83 | ```
84 |
85 | When lazymc is set-up, change into your server directory if you haven't already.
86 | Then set up the [configuration](./res/lazymc.toml) and start it up:
87 |
88 | ```bash
89 | # Change into your server directory (if you haven't already)
90 | cd server
91 |
92 | # Generate lazymc configuration
93 | lazymc config generate
94 |
95 | # Edit configuration
96 | # Set the correct server address, directory and start command
97 | nano lazymc.toml
98 |
99 | # Start lazymc
100 | lazymc start
101 | ```
102 |
103 | Please see [extras](./docs/extras.md) for recommendations and additional things
104 | to set up (e.g. how to fix incorrect client IPs and IP banning on your server).
105 |
106 | After you've read through the [extras](./docs/extras.md), everything should now
107 | be ready to go! Connect with your Minecraft client to wake your server up!
108 |
109 | _Note: If a binary for your system isn't provided, please [compile from
110 | source](#compile-from-source). Installation options are limited at this moment. More will be added
111 | later._
112 |
113 | [latest-release]: https://github.com/timvisee/lazymc/releases/latest
114 |
115 | ## Compile from source
116 |
117 | Make sure you meet all [requirements](#requirements).
118 |
119 | To compile from source you need Rust, install it through `rustup`: https://rustup.rs/
120 |
121 | When Rust is installed, compile and install `lazymc` from this git repository
122 | directly:
123 |
124 | ```bash
125 | # Compile and install lazymc from source
126 | cargo install -f --git https://github.com/timvisee/lazymc
127 |
128 | # Ensure lazymc works
129 | lazymc --help
130 | ```
131 |
132 | Or clone the repository and build it yourself:
133 |
134 | ```bash
135 | # Clone repository
136 | git clone https://github.com/timvisee/lazymc
137 | cd lazymc
138 |
139 | # Compile
140 | cargo build --release
141 |
142 | # Run lazymc
143 | ./target/release/lazymc --help
144 | ```
145 |
146 | ## Third-party usage & implementations
147 |
148 | A list of third-party implementations, projects using lazymc, that you might
149 | find useful:
150 |
151 | - Docker: [crbanman/papermc-lazymc](https://hub.docker.com/r/crbanman/papermc-lazymc) _(PaperMC with lazymc in Docker)_
152 |
153 | ## License
154 |
155 | This project is released under the GNU GPL-3.0 license.
156 | Check out the [LICENSE](LICENSE) file for more information.
157 |
--------------------------------------------------------------------------------
/TODO.md:
--------------------------------------------------------------------------------
1 | # TODO
2 |
3 | - Better organize code
4 | - Resolve TODOs in code
5 | - Don't drop errors, handle everywhere where needed (some were dropped while
6 | prototyping to speed up development)
7 |
8 | ## Nice to have
9 |
10 | - Use server whitelist/blacklist
11 | - Console error if server already started on port, not through `lazymc`
12 | - Kick with message if proxy-to-server connection fails for new client.
13 | - Test configuration on start (server dir exists, command not empty)
14 | - Dynamically increase/decrease server polling interval based on server state
15 | - Server polling through query (`enable-query` in `server.properties`, uses GameSpy4 protocol)
16 |
17 | ## Experiment
18 |
19 | - `io_uring` on Linux for efficient proxying (see `tokio-uring`)
20 |
21 | ## Lobby join method
22 |
23 | - add support for more Minecraft versions (with changed protocols)
24 | - support online mode (encryption)
25 | - hold back packets (whitelist), forward to server at connect before joining
26 | - add support for forge (emulate mod list communication)
27 | - on login plugin request during login state, respond with empty payload, not supported
28 |
--------------------------------------------------------------------------------
/build.rs:
--------------------------------------------------------------------------------
1 | fn main() {
2 | // rcon is required on Windows
3 | #[cfg(all(windows, not(feature = "rcon")))]
4 | {
5 | compile_error!("required feature missing on Windows: rcon");
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/clippy.toml:
--------------------------------------------------------------------------------
1 | msrv = "1.64.0"
2 |
--------------------------------------------------------------------------------
/docs/command-bash.md:
--------------------------------------------------------------------------------
1 | # Use bash script to start server
2 |
3 | You may use a `bash` script to start your server rather than invoking `java`
4 | directly. This requires some changes though to ensure your server properly shuts
5 | down.
6 |
7 | When lazymc stops your server it sends a [`SIGTERM`][sigterm] signal to the
8 | invoked server process to gracefully shut it down. `bash` ignores this signal by
9 | default and keeps the Minecraft server running.
10 |
11 | You must configure `bash` to [forward][forward-signal] the signal to properly
12 | shutdown the Minecraft server as well.
13 |
14 | [sigterm]: https://en.wikipedia.org/wiki/Signal_(IPC)#SIGTERM
15 | [forward-signal]: https://unix.stackexchange.com/a/434269/61092
16 |
17 | ## Example
18 |
19 | Here's a minimal example, trapping the signal and forwarding it to the server.
20 | Be sure to set the correct server JAR file and appropriate memory limits.
21 |
22 | [`start-server`](../res/start-server):
23 |
24 | ```bash
25 | #!/bin/bash
26 |
27 | # Server JAR file, set this to your own
28 | FILE=server.jar
29 |
30 | # Trap SIGTERM, forward it to server process ID
31 | trap 'kill -TERM $PID' TERM INT
32 |
33 | # Start server
34 | java -Xms1G -Xmx1G -jar $FILE --nogui &
35 |
36 | # Remember server process ID, wait for it to quit, then reset the trap
37 | PID=$!
38 | wait $PID
39 | trap - TERM INT
40 | wait $PID
41 | ```
42 |
--------------------------------------------------------------------------------
/docs/command_bash.md:
--------------------------------------------------------------------------------
1 | command-bash.md
--------------------------------------------------------------------------------
/docs/extras.md:
--------------------------------------------------------------------------------
1 | # Extras
2 |
3 | Some extra steps and recommendations when using lazymc:
4 |
5 | Before you use this in production, always ensure starting and stopping the
6 | server works as expected by connecting to it once. Watch lazymc's output while
7 | it starts and stops. If stopping results in errors, fix this first to prevent
8 | corrupting world/user data.
9 |
10 | Follow this repository with the _Watch_ button on the top right to be notified
11 | of new releases.
12 |
13 | ## Recommended
14 |
15 | - [Protocol version](./protocol-version.md):
16 | _set correct Minecraft protocol version for the best client compatability_
17 | - [Proxy IP](./proxy-ip.md):
18 | _fix incorrect client IPs on Minecraft server, notify server of correct IP with `PROXY` header_
19 |
20 | ## Tips
21 |
22 | - [bash with start command](./command_bash.md):
23 | _how to properly use a bash script as server start command_
24 |
25 | ## Experimental features
26 |
27 | - [Join method: lobby](./join-method-lobby.md):
28 | _keep clients in fake lobby world while server starts, teleport to real server when ready_
29 |
--------------------------------------------------------------------------------
/docs/join-method-lobby.md:
--------------------------------------------------------------------------------
1 | # Join method: lobby
2 |
3 | **Note: this is highly experimental, incomplete, and may break your game. See
4 | [warning](#warning).**
5 |
6 | The lobby join method allows you to keep clients in a lobby world while the
7 | server is starting. When the server is ready, the player is _teleported_ to the
8 | real server.
9 |
10 | lazymc emulates a fake server with an empty lobby world. The player is put in
11 | this world, floating in space. A custom message is shown on the client to notify
12 | we're waiting on the server to start.
13 |
14 | 
15 |
16 | ## Warning
17 |
18 | This feature is highly experimental, incomplete and unstable. This may break the
19 | game and crash clients. Don't use this unless you know what you're doing. Never
20 | enable this in a production environment.
21 |
22 | Current limitations:
23 |
24 | - Server must be in offline mode (`online-mode=false`)
25 | - Server must use Minecraft version 1.16.3 to 1.17.1 (tested with 1.17.1)
26 | - Server must use vanilla Minecraft
27 | - May work with Forge (set `server.forge = true`), depends on used mods, test before use
28 | - Does not work with other mods, such as FTB
29 | - This method will consume the client, following configured join methods won't be used.
30 |
31 | At this time it is unknown if some of the above limitations will ever be lifted,
32 | or if this will ever be implemented in a robust manner.
33 |
34 | ## Usage
35 |
36 | _Note: you must use `lazymc v0.2.0` or above with the `lobby` feature enabled._
37 |
38 | To try this out, simply add the `"lobby"` method to the `join.methods` list in
39 | your `lazymc.toml` configuration file:
40 |
41 | ```toml
42 | # -- snip --
43 |
44 | [join]
45 | methods = [
46 | "lobby",
47 | "kick",
48 | ]
49 |
50 | # -- snip --
51 | ```
52 |
53 | Then configure the lobby to your likings:
54 |
55 | ```toml
56 | # -- snip --
57 |
58 | [join.lobby]
59 | # Lobby occupation method.
60 | # The client joins a fake lobby server with an empty world, floating in space.
61 | # A message is overlayed on screen to notify the server is starting.
62 | # The client will be teleported to the real server once it is ready.
63 | # This may keep the client occupied forever if no timeout is set.
64 | # Consumes client, not allowing other join methods afterwards.
65 | # See: https://git.io/JMIi4
66 |
67 | # !!! WARNING !!!
68 | # This is highly experimental, incomplete and unstable.
69 | # This may break the game and crash clients.
70 | # Don't enable this unless you know what you're doing.
71 | #
72 | # - Server must be in offline mode
73 | # - Server must use Minecraft version 1.16.3 to 1.17.1 (tested with 1.17.1)
74 | # - Server must use vanilla Minecraft
75 | # - May work with Forge, enable in config, depends on used mods, test before use
76 | # - Does not work with other mods, such as FTB
77 |
78 | # Maximum time in seconds in the lobby while the server starts.
79 | timeout = 600
80 |
81 | # Message banner in lobby shown to client.
82 | message = "§2Server is starting\n§7⌛ Please wait..."
83 |
84 | # Sound effect to play when server is ready.
85 | ready_sound = "block.note_block.chime"
86 |
87 | # -- snip --
88 |
89 | ```
90 |
91 | _Note: this might have changed, see the latest configuration
92 | [here](../res/lazymc.toml)._
93 |
94 | ## Probe issue with whitelist
95 |
96 | lazymc may report a _probe_ error on first start when a whitelist is enabled
97 | on your server.
98 |
99 | lazymc uses a probe to fetch some required details from your Minecraft
100 | server, such as a mod list. When probing, the server is started once when lazymc
101 | starts. It then connects to the Minecraft server with the _probe_ user
102 | (username: `_lazymc_probe`) and disconnects when everything needed is fetched.
103 |
104 | If you use a whitelist on your server it will cause issues if the probe user
105 | isn't whitelisted. Simply whitelist the probe user with the following command
106 | and restart lazymc to fix the issue:
107 |
108 | ```
109 | /whitelist add _lazymc_probe
110 | ```
111 |
112 | Probing isn't enabled by default. You may enable this by setting
113 | `server.probe_on_start = true`. Other configuration settings might
114 | automatically enable proving if required for your setup.
115 |
--------------------------------------------------------------------------------
/docs/protocol-version.md:
--------------------------------------------------------------------------------
1 | # Protocol version
2 |
3 | The Minecraft protocol uses a version number to distinguish between different
4 | protocol versions. Each new Minecraft version having a change in its protocol
5 | gets a new protocol version.
6 |
7 | ## List of versions
8 |
9 | - https://wiki.vg/Protocol_version_numbers#Versions_after_the_Netty_rewrite
10 |
11 | ## Configuration
12 |
13 | In lazymc you may configure what protocol version to use:
14 |
15 | [`lazymc.toml`](../res/lazymc.toml):
16 |
17 | ```bash
18 | # -- snip --
19 |
20 | [public]
21 | # Server version & protocol hint.
22 | # Sent to clients until actual server version is known.
23 | # See: https://git.io/J1Fvx
24 | version = "1.19.3"
25 | protocol = 761
26 |
27 | # -- snip --
28 | ```
29 |
30 | It is highly recommended to set these to match that of your server version to
31 | allow the best compatibility with clients.
32 |
33 | - Set `public.protocol` to the number matching that of your server version
34 | (see [this](#list-of-versions) list)
35 | - Set `public.version` to any string you like. Shows up in read in clients that
36 | have an incompatibel protocol version number
37 |
38 | These are used as hint. lazymc will automatically use the protocol version of
39 | your Minecraft server once it has started at least once.
40 |
--------------------------------------------------------------------------------
/docs/proxy-ip.md:
--------------------------------------------------------------------------------
1 | # Proxy IP
2 |
3 | lazymc acts as a proxy most of the time. Because of this the Minecraft server
4 | will think all clients connect from the same IP, being the IP lazymc proxies
5 | from.
6 |
7 | This breaks IP banning (`/ban-ip`, amongst other IP related things). This may be
8 | a problematic issue for your server.
9 |
10 | Luckily, this can be fixed with the [proxy header](#proxy-header). lazymc has
11 | support for this, and can be used with a companion plugin on your server.
12 |
13 | ## Proxy header
14 |
15 | The `PROXY` header may be used to notify the Minecraft server of the real client
16 | IP.
17 |
18 | When a new connection is opened to the Minecraft server, the Minecraft server
19 | will read the `PROXY` header with client-IP information. Once read, it will set
20 | the correct client IP internally and will resume communicating with the client
21 | normally.
22 |
23 | To enable this with lazymc you must do two things:
24 | - [Modify the lazymc configuration](#configuration)
25 | - [Install a companion plugin](#server-plugin)
26 |
27 | ## Configuration
28 |
29 | To use the `PROXY` header with your Minecraft server, set `server.send_proxy_v2`
30 | to `true`.
31 |
32 | [`lazymc.toml`](../res/lazymc.toml):
33 |
34 | ```toml
35 | # -- snip --
36 |
37 | [server]
38 | send_proxy_v2 = true
39 |
40 | # -- snip --
41 | ```
42 |
43 | Other related properties, you probably won't need to touch, include:
44 |
45 | - `server.send_proxy_v2`: set to `true` to enable `PROXY` header for Minecraft server
46 | - `join.forward.send_proxy_v2`: set to `true` to enable `PROXY` header forwarded server, if `forward` join method is used
47 | - `rcon.send_proxy_v2`: set to `true` to enable `PROXY` header for RCON connections for Minecraft server
48 |
49 | ## Server plugin
50 |
51 | Install one of these plugins as companion on your server to enable support for
52 | the `PROXY` header. This requires Minecraft server software supporting plugins,
53 | the vanilla Minecraft server does not support this.
54 |
55 | If lazymc connects to a Spigot compatible server, use any of:
56 |
57 | - https://github.com/riku6460/SpigotProxy ([JAR](https://github.com/riku6460/SpigotProxy/releases/latest))
58 | - https://github.com/timvisee/spigot-proxy
59 |
60 | If lazymc connects to a BungeeCord server, use any of:
61 |
62 | - https://github.com/MinelinkNetwork/BungeeProxy
63 |
64 | ## Warning: connection failures
65 |
66 | Use of the `PROXY` header must be enabled or disabled on both lazymc and your
67 | Minecraft server using a companion plugin.
68 |
69 | If either of the two is missing or misconfigured, it will result in connection
70 | failures due to a missing or unrecognized header.
71 |
72 | ## Warning: fake IP
73 |
74 | When enabling the `PROXY` header on your Minecraft server, malicious parties may
75 | send this header to fake their real IP.
76 |
77 | To solve this, make sure the Minecraft server is only publicly reachable through
78 | lazymc. This can be done by setting the Minecraft server IP to a local address
79 | only, or by setting up firewall rules.
80 |
--------------------------------------------------------------------------------
/docs/usage-windows.md:
--------------------------------------------------------------------------------
1 | ## Usage on Windows
2 |
3 | Make sure you meet all [requirements](../README.md#requirements).
4 |
5 | Download the `lazymc-*-windows.exe` Windows executable for your system from the
6 | [latest release][latest-release] page.
7 |
8 | Place the binary in your Minecraft server directory, and rename it to
9 | `lazymc.exe`.
10 |
11 | Open a terminal, go to the server directory, and make sure you can execute it:
12 |
13 | ```bash
14 | .\lazymc --help
15 | ```
16 |
17 | When lazymc is ready, set up the [configuration](../res/lazymc.toml) and start it
18 | up:
19 |
20 | ```bash
21 | # In your Minecraft server directory:
22 |
23 | # Generate lazymc configuration
24 | .\lazymc config generate
25 |
26 | # Edit configuration
27 | # Set the correct server address, directory and start command
28 | notepad lazymc.toml
29 |
30 | # Start lazymc
31 | .\lazymc start
32 | ```
33 |
34 | Please see [extras](./extras.md) for recommendations and additional things
35 | to set up (e.g. how to fix incorrect client IPs and IP banning on your server).
36 |
37 | After you've read through the [extras](./extras.md), everything should now
38 | be ready to go! Connect with your Minecraft client to wake your server up!
39 |
40 | _Note: if you put `lazymc` in `PATH`, or if you
41 | [install](../README.md#compile-from-source) it through Cargo, you can invoke
42 | `lazymc` everywhere directly without the `.\` prefix._
43 |
44 | [latest-release]: https://github.com/timvisee/lazymc/releases/latest
45 |
--------------------------------------------------------------------------------
/res/dimension.snbt:
--------------------------------------------------------------------------------
1 | {
2 | piglin_safe: 1b,
3 | natural: 0b,
4 | ambient_light: 0.0f,
5 | fixed_time: 0,
6 | infiniburn: "minecraft:infiniburn_overworld",
7 | respawn_anchor_works: 0b,
8 | has_skylight: 1b,
9 | bed_works: 0b,
10 | effects: "minecraft:the_end",
11 | has_raids: 0b,
12 | min_y: 0,
13 | height: 256,
14 | logical_height: 256,
15 | coordinate_scale: 1.0d,
16 | ultrawarm: 0b,
17 | has_ceiling: 0b
18 | }
19 |
--------------------------------------------------------------------------------
/res/lazymc.toml:
--------------------------------------------------------------------------------
1 | # lazymc configuration
2 | #
3 | # You must configure your server directory and start command, see:
4 | # - server.directory
5 | # - server.command
6 | #
7 | # All defaults are commented out, change it if you desire.
8 | # You can probably leave the rest as-is.
9 | #
10 | # You may generate a new configuration with: lazymc config generate
11 | # Or find the latest at: https://git.io/J1Fvq
12 |
13 | [public]
14 | # Public address. IP and port users connect to.
15 | # Shows sleeping status, starts server on connect, and proxies to server.
16 | #address = "0.0.0.0:25565"
17 |
18 | # Server version & protocol hint.
19 | # Sent to clients until actual server version is known.
20 | # See: https://git.io/J1Fvx
21 | #version = "1.20.3"
22 | #protocol = 765
23 |
24 | [server]
25 | # Server address. Internal IP and port of server started by lazymc to proxy to.
26 | # Port must be different from public port.
27 | #address = "127.0.0.1:25566"
28 |
29 | # Server directory, defaults to current directory.
30 | directory = "."
31 |
32 | # Command to start the server.
33 | # Warning: if using a bash script read: https://git.io/JMIKH
34 | command = "java -Xmx1G -Xms1G -jar server.jar --nogui"
35 |
36 | # Freeze the server process instead of restarting it when no players online, making it resume faster.
37 | # Only works on Unix (Linux or MacOS), ignored on Windows
38 | #freeze_process = true
39 |
40 | # Immediately wake server when starting lazymc.
41 | #wake_on_start = false
42 |
43 | # Immediately wake server after crash.
44 | #wake_on_crash = false
45 |
46 | # Probe required server details when starting lazymc, wakes server on start.
47 | # Improves client compatibility. Automatically enabled if required by other config properties.
48 | #probe_on_start = false
49 |
50 | # Set to true if this server runs Forge.
51 | #forge = false
52 |
53 | # Server start/stop timeout in seconds. Force kill server process if it takes too long.
54 | #start_timeout = 300
55 | #stop_timeout = 150
56 |
57 | # To wake server, user must be in server whitelist if enabled on server.
58 | #wake_whitelist = true
59 |
60 | # Block banned IPs as listed in banned-ips.json in server directory.
61 | #block_banned_ips = true
62 |
63 | # Drop connections from banned IPs.
64 | # Banned IPs won't be able to ping or request server status.
65 | # On connect, clients show a 'Disconnected' message rather than the ban reason.
66 | #drop_banned_ips = false
67 |
68 | # Add HAProxy v2 header to proxied connections.
69 | # See: https://git.io/J1bYb
70 | #send_proxy_v2 = false
71 |
72 | [time]
73 | # Sleep after number of seconds.
74 | #sleep_after = 60
75 |
76 | # Minimum time in seconds to stay online when server is started.
77 | #minimum_online_time = 60
78 |
79 | [motd]
80 | # MOTD, shown in server browser.
81 | #sleeping = "☠ Server is sleeping\n§2☻ Join to start it up"
82 | #starting = "§2☻ Server is starting...\n§7⌛ Please wait..."
83 | #stopping = "☠ Server going to sleep...\n⌛ Please wait..."
84 |
85 | # Use MOTD from Minecraft server once known.
86 | #from_server = false
87 |
88 | [join]
89 | # Methods to use to occupy a client on join while the server is starting.
90 | # Read about all methods and configure them below.
91 | # Methods are used in order, if none is set, the client disconnects without a message.
92 | #methods = [
93 | # "hold",
94 | # "kick",
95 | #]
96 |
97 | [join.kick]
98 | # Kick occupation method.
99 | # Instantly kicks a client with a message.
100 |
101 | # Message shown when client is kicked while server is starting/stopping.
102 | #starting = "Server is starting... §c♥§r\n\nThis may take some time.\n\nPlease try to reconnect in a minute."
103 | #stopping = "Server is going to sleep... §7☠§r\n\nPlease try to reconnect in a minute to wake it again."
104 |
105 | [join.hold]
106 | # Hold occupation method.
107 | # Holds back a joining client while the server is started until it is ready.
108 | # 'Connecting the server...' is shown on the client while it's held back.
109 | # If the server starts fast enough, the client won't notice it was sleeping at all.
110 | # This works for a limited time of 30 seconds, after which the Minecraft client times out.
111 |
112 | # Hold client for number of seconds on connect while server starts.
113 | # Keep below Minecraft timeout of 30 seconds.
114 | #timeout = 25
115 |
116 | [join.forward]
117 | # Forward occupation method.
118 | # Instantly forwards (proxies) the client to a different address.
119 | # You may need to configure target server for it, such as allowing proxies.
120 | # Consumes client, not allowing other join methods afterwards.
121 |
122 | # IP and port to forward to.
123 | # The target server will receive original client handshake and login request as received by lazymc.
124 | #address = "127.0.0.1:25565"
125 |
126 | # Add HAProxy v2 header to forwarded connections.
127 | # See: https://git.io/J1bYb
128 | #send_proxy_v2 = false
129 |
130 | [join.lobby]
131 | # Lobby occupation method.
132 | # The client joins a fake lobby server with an empty world, floating in space.
133 | # A message is overlayed on screen to notify the server is starting.
134 | # The client will be teleported to the real server once it is ready.
135 | # This may keep the client occupied forever if no timeout is set.
136 | # Consumes client, not allowing other join methods afterwards.
137 | # See: https://git.io/JMIi4
138 |
139 | # !!! WARNING !!!
140 | # This is highly experimental, incomplete and unstable.
141 | # This may break the game and crash clients.
142 | # Don't enable this unless you know what you're doing.
143 | #
144 | # - Server must be in offline mode
145 | # - Server must use Minecraft version 1.16.3 to 1.17.1 (tested with 1.17.1)
146 | # - Server must use vanilla Minecraft
147 | # - May work with Forge, enable in config, depends on used mods, test before use
148 | # - Does not work with other mods, such as FTB
149 |
150 | # Maximum time in seconds in the lobby while the server starts.
151 | #timeout = 600
152 |
153 | # Message banner in lobby shown to client.
154 | #message = "§2Server is starting\n§7⌛ Please wait..."
155 |
156 | # Sound effect to play when server is ready.
157 | #ready_sound = "block.note_block.chime"
158 |
159 | [lockout]
160 | # Enable to prevent everybody from connecting through lazymc. Instantly kicks player.
161 | #enabled = false
162 |
163 | # Kick players with following message.
164 | #message = "Server is closed §7☠§r\n\nPlease try to reconnect in a minute."
165 |
166 | [rcon]
167 | # Enable sleeping server through RCON.
168 | # Must be enabled on Windows.
169 | #enabled = false # default: false, true on Windows
170 |
171 | # Server RCON port. Must differ from public and server port.
172 | #port = 25575
173 |
174 | # Server RCON password.
175 | # Or whether to randomize password each start (recommended).
176 | #password = ""
177 | #randomize_password = true
178 |
179 | # Add HAProxy v2 header to RCON connections.
180 | # See: https://git.io/J1bYb
181 | #send_proxy_v2 = false
182 |
183 | [advanced]
184 | # Automatically update values in Minecraft server.properties file as required.
185 | #rewrite_server_properties = true
186 |
187 | [config]
188 | # lazymc version this configuration is for.
189 | # Don't change unless you know what you're doing.
190 | version = "0.2.11"
191 |
--------------------------------------------------------------------------------
/res/screenshot/demo.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/timvisee/lazymc/d058164aa6012b216eaae28e5581a6130dfeb7e6/res/screenshot/demo.mp4
--------------------------------------------------------------------------------
/res/screenshot/join.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/timvisee/lazymc/d058164aa6012b216eaae28e5581a6130dfeb7e6/res/screenshot/join.png
--------------------------------------------------------------------------------
/res/screenshot/lobby.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/timvisee/lazymc/d058164aa6012b216eaae28e5581a6130dfeb7e6/res/screenshot/lobby.png
--------------------------------------------------------------------------------
/res/screenshot/sleeping.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/timvisee/lazymc/d058164aa6012b216eaae28e5581a6130dfeb7e6/res/screenshot/sleeping.png
--------------------------------------------------------------------------------
/res/screenshot/started.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/timvisee/lazymc/d058164aa6012b216eaae28e5581a6130dfeb7e6/res/screenshot/started.png
--------------------------------------------------------------------------------
/res/screenshot/starting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/timvisee/lazymc/d058164aa6012b216eaae28e5581a6130dfeb7e6/res/screenshot/starting.png
--------------------------------------------------------------------------------
/res/start-server:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # See: https://git.io/JMIKH
4 |
5 | # Server JAR file, set this to your own
6 | FILE=server.jar
7 |
8 | # Trap SIGTERM, forward it to server process ID
9 | trap 'kill -TERM $PID' TERM INT
10 |
11 | # Start server
12 | java -Xms1G -Xmx1G -jar $FILE --nogui &
13 |
14 | # Remember server process ID, wait for it to quit, then reset the trap
15 | PID=$!
16 | wait $PID
17 | trap - TERM INT
18 | wait $PID
19 |
--------------------------------------------------------------------------------
/res/unknown_server.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/timvisee/lazymc/d058164aa6012b216eaae28e5581a6130dfeb7e6/res/unknown_server.png
--------------------------------------------------------------------------------
/res/unknown_server_optimized.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/timvisee/lazymc/d058164aa6012b216eaae28e5581a6130dfeb7e6/res/unknown_server_optimized.png
--------------------------------------------------------------------------------
/src/action/config_generate.rs:
--------------------------------------------------------------------------------
1 | use std::fs;
2 | use std::path::PathBuf;
3 |
4 | use clap::ArgMatches;
5 |
6 | use crate::util::cli::prompt_yes;
7 | use crate::util::error::{quit, quit_error, ErrorHintsBuilder};
8 |
9 | /// Invoke config test command.
10 | pub fn invoke(matches: &ArgMatches) {
11 | // Get config path, attempt to canonicalize
12 | let mut path = PathBuf::from(matches.get_one::