LEGO Universe server written in C#
The LEGO Group has not endorsed or authorized the operation of this game and is not liable for any safety issues in relation to its operation.
Contributions are always welcome! Feel free to open pull requests or issues to help with the continued development of Uchu.
Uchu supports Python scripting, which you can use to code minigames, new game features, and a lot more! This is the perfect way for those of you with less programming experience to contribute.
Check out the release page for standalone binary releases of Uchu.
This project will be built and run using a CLI. You will also require a text editor capable of editing raw text files. These are requirements of setting up this project so if you are not familiar with either it is recommended to research them in advance. Users should also understand that Uchu is not a game in and of itself, but a server which tells a program on your computer - the client - what to do. Uchu is built with .NET Core 3.1 (see below for installation details) which is compatible with Windows, Linux, and MacOS.
Install .NET Core 3.1 SDK for your OS using the instructions found on here.
Uchu uses PostgreSQL as its database provider by default. This can be changed in the config file to either MySQL or SQLite.
If and when prompted to choose a password for the "postgres" user, choose "postgres" for ease of setup later on.
sudo apt update
sudo apt install postgresql postgresql-contrib
https://www.enterprisedb.com/downloads/postgres-postgresql-downloads#windows
Refer to brew instructions here.
Uchu uses Redis as its Cache service provider. If you decide to skip this step, the server will fall back to the database for caching. The latest version of Redis is only natively supported on Linux and MacOS so setting it up on Windows requires some workarounds.
Recommended to install when setting up for hosting.
sudo apt install redis-server
brew install redis
There's a package on chocolatey, although fairly outdated and may cause issues.
You can find a list of available clients here, it is recommended you download humanoid/lcdr's unpacked client.
Uchu does not contain all of the information the server needs to run LEGO Universe and requires resources from the client in order to run. If you do choose a packed client, you will have to unpack the files yourself using lcdr's utilities.
The underlying network library this server (now) uses does not have support for the original RakNet protocol the game used. Because of this you will have to download this client mod made by lcdr and extract it next to the game's executable.
There are several reasons for not supporting the original protocol anymore with the major one being security, if you would like to get more info please contact us on discord (or via mail if that's your thing).
Unlike on Windows, Wine does not automatically load dll files placed in the same directory as the executable. You will have to run the client like this in order for it to use the shim's dinput8:
WINEDLLOVERRIDES="dinput8.dll=n,b" wine ./legouniverse.exe
sudo apt install git
Included in macos dev tools, running git
from a terminal should prompt you to install them.
You can download git from the official website.
You can append --depth 1
to the following command if you don't care about commit history and/or have slow internet.
git clone https://github.com/yuwui/Uchu --recursive -b master
Run the following command in the project root directory (where Uchu.sln is located)
dotnet build
Before we can configure the server, it needs to generate a config file.
- Navigate to where you built the Uchu.Master project. This is commonly
bin/Debug/netcoreapp3.1/
, relative to the Uchu.Master path, but may differ. - Run
dotnet Uchu.Master.dll
. This will throw errors. - Close the process when it says it has generated a default config file.
Uchu is not a LEGO Universe repository and you will have to supply your own game resource files for the servers to work with.
- Navigate to where you have LEGO Universe installed and copy the full path to the
res
directory. - Find the
config.default.xml
file generated earlier and rename it toconfig.xml
- Open the config, go to
<GameResourceFolder></GameResourceFolder>
and paste your LEGO Universe'sres
directory path between the tags.
No quotation marks (""
) should be used.
You should check if you've filled in the right database credentials in the config file, it will not run without a database connection.
You have to tell Uchu where it can find the different libraries it will utilize at runtime.
- Open the config file and find the
<DllSource></DllSource>
section. - If
dotnet
is not accessible as a global command, copy the path todotnet(.exe)
in between the<DotNetPath></DotNetPath>
tags. - Copy the path to Uchu.Instance.dll in between the
<Instance></Instance>
tags. This is commonly/bin/Debug/netcoreapp3.1
, relative to the Uchu.Instance path, but may differ. - Copy the path to Uchu.StandardScripts.dll in between the
<ScriptDllSource></ScriptDllSource>
tags. This is commonly/bin/Debug/netcoreapp3.1
, relative to the Uchu.StandardScripts path, but may differ.
No quotation marks (""
) should be used.
If your operating system does not allow you to host a server on any specific network port, or you run other services that might occupy any of the network ports used by Uchu, you can change the config to bind to different ports.
- Open the config file and find the
<Networking></Networking>
section. - To rebind the character network port, add a xml element like this (for network port 4000),
<CharacterPort>4000</CharacterPort>
. - World servers will incrementally bind to network 2003(+). This might not be feasible for when you have to port-forward for every world server. You can therefore add ANY NUMBER of xml element like this (for network port 10000),
<WorldPort>10000</WorldPort>
, to tell Uchu where it can bind world servers.
IMPORTANT! If Uchu runs out of specified world ports, additional world servers will not work.
- Open the config file and find the
<Api></Api>
section. - APIs will incrementally bind to network 10000(+) by default. This can be changed by setting the number in the
<Port></Port>
tags.
If you are using a Single-Sign-On (SSO) authentication server (https://github.com/lcdr/sso_auth), you need to specify the domain it is located on.
- Open the config file and find the
<Sso></Sso>
section. - Input the domain where the SSO authentication server is hosted in between the
<Domain></Domain>
tags. - Set the
<HostAuthentication></HostAuthentication>
variable in the<Networking></Networking>
section tofalse
.
In the Uchu.Master console, type /adduser <username>
and press enter. You will than have to enter a password which will be displayed as stars (*), and when you are done, press enter.
In the Uchu.Master console, type /gamemaster <username> 2
. This will make your account an Admin and will give you access to a lot of commands. Type "/" using the ingame chat to have your options displayed to you.
These features are experiential and may be unstable. These can be enabled under the <GamePlay></GamePlay>
section in the config file.
If you have used an older version of Uchu, you might have to reset your config file to accomodate new additions. Do this by deleting your old config file and have the server generate a new one.
Make sure the RakDotNet/
and InfectedRose/
directories are not empty. If they are you have to pull those submodules with git.
If they are not empty but the code still does not compile, they might be out of date. Pull those submodules with git to update them.
If the server did not output a line saying the api is ready, attempt to rebind the API port. See Network ports -> API
The server is saying Invalid local resources (Invalid path or no .luz files found). Please ensure you are using an unpacked client.
Please ensure you are using an unpacked client. See Prerequisite -> LEGO Universe Client
Attempt to specify a different character port. See Network ports -> Servers. If that doesn't work double check that the Uchu.Instance and Uchu.StandardScripts paths are correct. See Configuration -> Define Uchu.Instance and Uchu.StandardScripts.
Attempt the specify a couple of world server ports. See Network ports -> Servers
Make sure the CDClient.db
is not corrupted. You might have to manually copy it to the output directory from Uchu.Core.
Uchu is far from complete, and a lot of features just are not implemented. You can run the /complete
command in chat to complete all your active missions.