Files
blockland-docker/README.md
2025-02-09 03:33:17 -06:00

4.6 KiB

Blockland Docker

Because I'm tired of installing older versions of Wine on my systems.

How to use

I've provided an example docker-compose.yml file. If you grab it, just run docker compose up -d from the same directory as it and it will grab the image and run it. Use docker attach blockland to attach to the console, and Ctrl+P Ctrl+Q to detach from it.

If you don't like docker compose, you can do docker run -dit --name blockland --net=host -e BL_DTOKEN="your dtoken" eagle517/blockland-docker for a similar experience.

The image is available on Docker Hub at eagle517/blockland-server.

Environment variables

Name Type Default Description
BL_DEDI_LAN bool (0 or 1) 0 Launches the server as a Dedicated or Dedicated LAN type. Note that DedicatedLANs are forced into using 28050 as their port. Blame Badspot, not me
BL_DTOKEN string "" Your DToken for authentication
BL_SERVER_NAME string Blockland_Server The name shown on the server list. Underscores will be replaced with spaces by Blockland
BL_MAX_PLAYERS int 32 The max number of players that can join the server
BL_GAMEMODE string Custom The name of the gamemode to launch with
BL_PORT int 28000 The port to bind to, see the Network section below
BL_EXTRA_ARGS string "" Additional parameters to pass to the game as you see fit
BL_INST_NUM_PROC int 10 Number of parallel processes used to download the game files during installation
BL_INST_FORCE bool (0 or 1) 0 Forcefully install the game each time you launch
BL_INST_OVERWRITE bool (0 or 1) 0 Overwrite existing files during installation
BL_PATCH_ENABLE bool (0 or 1) 1 Patches the game with RedBlocklandLoader and the WineFix DLL to make the console work with Wine 8.0.2 (See Wine section below)
BL_PATCH_EXE_URL string See Dockerfile URL to retrieve the patched Blockland.exe from for RedBlocklandLoader
BL_PATCH_LOADER_URL string See Dockerfile URL to retrieve RedBlocklandLoader.dll from
BL_PATCH_WINEFIX_URL string See Dockerfile URL to retrieve WineFix.dll from
WINEARCH string win32 Specifies the arch type Wine should create the prefix under
WINEDEBUG string -all Controls how much logging Wine does to the console (default hides everything)

Networking

Blockland uses UDP for its underlying communication. UDP can be tricky to get to work properly with Docker's bridge networks because it involves internal forwarding on the host to handle the IP masquerading properly. Blockland's Join IP check also does not play nicely with this network type. I recommend using the host network, which will cause the container to have no network isolation, but it removes all the issues. Note that the host network type is only supported on Linux.

If you know how to reliably get Blockland working with a bridged network, let me know.

Volumes

The Dockerfile creates multiple volumes for the game's directories. My reasoning for this is so you can share certain directories between servers (i.e. have all your servers use the same Add-Ons directories) and avoid having to duplicate files.

I also setup the container to be rootless, which can cause a hiccup with file permissions. By default the container is built with a UID and GUID of 1000, so make sure you assign that UID and GUID as the owner for your mounted volumes. Chances are your host user has that UID/GUID, so it should be a non-issue in most cases (I think).

Wine

Wine seems to be having less and less compatibility with Blockland as time goes on. Back when Wine 5.18 came out, we lost the Curses backend, and it stopped being possible to interact with Blockland's console. I eventually figured out what the issue with Wine was, and created Wine Fix which allowed console interaction to work with Wine up to 8.0.2. With Wine 9 and later, it appears the console is just completely broken now. I don't have the time to figure out what shenanigans the Wine devs got up to, so we're stuck with 8.0.2 for now.