Skip to content

Instantly share code, notes, and snippets.

@WasimAhmad
Forked from SunFlea/Install DLU.md
Created January 11, 2022 17:16
Show Gist options
  • Save WasimAhmad/e9025b2a34a568c59951327022717563 to your computer and use it in GitHub Desktop.
Save WasimAhmad/e9025b2a34a568c59951327022717563 to your computer and use it in GitHub Desktop.

Installing DLU via WSL

You should expect to put aside a few hours at least if you're unfamiliar with Linux.

First "find" the unpacked client (version: 1.10.64) on the internet. Totally unrelated, Google Docs is a very nice editor :). Good known hashes can be found here. This guide is a work-in-progress.

Setup WSL v1

Open command prompt (cmd.exe) to install WSL v1:

wsl --set-default-version 1
wsl --install -d Ubuntu

When a window appears requesting a username/password enter one.

Note: Currently WSL v2's networking is borked.

Compiling for Linux on Windows

sudo apt update && sudo apt upgrade
sudo apt-get install -y git gcc cmake build-essential zlib1g-dev mariadb-server python3 python3-pip sqlite3 net-tools unzip

git clone --recursive https://github.com/DarkflameUniverse/DarkflameServer
mkdir -p DarkflameServer/build
cd DarkflameServer/build
mkdir logs

Edit the DarkflameServer/CMakeVariables.txt file with Notepad or nano and replace NET_VERSION=171023 with NET_VERSION=171022. If you have the latest version of the repo you no longer need to do this.

cmake ..
make -j 2
# Wait...

Environment Setup

MySQL Setup

sudo service mysql start
sudo mysql -u root -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Password1234*';
create database dlu;
use dlu;
source ../migrations/dlu/0_initial.sql;
show tables;
exit

If you get an error from source saying Failed to open file [...] then make sure you're in the DarkflameServer/build directory with cd build.

Resource Setup

  • Open Explorer with explorer.exe .. Make a directory named res in the build directory (e.g. build/res) and copy all the files from the res folder in the unpacked client.
    • [ ! ] Advanced Users can use this instead, e.g.: ln -s "/mnt/c/LEGO Universe (unpacked)/res" res

Navmash Setup

  • Unzip resources/navmeshes.zip into build/res/maps/navmeshes so it looks like this:
    • [ ! ] Advanced Users can use this instead, e.g.: unzip ../resources/navmeshes.zip -d res/maps.
build/res/maps/navmeshes
├── 1001.bin
├── [...]
└── 2001.bin

Locale Setup

  • Make a locale in the build directory (e.g. build/locale) and copy your locale.xml from your client.
    • [ ! ] Advanced Users can use this instead, e.g.: res/../locale.

CDServer.sqlite Setup

  • Acquire lcdr's utilities by going to https://github.com/lcdr/utils → Click the Code button → Download ZIP.
    • [ ! ] Advanced Users can use this instead, e.g.: pip3 install git+https://github.com/lcdr/utils
  • Run python3 CHANGE_THIS_PATH_TO_lcdr-utils/fdb_to_sqlite.py "/mnt/c/CHANGE_THIS_PATH_TO_CLIENT/LEGO Universe (unpacked)/res/cdclient.fdb".
  • Move cdclient.sqlite to build/res/CDServer.sqlite (e.g. mv cdclient.sqlite res/CDServer.sqlite). Like so.
  • Run:
sqlite3 res/CDServer.sqlite < "../migrations/cdserver/0_nt_footrace.sql"
sqlite3 res/CDServer.sqlite < "../migrations/cdserver/1_fix_overbuild_mission.sql"
sqlite3 res/CDServer.sqlite < "../migrations/cdserver/2_script_component.sql"

Make sure to run the above commands exactly as shown. Not doing sqlite3 then -init [...].

If it responded with nothing to all three commands then it worked.

Server Config

Edit authconfig.ini, chatconfig.ini, masterconfig.ini, and worldconfig.ini to include your MySQL credentials, e.g.

mysql_host=localhost
mysql_database=dlu
mysql_username=root
mysql_password=Password1234*

Also, edit external_ip=localhost (in authconfig.ini, chatconfig.ini, and masterconfig.ini) to your WSL IP. Get your WSL IP with hostname -I | awk '{print $1}'.

Run the Server

  • Run ./MasterServer -a to create an admin account. You can change this to a normal account with /gmlevel 0 once you sign-in. You're supposed to use Account Manager for that's overkill for one or two people.
  • Start the server with ./MasterServer.

Client Setup

Follow this official guide to configure your client (e.g. editing l_zone_survival_client.lua). This is important. AUTHSERVERIP should be your WSL IP as demonstrate in the last step. If you've setup Uchu before you need to delete the RakNet mod by removing dinput8.dll and mods from your client folder.

Port Forwarding

If playing with friends over the internet make sure to port forward ports (1001, 2001-2200, 3000-3200) on your router. A guide can be found here.

Troubleshooting

TODO: Add common issues here.

  • "Your game assets don't match the server. Please logout and try again."
  • Make sure you're running the migrations/cdserver/[name].sql on CDServer.sqlite and not in MariaDB. migrations/dlu/0_initial.sql should be run inside MariaDB and not SQLite3.
  • "Operation not permitted"
    • Answer: This is likely an issue with mixing WSL/Windows permissions. A temporary fix is using sudo.
  • Chat isn't working

Running DLU again after Restart

wsl -d Ubuntu
sudo service mysql start
cd DarkflameServer/build
./MasterServer

Updating the Server

cd DarkflameServer
git pull --recurse-submodules
cd build
cmake ..
make -j 2
# Wait...

Closing Words

Congrats, you made it. Massive thanks to the DLU team!

TODO: In the future I hope to make this whole thing a docker-compose.yml so all you have to do is a simple docker composer up --build -d.

If you need help then join the LEGO Universe Community Hub Discord server and ask for help in the #questions channel.

Guide made by Deleted User d183a1c4#7217.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment