Skip to content

Instantly share code, notes, and snippets.

@SunFlea
Last active February 19, 2023 06:50
Show Gist options
  • Save SunFlea/893fd80f39c7cf9ab31baacac284025d to your computer and use it in GitHub Desktop.
Save SunFlea/893fd80f39c7cf9ab31baacac284025d 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.

Copy link

ghost commented Dec 6, 2021

where do you get the navmesh.zip file from?

@christopherpsterry
Copy link

@cole928
Copy link

cole928 commented Dec 6, 2021

image
i'm getting this error when attempting the ./MasterServer -a command, do you know what's up with that?

@Capital-EX
Copy link

If your WSL is running out of RAM, try specifying a limit to the -j (e.i.: make -j 4). By default, make -j will make as many jobs as possible which may exceed the amount of RAM your WSL has available.

@brixxter
Copy link

brixxter commented Dec 6, 2021

the CDServer setup is causing problems for me, I keep getting "no such table" errors for all 3 commands. What did I likely do wrong?

@patbonecrusher
Copy link

I get that as well... Error: no such table: ActivityRewards.
But, looking at the sql file, I don't see anywhere a Create table ActivityRewards?

@christopherpsterry
Copy link

You can try copying fdb_to_sqlite.py to your client's /res folder, then run cmd in that directory and then the command fdb_to_sqlite.py cdclient.fdb in order to generate cdclient.sqlite

@cooltrain7
Copy link

I suggest adding sudo mysql_secure_installation as a stage for correct root/DB setup.

@ninjastormling
Copy link

ninjastormling commented Dec 6, 2021

Comment Obsolete, Issue Fixed.

@NekoTiga
Copy link

NekoTiga commented Dec 7, 2021

Please, someone help.

UPD. External ip changed, that was the reason
image

@yavkata999
Copy link

yavkata999 commented Dec 7, 2021

Im currently experiencing the same issue as @NekoTiga . Opened all the necessary ports and edited the config files with my external ip. When i change the external ip to localhost there is no problem but i want to host it for bunch of my friends and me so keeping it at localhost is not an option. Any ideas?

@jonnyporter
Copy link

jonnyporter commented Dec 7, 2021

@NekoTiga @yavkata999 did you run this in WSL to find IP? hostname -I | awk '{print $1}'

@jonnyporter
Copy link

I think I've pretty much done exactly this whole thing except that I'm on WSL 2. At login the game just says I need to update the game and won't let me in. Wishing I waited for this guide. Don't want to start all over.

@cooltrain7
Copy link

Edit the DarkflameServer/CMakeVariables.txt file with Notepad or nano and replace NET_VERSION=171023 with NET_VERSION=171022

With 22 being the new repo default you might want to update that it should be checked, but not mandatory now.

@jonnyporter
Copy link

@cooltrain7 yeah I did that and it was still causing that game needs update issue. Ended up rebooting my PC, and relinked IPs because they change after each reboot. Now it just won’t sign in at all. All green lights but the sign in. Really don’t know. Best guess is WSL2.

@NekoTiga
Copy link

NekoTiga commented Dec 7, 2021

@jonnyporter yep, I did. I edited the post later. The problem was in the IP, it changed after the restart.

@yavkata999
Copy link

@jonnyporter I tried with WSL but no luck so i got frustrated and deleted it. Then i downloaded virtualbox + ubuntu 20.04 lts and ran the whole process there. Made the network adapter settings for the VM as bridged adapter. Got IP with ip addr and confirmed in my router that it is the same one that is shown there and then forwarded the appropriated ports.

@NekoTiga
Copy link

NekoTiga commented Dec 7, 2021

It seems that winds in Forbidden Valley do not work. The only workaround for now is using admin jetpack (/gmadditem 1727 1)
image

@Relran
Copy link

Relran commented Dec 7, 2021

I don't understand where CDServer.sqlite is since it's not a folder how do you move cdclient.sqlite into it or beside in it's folder.
Also, after running the fdb to sqlite command I can't find the cdclient.sqlite anywhere, any help with that?
Thx.

@jonnyporter
Copy link

@yavkata999 is your game running? Thinking of trying something like that or on my Mac instead of trying WSL1.

@NekoTiga you are actually up and running!? Did you use WSL 1 or 2?

@OwlWatcher
Copy link

Recommend adding a note about the chat issue for unix/wsl users under troubleshooting. Solution to the problem is provided here: DarkflameUniverse/DarkflameServer#61

@boyoawesome1
Copy link

When trying to create an admin account I keep getting this error:
[mycomputername]:~/DarkflameServer/build$ ./MasterServer -a
Error: no such table: ActivityRewards
Fatal error -1
Stacktrace:
./MasterServer(+0x1ddcf)[0x7f67bf5e1dcf]
/lib/x86_64-linux-gnu/libstdc++.so.6(+0xaa38c)[0x7f67be9ba38c]
/lib/x86_64-linux-gnu/libstdc++.so.6(+0xaa3f7)[0x7f67be9ba3f7]
/lib/x86_64-linux-gnu/libstdc++.so.6(+0xaa6a9)[0x7f67be9ba6a9]
./MasterServer(+0x15446)[0x7f67bf5d9446]
./MasterServer(+0x476cb)[0x7f67bf60b6cb]
./MasterServer(+0x1fb0c)[0x7f67bf5e3b0c]
./MasterServer(+0x25a9e)[0x7f67bf5e9a9e]
./MasterServer(+0x1fbf5)[0x7f67bf5e3bf5]
./MasterServer(+0x169fe)[0x7f67bf5da9fe]

Any ideas on how to resolve this?

@yavkata999
Copy link

@jonnyporter already sorted and playing with friends
Any idea how to approve names cuz my friend typed a name but in game it is shown as the random name from the 3 words

@NekoTiga
Copy link

NekoTiga commented Dec 8, 2021

@jonnyporter I used WSL1
@yavkata999 give them gm account, gm names are auto-approved.

@mattg247
Copy link

mattg247 commented Dec 9, 2021

@boyoawesome1 @patbonecrusher looks like we're in the same boat. Someone on reddit has the same issue too. Cant find someone to help for the life of me.

@GalacticMagmaFalcon
Copy link

@yavkata999 Im running into the issue of getting friends to be able to join. Ive done WSL1, Ive done port forwarding, and made sure the permissions are fine. Ive also edited the Boot cfg file to match the ip address of the server. I make sure the server is running but when I attempt to login to the game from a different computer, not the one thats hosting the server, nothing happens.

@yavkata999
Copy link

@GalacticMagmaFalcon So what i did to make my friends able to join was delete any internet adapter that im not using then restarted the pc. Then i looked up my ip(in WSL) with hostname -I
Once i found out the ip i copied it and pasted it in auth,chat and master configs.
Then i searched whats my ip on google and copied and paste it in boot.cfg following the official guide.
Hope that this can help you.

@blg90
Copy link

blg90 commented Dec 12, 2021

Im having a little issue. Im not sure what i am supposed to do with the checksums. I dont have any version on LU installed. I do have the original digital installer but i cant install it to get a path to the client. Is that what you are supposed to do? or am i just stupid xD

I am at the sqlite server setup. all the utilities are installed and placed correctly, i just need some help with the next command:

python3 CHANGE_THIS_PATH_TO_lcdr-utils/fdb_to_sqlite.py "/mnt/c/CHANGE_THIS_PATH_TO_CLIENT/LEGO Universe (unpacked)/res/cdclient.fdb"

much appreciation to whoever helps me haha
Thanks!

@jstack01
Copy link

@patbonecrusher @boyoawesome1 @mattg247 Did any of you guys fix the no such table error?

@jonnyporter
Copy link

I recommend anyone still struggling to start over and follow this guy (https://youtu.be/jZJR4VrUG9U) and to locate the unpacked client. The unpacked client will save you a world of headache because you can avoid using the pkextractor tool. And also finding out if your system plays well with WSL1 before trying WSL2. My personal system seems biased towards WSL2 (MariaDB/MySQL refused to work on WSL1) but we had great success with WSL1 on my nephew’s system. We got him setup in only a couple hours. This is not easy for sure. Every system seems to be different. It took me over 20 hours to figure out everything that is going on here but in the end it’s totally worth it. You got this!

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