Darkflame Universe (DLU) is a server emulator for LEGO® Universe. Development started in 2013 and has gone through multiple iterations and is now able to present a near perfect emulation of the game server.
Developed by NetDevil and The LEGO Group, LEGO® Universe launched in October 2010 and ceased operation in January 2012.
Darkflame Universe is licensed under AGPLv3, please read LICENSE. Some important points:
Throughout the entire build and setup process a level of familiarity with the command line and preferably a Unix-like development environment is greatly advantageous.
We do not recommend hosting public servers. Darkflame Universe is intended for small scale deployment, for example within a group of friends. It has not been tested for large scale deployment which comes with additional security risks.
Darkflame Universe is a server emulator and does not distribute any LEGO® Universe files. A separate game client is required to setup this server emulator and play the game, which we cannot supply. Users are strongly suggested to refer to the safe checksums listed here to see if a client will work.
If you would like a setup for a single player server only on a Windows machine, use the Native Windows Setup Guide by HailStorm and skip this README.
If you are on Windows, you will need to download and install git from here
Then run the following command
git clone --recursive https://github.com/DarkflameUniverse/DarkflameServer
Ensure that you have either the MSVC C++ compiler (recommended) or the Clang compiler installed. You'll also need to download and install CMake (version CMake version 3.25 or later!).
Ensure you have brew installed. You will need to install the following packages
brew install cmake gcc mariadb openssl zlib
Make sure packages like gcc
, and zlib
are installed. Depending on the distribution, these packages might already be installed. Note that on systems like Ubuntu, you will need the zlib1g-dev
package so that the header files are available. libssl-dev
will also be required as well as openssl
. You will also need a MySQL database solution to use. We recommend using mariadb-server
.
For Ubuntu, you would run the following commands. On other systems, the package install command will differ.
sudo apt update && sudo apt upgrade
# Install packages
sudo apt install build-essential gcc zlib1g-dev libssl-dev openssl mariadb-server cmake
This project uses CMake version 3.25 or higher and as such you will need to ensure you have this version installed. You can check your CMake version by using the following command in a terminal.
cmake --version
If you are going to be using an Ubuntu environment to run the server, you may need to get a more recent version of cmake
than the packages available may provide.
The general approach to do so would be to obtain a copy of the signing key and then add the CMake repository to your apt. You can do so with the following commands.
# Remove the old version of CMake
sudo apt purge --auto-remove cmake
# Prepare for installation
sudo apt update && sudo apt install -y software-properties-common lsb-release && sudo apt clean all
# Obtain a copy of the signing key
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
# Add the repository to your sources list.
sudo apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main"
# Next you'll want to ensure that Kitware's keyring stays up to date
sudo apt update
sudo apt install kitware-archive-keyring
sudo rm /etc/apt/trusted.gpg.d/kitware.gpg
# If sudo apt update above returned an error, copy the public key at the end of the error message and run the following command
# if the error message was "The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6AF7F09730B3F0A4"
# then the below command would be "sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6AF7F09730B3F0A4"
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys <TheCopiedPublicKey>
# Finally update and install
sudo apt update
sudo apt install cmake
First you'll need to start MariaDB.
For Windows the service is always running by default.
For MacOS, run the following command
brew services start mariadb
For Linux, run the following command
sudo systemctl start mysql
# If systemctl is not a known command on your distribution, try the following instead
sudo service mysql start
You will need to run this command every time you restart your environment
If you are using Linux and systemctl
and want the MariaDB instance to start on startup, run the following command
sudo systemctl enable --now mysql
Once MariaDB is started, you'll need to create a user and an empty database for Darkflame Universe to use.
First, login to the MariaDB instance.
To do this on Ubuntu/Linux, MacOS, or another Unix like operating system, run the following command in a terminal
# Logs you into the MariaDB instance as root
sudo mysql
For Windows, run the following command in the Command Prompt (MariaDB xx.xx)
terminal
# Logs you into the mysql instance
mysql -u root -p
# You will then be prompted for the password you set for root during installation of MariaDB
Now that you are logged in, run the following commands.
# Creates a user for this computer which uses a password and grant said user all privileges.
# Change mydarkflameuser to a custom username and password to a custom password.
GRANT ALL ON *.* TO 'mydarkflameuser'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH PRIVILEGES;
# Then create a database for Darkflame Universe to use.
CREATE DATABASE darkflame;
You can either run build.sh
when in the root folder of the repository:
./build.sh
Or manually run the commands used in build.sh.
If you would like to build the server faster, append -j<number>
where number is the number of simultaneous compile jobs to run at once. It is recommended that you have this number always be 1 less than your core count to prevent slowdowns. The command would look like this if you would build with 4 jobs at once:
./build.sh -j4
Depending on your operating system, you may need to adjust some pre-processor defines in CMakeVariables.txt before building:
client_net_version
in build/sharedconfig.ini
is changed to 171023.This server has a few steps that need to be taken to configure the server for your use case.
Darkflame Universe can run with either a packed or an unpacked client.
Navigate to build/sharedconfig.ini
and fill in the following fields:
mysql_host
(This is the IP address or hostname of your MariaDB server. This is highly likely localhost
)
tcp://localhost:portNum
where portNum is replaced with the port you chose to run MariaDB on.mysql_database
(This is the database you created for the server)mysql_username
(This is the user you created for the server)mysql_password
(This is the password for the user you created for the server)client_location
(This is the location of the client files. This should be the folder path of a packed or unpacked client)
ini
files in the build directory: sharedconfig.ini
, authconfig.ini
, chatconfig.ini
, masterconfig.ini
, and worldconfig.ini
.authconfig.ini
contains an option to enable or disable play keys on your server. Do not change the default port for auth.chatconfig.ini
contains a port option.masterconfig.ini
contains options related to permissions you want to run your servers with.sharedconfig.ini
contains several options that are shared across all serversworldconfig.ini
contains several options to turn on QOL improvements should you want them. If you would like the most vanilla experience possible, you will need to turn some of these settings off.Your build directory should now look like this:
If everything has been configured correctly you should now be able to run the MasterServer
binary which is located in the build
directory. Darkflame Universe utilizes port numbers under 1024, so under Linux you either have to give the AuthServer
binary network permissions or run it under sudo.
To give AuthServer
network permissions and not require sudo, run the following command
sudo setcap 'cap_net_bind_service=+ep' AuthServer
and then go to build/masterconfig.ini
and change use_sudo_auth
to 0.
If you are running this on a linux based system, it will use your terminal to run the program interactively, preventing you using it for other tasks and requiring it to be open to run the server.
Note: You could use screen or tmux instead for virtual terminals
To run the server non-interactively, we can use a systemctl service by copying the following file:
cp ./systemd.example /etc/systemd/system/darkflame.service
Make sure to edit the file in /etc/systemd/system/darkflame.service
and change the:
User
and Group
to the user that runs the darkflame server. ExecPath
to the full file path of the server executable. To register, enable and start the service use the following commands:
systemctl daemon-reload
systemctl start darkflame.service
systemctl enable darkflame.service
systemctl disable darkflame.service
systemctl status darkflame.service
systemctl restart darkflame.service
systemctl stop darkflame.service
journalctl -xeu darkflame.service
Run MasterServer -a
to get prompted to create an admin account. This method is only intended for the system administrator as a means to get started, do NOT use this method to create accounts for other users!
If you are just using this server for yourself, you can skip setting up Nexus Dashboard
Follow the instructions here to setup the DLU Nexus Dashboard web application. This is the intended way for users to create accounts and the intended way for moderators to approve names/pets/properties and do other moderation actions.
The admin level, or Game Master level (hereafter referred to as gmlevel), is specified in the accounts.gm_level
column in the MySQL database. Normal players should have this set to 0
, which comes with no special privileges. The system administrator will have this set to 9
, which comes will all privileges. gmlevel 8
should be used to give a player a majority of privileges without the safety critical once.
While a character has a gmlevel of anything but 0
, some gameplay behavior will change. When testing gameplay, you should always use a character with a gmlevel of 0
.
Some changes to the client boot.cfg
file are needed to play on your server.
To connect to a server follow these steps:
boot.cfg
AUTHSERVERIP=0:
:
and the following ,
with what you configured as the server's public facing IP. For example AUTHSERVERIP=0:localhost
for locally hosted serversUGCUSE3DSERVICES=7:
0
legouniverse.exe
, through wine
if on a Unix-like operating systemifconfig
in the terminal. Windows defaults to WSL1, so this will not apply to most users.To update your server to the latest version navigate to your cloned directory
cd path/to/DarkflameServer
Run the following commands to update to the latest changes
git pull
git submodule update --init --recursive
Now follow the build section for your system and your server is up to date.
To verify that you are indeed using a LEGO® Universe 1.10.64 client, make sure you have the full client compressed in a rar file and run the following command.
# Replace <file> with the file path to the zipped client
# If on Linux or MacOS
shasum -a 256 <file>
# If on Windows using the Command Prompt
certutil -hashfile <file> SHA256
Below are known good SHA256 checksums of the client:
8f6c7e84eca3bab93232132a88c4ae6f8367227d7eafeaa0ef9c40e86c14edf5
(packed client, rar compressed)c1531bf9401426042e8bab2de04ba1b723042dc01d9907c2635033d417de9e05
(packed client, includes extra locales, rar compressed)0d862f71eedcadc4494c4358261669721b40b2131101cbd6ef476c5a6ec6775b
(unpacked client, includes extra locales, rar compressed)If the returned hash matches one of the lines above then you can continue with setting up the server. If you are using a fully downloaded and complete client from live, then it will work, but the hash above may not match. Otherwise you must obtain a full install of LEGO® Universe 1.10.64. You must also make absolutely sure your LEGO Universe client is not in a Windows OneDrive. DLU is not and will not support a client being stored in a OneDrive, so ensure you have moved the client outside of that location.
Darkflame Universe clients identify themselves using a higher version number than the regular live clients out there. This was done make sure that older and incomplete clients wouldn't produce false positive bug reports for us, and because we made bug fixes and new content for the client.
To verify that you are indeed using a Darkflame Universe client, make sure you have the full client compressed in a zip file and run the following command.
# Replace <file> with the file path to the zipped client
# If on Linux or MacOS
shasum -a 1 <file>
# If on Windows using the Command Prompt
certutil -hashfile <file> SHA1
Known good SHA1 checksum of the Darkflame Universe client:
91498e09b83ce69f46baf9e521d48f23fe502985
(packed client, zip compressed)The Darkflame Server is automatically built and published as a Docker Container / OCI Image to the GitHub Container Registry at:
ghcr.io/darkflameuniverse/darkflameserver
.
[!WARNING] It seems that Docker Desktop on Windows with the WSL 2 backend has some issues with MariaDB (c.f. mariadb-docker#331) triggered by NexusDashboard migrations, so this setup may not work for you. If that is the case, please tell us about your setup in NexusDashboard#92.
You can use the docker-compose
tool to setup a MariaDB database, run the Darkflame Server and manage it with Nexus Dashboard all
at once. For that:
legouniverse.exe
is in a subfolder called client
, you're good to go. There may also be a folder versions
.client
folder and move the exe and everything else (e.g. res
and locale
) in there. This is necessary to work around a bug in the client that will prevent that you to log back in after getting disconnected.client
.client
with the file name .env
ACCOUNT_MANAGER_SECRET
and MARIADB_PASSWORD
with strong random passwords.:
and @
charactersEXTERNAL_IP
to your LAN IP or public IP if you want to host the game for friends & familydocker-compose.yml
and client
docker compose up -d
sudo
on Linux, and a recent version of docker composedocker exec -it dlu-darkflameserver-1 /app/MasterServer -a
and follow the instructions to create the initial admin accountAUTHSERVERIP=0:localhost
in client/boot.cfg
localhost
with the value of EXTERNAL_IP
if you changed that earlier.UGCUSE3DSERVICES=7:
is set to 0
legouniverse.exe
This assumes that you have a database deployed to your host or in another docker container.
A basic deployment of this contianer would look like:
# example docker contianer deployment
docker run -it \
-v /path/to/configs/:/app/configs \
-v /path/to/logs/:/app/logs \
-v /path/to/dumps/:/app/dumps \
-v /path/to/res:/app/res:ro \
-v /path/to/resServer:/app/resServer \
-e DUMP_FOLDER=/app/dumps \
-p 1001:1001/udp \
-p 2005:2005/udp \
-p 3000-3300:3000-3300/udp \
ghcr.io/darkflameuniverse/darkflameserver:latest
You will need to replace the /path/to/
's to reflect the paths on your host.
Any config option in the .ini
's can be overridden with environmental variables: Ex: log_to_console=1
from shared_config.ini
would be overidden like -e LOG_TO_CONSOLE=0
This is a Work in Progress, but below are some quick links to documentaion for systems and structs in the server Networked message structs General system documentation