Skip to content

Instantly share code, notes, and snippets.

@HailStorm32
Last active May 3, 2024 18:17
Show Gist options
  • Save HailStorm32/169df65a47a104199b5cc57d10fa57de to your computer and use it in GitHub Desktop.
Save HailStorm32/169df65a47a104199b5cc57d10fa57de to your computer and use it in GitHub Desktop.
DLU-Native-Windows-Setup-Guide

Before you start

You will need to find and download an unpacked LEGO Universe client (this guide will work for packed and unpacked clients). Make sure that its hash matches the ones mentioned in the repo README

This tutorial was done in Windows 11. The way some things are accessed might be different in older versions of Windows

Setup

Programs to install

You will need to install the following software

  • 7zip

  • Visual Studio C++ enter image description here

  • CMake

    Make sure, if asked, to add the program to the system PATH

  • git

  • mariadb

    MUST KEEP THE DEFAULT PORT AT 3306!! will not work if it is changed

    Set the root password as root However, if you plan on making your server accessible outside your network, set this to a strong password instead


Cloning the server code repository

  1. Navigate to your Documents folder
  2. Right click in this folder and select Show More Options > Git Bash Here

    If you are on Windows 10, you can skip the Show More Options option

  3. In the terminal window that popped up run git clone --recursive https://github.com/DarkflameUniverse/DarkflameServer

Building the server

  1. Navigate to the DarkflameServer folder

  2. Right click in this folder and select Show More Options > Git Bash Here

    If you are on Windows 10, you can skip the Show More Options option

  3. Run ./build.sh

While the server is building we will prepare the client files


Preparing client files

Extracting the client

  1. Navigate to where you downloaded the client and move it to your Documents folder
  2. Right click the .rar client file and select 7-Zip > Extract files... Keep the default settings (this will take some time)

    If your client is already extracted, move the folder to Documents

  3. You should now have a folder called something like LEGO Universe (unpacked) or LEGO Universe
  4. Delete the .rar file
  5. Rename the client folder to client

    Right click the folder, go to Show more options > Rename


Server mySQL database

  1. In the Start Menu start typing mariadb and open the program that is called Command Prompt (MariaDB XXX (x64)) (where XXX is the version number)
  2. In the terminal that just came up, log into the root user by running the following mysql -u root -p

    the password when prompted will be root

  3. Once logged in, run CREATE OR REPLACE USER 'darkflame'@'localhost' IDENTIFIED BY 'password';

    darkflame is the database username. Replace password with a password of your choice. This will be the database password

  4. Then run CREATE OR REPLACE DATABASE darkflame;

    darkflame is again the name of the database

  5. Then run GRANT ALL PRIVILEGES ON darkflame.* TO 'darkflame'@'localhost';
  6. Then run FLUSH PRIVILEGES;
  7. Then exit by running EXIT;
  8. You can now close the terminal

Server Configuration

.ini file

Credentials

Navigate to the DarkflameServer/build folder.

If you dont have the build folder and/or the following .ini files, your build failed

In the sharedconfig.ini file, add the database IP (localhost) to mysql_host=, the database name (darkflame) to mysql_database=, database username (darkflame) to mysql_username=, and the database password to mysql_password=

The end result should look like this

# MySQL connection info:
mysql_host=localhost
mysql_database=darkflame
mysql_username=darkflame
mysql_password=XXXYYYZZZ

Where XXXYYYZZZ is the password you chose earlier

Next, in the same file, add the server IP (localhost) to external_ip=

Should look like

external_ip=localhost

Client Location

Still in the sharedconfig.ini file, add the following to client_location=

..\..\client

The end result should look like this

# The location of the client
# Either the folder with /res or with /client and /versions
client_location=..\..\client

Database migrations

mysql

  1. As of 10/25/2022 the mysql migrations are now done automatically when you start the server

sqlite

  1. As of 10/30/2022 the sqlite migrations are now done automatically when you start the server

Setup Admin Account

  1. Open a terminal in the build folder of the server and run ./MasterServer.exe -a

    IF that gives you issues, try ./MasterServer -a

    It might hang for a minute or two, just wait.

  2. Enter a username

  3. Enter a password

  4. These credentials are what you are going to use to login to the game with REMEMBER THEM


Client Configuration

boot.cfg

  1. Open you client folder and open the boot.cfg file in a text editor

    If you had a packed client, the boot.cfg file will be in the client folder

  2. If it isn't already, set AUTHSERVERIP=0: to localhost
  3. Change UGCUSE3DSERVICES=7:1 to UGCUSE3DSERVICES=7:0

The file should look like this

.
. [unchanged lines here]
.
AUTHSERVERIP=0:localhost,
.
. [unchanged lines here]
.
UGCUSE3DSERVICES=7:0
.
. [unchanged lines here]
.
  1. Save and close the file

Running The Server

Starting the server

  1. Open a terminal in the build folder of the server and run ./MasterServer.exe

    IF that gives you issues, try ./MasterServer

  2. A bunch of terminal windows should popup, this is normal

    If you get a bunch of firewall requests, close them out. You only need to accept them if you want make your server accessible outside your network (not covered in this tutorial)

  3. Start your client and login

Shutting down the server

  1. Go to the main terminal you opened and hit Ctrl+C
  2. After a few seconds all the terminal windows (except the main one) should close
  3. Server is now shutdown
  4. Close the main terminal

Updating The Server

As of the writing of this guide the DLU codebase is still actively being contributed to and as such, the code base is constantly being updated. Some of these updates include bug fixes or feature additions. It is recommend to update the server at least once every 2 weeks.

Update steps

Open a terminal in the server folder and run the following

  1. git pull --recurse-submodules

  2. ./build.sh

    Running the build script will automatically run mysql migrations

  3. Any new sqlite or mysql migrations are run automatically when you start the server. If there are new migrations to run, startup will be slightly slower




last updated 1/21/24

@Darthagnon
Copy link

Thank you!
For reference, here's the video guide, and here's the Reddit release post

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