diff --git a/README.md b/README.md index 2a0ebff..3cdebe7 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ https://user-images.githubusercontent.com/856222/141378688-882082be-9efa-4cfe-81 - Hold: hold clients when server starts, relay when ready, without them noticing - Kick: kick clients when server starts, with a starting message - Forward: forward client to another IP when server starts + - _Lobby: keep client in emulated server with lobby world, teleport to real server when ready ([experimental*](./docs/join-method-lobby.md))_ - Customizable MOTD and login messages - Automatically manages `server.properties` (host, port and RCON settings) - Graceful server sleep/shutdown through RCON (with `SIGTERM` fallback on Linux/Unix) diff --git a/docs/join-method-lobby.md b/docs/join-method-lobby.md new file mode 100644 index 0000000..80b6d4a --- /dev/null +++ b/docs/join-method-lobby.md @@ -0,0 +1,87 @@ +# Join method: lobby + +**Note: this is highly experimental, incomplete, and may break your game. See +[warning](#warning).** + +The lobby join method allows you to keep clients in a lobby world while the +server is starting. When the server is ready, the player is _teleported_ to the +real server. + +`lazymc` emulates a fake server with an empty lobby world. The player is put in +this world, floating in space. A custom message is shown on the client to notify +we're waiting on the server to start. + +![Lobby screenshot](../res/screenshot/lobby.png) + +## Warning + +This feature is highly experimental, incomplete and unstable. This may break the +game and crash clients. Don't use this unless you know what you're doing. Never +enable this in a production environment. + +Current limitations: + +- Only works with offline mode +- Only works with vanilla Minecraft clients, does not work with modded (e.g. Forge, FTB) +- Probably only works with Minecraft 1.16-1.17.1 (tested with 1.17.1) +- This method will consume the client, following configured join methods won't be used. + +At this time it is unknown if some of the above limitations will ever be lifted, +or if this will ever be implemented in a robust manner. + +## Usage + +_Note: you must use `lazymc v0.2.0` or above with the `lobby` feature enabled._ + +To try this out, simply add the `"lobby"` method to the `join.methods` list in +your `lazymc.toml` configuration file: + +```toml +# -- snip -- + +[join] +methods = [ + "lobby", + "kick", +] + +# -- snip -- +``` + +Then configure the lobby to your likings: + +```toml +# -- snip -- + +[join.lobby] +# Lobby occupation method. +# The client joins a fake lobby server with an empty world, floating in space. +# A message is overlayed on screen to notify the server is starting. +# The client will be teleported to the real server once it is ready. +# This may keep the client occupied forever if no timeout is set. +# Consumes client, not allowing other join methods afterwards. + +# !!! WARNING !!! +# This is highly experimental and unstable. +# This may break the game and crash clients. +# Don't enable this unless you know what you're doing. +# +# - Only works with offline mode +# - Only works with vanilla Minecraft clients, does not work with modded +# - Only tested with Minecraft 1.17.1 + +# Maximum time in seconds in the lobby while the server starts. +timeout = 600 + +# Message banner in lobby shown to client. +message = "§2Server is starting\n§7⌛ Please wait..." + +# Sound effect to play when server is ready. +ready_sound = "block.note_block.chime" + +# -- snip -- + +``` + +_Note: this might have changed, see the latest configuration +[here](../res/lazymc.toml)._ diff --git a/res/lazymc.toml b/res/lazymc.toml index aa83df9..a22ebaa 100644 --- a/res/lazymc.toml +++ b/res/lazymc.toml @@ -62,7 +62,7 @@ command = "java -Xmx1G -Xms1G -jar server.jar --nogui" [join] # Methods to use to occupy a client on join while the server is starting. # Read about all methods and configure them below. -# Methods are used in-order, if none is set, the client disconnects without a message. +# Methods are used in order, if none is set, the client disconnects without a message. #methods = [ # "hold", # "kick", @@ -94,7 +94,7 @@ command = "java -Xmx1G -Xms1G -jar server.jar --nogui" # Consumes client, not allowing other join methods afterwards. # IP and port to forward to. -# Forwarded-to server will receive original client handshake and login request as received by lazymc. +# The target server will receive original client handshake and login request as received by lazymc. #address = "127.0.0.1:25565" [join.lobby] @@ -106,7 +106,7 @@ command = "java -Xmx1G -Xms1G -jar server.jar --nogui" # Consumes client, not allowing other join methods afterwards. # !!! WARNING !!! -# This is highly experimental and unstable. +# This is highly experimental, incomplete and unstable. # This may break the game and crash clients. # Don't enable this unless you know what you're doing. # @@ -114,7 +114,7 @@ command = "java -Xmx1G -Xms1G -jar server.jar --nogui" # - Only works with vanilla Minecraft clients, does not work with modded # - Only tested with Minecraft 1.17.1 -# Maxiumum time in seconds in the lobby while the server starts. +# Maximum time in seconds in the lobby while the server starts. #timeout = 600 # Message banner in lobby shown to client. diff --git a/res/screenshot/lobby.png b/res/screenshot/lobby.png new file mode 100644 index 0000000..5f0504f Binary files /dev/null and b/res/screenshot/lobby.png differ