I wrote this guide only to help people who didn't even know what to do with the code. I offer no support, so please do not contact me asking for help/support.
You better buckle up, because this thing is as tedious as they get. This entire guide will focus on a Windows installation, although it shouldn't be any more difficult for a *nix user to follow.
You should set this whole thing up in a VPS, but your computer at home will do just fine as well. A VPS will offer the ability of hosting this 24/7 and being able to handle many concurrent users, probably better server performance and a much better data security.
So you have two options from the get-go:
-
Rent a VPS. Really the better option in all cases, but may cost you $6-50USD each month. For around 50-100 concurrent users, at least 6GBs of RAM is advised. Dormant memory footprint of the server and all its dependencies is around 2GBs.
-
Use your computer and your own internet connection. You will need a stable, and preferably fast, internet connection and above OK specs to be able to host the server reliably. If you intend to use the server to play with some friends every now and then, LAN or otherwise, this option is the best.
After you decide on that, you need to know that in this guide, you'll be required to download over 500MBs of source code and probably almost as much of applications. If you already have a VPS, follow the guide from within that.
You'll want to grab a Git shell first. This one is pretty popular and the one used in this guide as well. The installation offers many options, so just don't touch anything you don't know about. The default options work just fine. Just make sure to have Git add to PATH
, like here:
Next, find which one of your hard drives have the most space; you'll need at least 2 gigabytes of it. Now open up Command Prompt
and switch to that drive. So if it's driver D:
, just type in D:
.
Create a folder somewhere in that drive and copy its path, now do cd [space] [your path]
in the command prompt.
For example, cd D:\Somewhere\Elsewhere
.
Time to get all them codes! Execute these commands on the command prompt (you can copy+paste them). The order is irrelevant and you can open multiple command prompts to have them all done at once, just make sure to cd
into the directory you created previously.
git clone https://github.com/SoapboxRaceWorld/soapbox-race-core
git clone https://github.com/VladManyanov/sbrw-mp-sync-2018
git clone https://github.com/WorldUnitedNFS/freeroam
git clone https://github.com/SoapboxRaceWorld/openfire
git clone https://github.com/igniterealtime/openfire-nonSaslAuthentication-plugin
git clone https://github.com/SoapboxRaceWorld/openfire-restAPI-plugin
git clone https://github.com/berkayylmao/setting-up-sbrw
You now have the code, but you'll need applications to make use of them. The following are merely suggestions, but are used in this guide, tested thoroughly and practically work out-of-the-box.
-
A database service: MySQL
- Select
Custom
for the setup type and only pick the following (the versions should match, in my case they are all version8.0.23
):
- Select
Development Computer
if you're installing MySQL on your home computer,Server Computer
otherwise.
- Uncheck
Open Windows Firewall ports for network access
.
- Just click
Next
here.
- Pick a nice password for the root user here and make sure to save it somewhere and have backups of it as well. I recommend using this to generate passwords (you'll need to do more of this later).
-
Then keep clicking
Next
until the installation finishes. -
MySQL Workbench will open, just click on the
Local instance
connection.
- Click on
File->Open SQL Script
- Go to the folder where you downloaded all the code. Open the three scripts inside
setting-up-sbrw/Files/MySQL scripts
.
- Switch to
1. Base
's tab and change the 2 passwords, preferably generating them from the link before.
- Execute them in the displayed order (1. -> 2. -> 3.). To execute one of them, just select its tab and click on
Query->Execute (All or Selection)
.
- Minimize
MySQL Workbench
. We'll come back to it later.
- Select
-
JDK10: AdoptOpenJDK10
- Preferably extract this to C:\AdoptOpenJDK10.
-
Set a user environment variable named
JAVA_HOME
and set its value toC:\AdoptOpenJDK10
. -
Edit the user or system PATH environment variable and add the folder
C:\AdoptOpenJDK10\bin
.
-
Maven: Apache Maven
- Preferably extract this to C:\ApacheMaven.
- Edit the user or system PATH environment variable and add the folder
C:\ApacheMaven\bin
.
-
GoLang: GoLang
- Preferably install this to C:\Go.
- Go to the folder where you downloaded all the code. Run
setting-up-sbrw/Files/build-script.bat
.
- This script should work fine if you followed all of the steps correctly. It has no error checking itself, so keep your eyes on the window to see if something goes wrong. !! DO NOT CONTINUE TO THE NEXT STEP IF YOU SEE ANY ERRORS !!
- Go to the folder where you downloaded all the code. Run
setting-up-sbrw/Files/start-sbrw.bat
.
-
There will be errors and the core server can close itself at this time, this is okay.
-
Open your favourite browser and navigate to
http://localhost:9090/setup/index.jsp
. My setup and Openfire pages can look visually different, e.g. the Openfire version at the top-right, but you should be able to follow this 1:1. -
Select a language and click
Continue
.
- Change the
XMPP Domain Name
andServer Host Name
to your IP address. The IP address should be in the IPv4 format, e.g.,xxx.xxx.xxx.xxx
. Afterwards, clickContinue
.- If you're on a VPS, this is your remote connection IP.
- If you're doing this from your home computer and want to host this server worldwide, enter your public IP. (Google this if you don't know it.)
- If you're doing this from your home computer and want to use this server for LAN play, enter your computer's local IP. (Google this if you don't know it.)
- Note down the IP address you enter here, you'll need it later.
- Select
Standard Database Connection
and clickContinue
.
- Pick the MySQL driver preset.
- Change the
Database URL
tojdbc:mysql://localhost:3306/OPENFIRE?rewriteBatchedStatements=true&characterEncoding=UTF-8&characterSetResults=UTF-8&serverTimezone=UTC
.
- Enter
openfire
as theUsername
and the password you chose for the openfire user back in the1. Base
MySQL script as thePassword
.
- Select
Default
and clickContinue
.
- Enter an e-mail address that belongs to you and pick a password for the Openfire panel. Click
Continue
.
- Click
Login to the admin console
.
- Enter
admin
as the username and the password you just picked as the password.
- Go to
Server Settings->Registration & Login
and disableInband Account Registration
. ClickSave Settings
.
- Go to
Server Settings->Compression Settings
and set both settings toNot Available
. ClickSave Settings
.
- Go to
Server Settings->REST API (SBRW)
and set it toEnabled
. Pick theSecret key auth
option and note down theSecret key
(this is unique already, so you don't need to change it). ClickSave Settings
.
- That's it for the Openfire panel configuration.
-
Close all of the command prompt windows that are open.
-
Make sure no Java process is left hanging.
- You can do this by opening the
Task Manager
, going to theDetails
tab and killing alljava.exe
/javaw.exe
processes.
- You can do this by opening the
-
Open the
MySQL Workbench
that you minimized before.- Right-click on an empty space in the
Schemas
panel. Click onRefresh All
.
- Open the
soapbox->Tables
and select theparameter
table. Click on the rightmost icon with a lighting bolt on it.
- Double-click on
ENABLE_REDIS
' value and change it tofalse
.
- Scroll down and find
OPENFIRE_TOKEN
. Double click on its value and change it to thesecret key
you noted down (from the Rest API section in Openfire).
- Scroll down and find
SERVER_ADDRESS
. Double click on its value and change it to the the IP address you noted down back in the Openfire setup in this format:http://THE_IP_ADDRESS_HERE
.
- Scroll down to the bottom. Change the value of
UDP_FREEROAM_IP
,UDP_RACE_IP
andXMPP_IP
to the IP address you noted down back in the Openfire setup.
- Click on
Apply
, thenApply
again.
- Click on
Finish
and closeMySQL Workbench
.
- Right-click on an empty space in the
-
Go to the folder where you downloaded all the code. Open
setting-up-sbrw/Files/sbrw/core/project-defaults.yml
in a text editor, I recommend Notepad++. If you don't want to install any more things, you can use WordPad.- Change the value of
password
(by default,secret
) to the password you chose for the soapbox user back in the1. Base
MySQL script.
- Save and exit.
- Change the value of
-
Open
Windows Firewall with Advanced Security
.- Select
Inbound Rules
and then click onNew Rule...
on the right panel.
-
Select
Port
. ClickNext
. -
Select
TCP
, enter80, 8080, 5222
as the ports. ClickNext
.
- Select
Allow the connection
. ClickNext
.
- Select all of the three options. Click
Next
.
- Give the rule a unique name and click
Finish
.
- Repeat the same steps, but this time select
UDP
and enter9998, 9999
as the ports. - Repeat the same steps in
Outbound Rules
(for TCP and UDP).
- Select
All that's left now is to run it. Go to the folder where you downloaded all the code. Run setting-up-sbrw/Files/start-sbrw.bat
.
If you did everything correctly and no breaking changes happened in SBRW after this guide was written, the server will start without any errors. You'll know if it ran successfully by seeing the statement Thorntail is Ready
on the core server's console window.
-
Open the SBRW Launcher.
-
Click on the
+
button at the top-right.
- Add your server information in this format:
- Click
OK
. Restart the launcher, select your server from the list, register, login and play!
-
The scripts
build-script.bat
andstart-sbrw.bat
won't work if you install anything to a path different than what is advised in this guide. Their goal is to help you build the code, they depend on those paths. -
Powerups, events or anything related to multiplayer will not work by default. This is partly caused by the current SBRW team relying on their mod framework
ModNet
to do it instead of adding the necessary code to the core server itself. To get a very basic ModNet setup for your server:-
You need to host an http server on port 80.
-
The server should have an
index.json
in its root folder with the following format:
{ "built_at": "2021-02-28T23:01:24.394847+03:00", "entries": [] }
- You need to add the entries
MODDING_BASE_PATH (value: same as SERVER_ADDRESS)
,MODDING_ENABLED (value: true)
,MODDING_FEATURES (value: "")
,MODDING_SERVER_ID (value: a unique name for your server, it won't be visible to the public)
to theparameter
table in theMySQL->soapbox
database.
-
Note: This is a very basic setup of the SBRW server. I only had the time to cover this much of it.
If you encounter any issues, please report it here for the community to discuss. Give as much detail as possible.
Any and all PRs are welcome.