Coder Social home page Coder Social logo

berkayylmao / setting-up-sbrw Goto Github PK

View Code? Open in Web Editor NEW
15.0 2.0 6.0 548 KB

A *brief* guide on how to set up a Soapbox Race World (SBRW) server for NFS: World. Should include everything you'll need.

License: GNU General Public License v3.0

Batchfile 100.00%
nfs sbrw soapbox soapboxraceworld server core setup guide walkthrough tutorial

setting-up-sbrw's Introduction

Disclaimer

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.

So you want to host an SBRW server?

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.

Step 0. Foreshadowing

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.

Step 1. Setting up the environment

Get Git

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:

Imgur

Set up project base

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:.

Imgur

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.

Get the code

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

Install and configure the necessary applications

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 version 8.0.23):

    Imgur

    • Select Development Computer if you're installing MySQL on your home computer, Server Computer otherwise.

    Imgur

    • Uncheck Open Windows Firewall ports for network access.

    Imgur

    • Just click Next here.

    Imgur

    • 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).

    Imgur

    • Then keep clicking Next until the installation finishes.

    • MySQL Workbench will open, just click on the Local instance connection.

    Imgur

    • Click on File->Open SQL Script

    Imgur

    • Go to the folder where you downloaded all the code. Open the three scripts inside setting-up-sbrw/Files/MySQL scripts.

    Imgur

    • Switch to 1. Base's tab and change the 2 passwords, preferably generating them from the link before.

    Imgur

    • 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).

    Imgur

    • Minimize MySQL Workbench. We'll come back to it later.
  • JDK10: AdoptOpenJDK10

    • Preferably extract this to C:\AdoptOpenJDK10.

    Imgur

  • Maven: Apache Maven

    • Preferably extract this to C:\ApacheMaven.

    Imgur

  • GoLang: GoLang

    • Preferably install this to C:\Go.

Step 2. Compiling the code

  • Go to the folder where you downloaded all the code. Run setting-up-sbrw/Files/build-script.bat.

Imgur

  • 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 !!

Step 3. Setting up Openfire

  • Go to the folder where you downloaded all the code. Run setting-up-sbrw/Files/start-sbrw.bat.

Imgur

  • 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.

Imgur

  • Change the XMPP Domain Name and Server Host Name to your IP address. The IP address should be in the IPv4 format, e.g., xxx.xxx.xxx.xxx. Afterwards, click Continue.
    • 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.

Imgur

  • Select Standard Database Connection and click Continue.

Imgur

  • Pick the MySQL driver preset.

Imgur

  • Change the Database URL to jdbc:mysql://localhost:3306/OPENFIRE?rewriteBatchedStatements=true&characterEncoding=UTF-8&characterSetResults=UTF-8&serverTimezone=UTC.

Imgur

  • Enter openfire as the Username and the password you chose for the openfire user back in the 1. Base MySQL script as the Password.

Imgur

  • Select Default and click Continue.

Imgur

  • Enter an e-mail address that belongs to you and pick a password for the Openfire panel. Click Continue.

Imgur

  • Click Login to the admin console.

Imgur

  • Enter admin as the username and the password you just picked as the password.

Imgur

  • Go to Server Settings->Registration & Login and disable Inband Account Registration. Click Save Settings.

Imgur

  • Go to Server Settings->Compression Settings and set both settings to Not Available. Click Save Settings.

Imgur

  • Go to Server Settings->REST API (SBRW) and set it to Enabled. Pick the Secret key auth option and note down the Secret key (this is unique already, so you don't need to change it). Click Save Settings.

Imgur

  • That's it for the Openfire panel configuration.

Step 4. Finalizing server 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 the Details tab and killing all java.exe/javaw.exe processes.

    Imgur

  • Open the MySQL Workbench that you minimized before.

    • Right-click on an empty space in the Schemas panel. Click on Refresh All.

    Imgur

    • Open the soapbox->Tables and select the parameter table. Click on the rightmost icon with a lighting bolt on it.

    Imgur

    • Double-click on ENABLE_REDIS' value and change it to false.

    Imgur

    • Scroll down and find OPENFIRE_TOKEN. Double click on its value and change it to the secret key you noted down (from the Rest API section in Openfire).

    Imgur

    • 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.

    Imgur

    • Scroll down to the bottom. Change the value of UDP_FREEROAM_IP, UDP_RACE_IP and XMPP_IP to the IP address you noted down back in the Openfire setup.

    Imgur

    • Click on Apply, then Apply again.

    Imgur

    • Click on Finish and close MySQL Workbench.

    Imgur

  • 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 the 1. Base MySQL script.

    Imgur

    • Save and exit.
  • Open Windows Firewall with Advanced Security.

    Imgur

    • Select Inbound Rules and then click on New Rule... on the right panel.

    Imgur

    • Select Port. Click Next.

    • Select TCP, enter 80, 8080, 5222 as the ports. Click Next.

    Imgur

    • Select Allow the connection. Click Next.

    Imgur

    • Select all of the three options. Click Next.

    Imgur

    • Give the rule a unique name and click Finish.

    Imgur

    • Repeat the same steps, but this time select UDP and enter 9998, 9999 as the ports.
    • Repeat the same steps in Outbound Rules (for TCP and UDP).

Step 5. Running the server

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.

Imgur

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.

Imgur

Step 6. Connecting to the server

  • Open the SBRW Launcher.

  • Click on the + button at the top-right.

Imgur

  • Add your server information in this format:

Imgur

  • Click OK. Restart the launcher, select your server from the list, register, login and play!

Known issues

  • The scripts build-script.bat and start-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 the parameter table in the MySQL->soapbox database.

More information

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.

setting-up-sbrw's People

Contributors

berkayylmao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

setting-up-sbrw's Issues

Heeelp

org.wildfly.swarm.bootstrap.util.TempFileManager$1.visitFile(TempFileManager.java:100)
2023-05-03 14:03:21,717 ERROR [stderr] (main) at java.base/java.nio.file.Files.walkFileTree(Files.java:2725)
2023-05-03 14:03:21,717 ERROR [stderr] (main) at java.base/java.nio.file.Files.walkFileTree(Files.java:2797)
2023-05-03 14:03:21,718 ERROR [stderr] (main) at org.wildfly.swarm.bootstrap.util.TempFileManager.deleteRecursively(TempFileManager.java:100)
2023-05-03 14:03:21,720 ERROR [stderr] (main) at java.base/java.util.concurrent.ConcurrentHashMap$KeySetView.forEach(ConcurrentHashMap.java:4696)
2023-05-03 14:03:21,721 ERROR [stderr] (main) at java.base/java.util.Collections$SetFromMap.forEach(Collections.java:5581)
2023-05-03 14:03:21,725 ERROR [stderr] (main) at org.wildfly.swarm.bootstrap.util.TempFileManager.close(TempFileManager.java:90)
2023-05-03 14:03:21,725 ERROR [stderr] (main) at org.wildfly.swarm.container:[email protected]//org.wildfly.swarm.container.runtime.RuntimeServer.cleanup(RuntimeServer.java:323)
2023-05-03 14:03:21,726 ERROR [stderr] (main) at org.wildfly.swarm.container:[email protected]//org.wildfly.swarm.container.runtime.RuntimeServer.stop(RuntimeServer.java:313)
2023-05-03 14:03:21,726 ERROR [stderr] (main) at org.wildfly.swarm.container:[email protected]//org.wildfly.swarm.container.runtime.RuntimeServer$Proxy$_$$_WeldClientProxy.stop(Unknown Source)
2023-05-03 14:03:21,726 ERROR [stderr] (main) at org.wildfly.swarm.container:[email protected]//org.wildfly.swarm.Swarm.stop(Swarm.java:434)
2023-05-03 14:03:21,727 ERROR [stderr] (main) at org.wildfly.swarm.container:[email protected]//org.wildfly.swarm.Swarm.tryToStopAfterStartupError(Swarm.java:779)
2023-05-03 14:03:21,727 ERROR [stderr] (main) at org.wildfly.swarm.container:[email protected]//org.wildfly.swarm.Swarm.main(Swarm.java:756)
2023-05-03 14:03:21,727 ERROR [stderr] (main) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2023-05-03 14:03:21,728 ERROR [stderr] (main) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2023-05-03 14:03:21,728 ERROR [stderr] (main) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2023-05-03 14:03:21,729 ERROR [stderr] (main) at java.base/java.lang.reflect.Method.invoke(Method.java:566)
2023-05-03 14:03:21,729 ERROR [stderr] (main) at org.wildfly.swarm.bootstrap.MainInvoker.invoke(MainInvoker.java:57)
2023-05-03 14:03:21,729 ERROR [stderr] (main) at org.wildfly.swarm.bootstrap.Main.run(Main.java:134)
2023-05-03 14:03:21,730 ERROR [stderr] (main) at org.wildfly.swarm.bootstrap.Main.main(Main.java:87)
2023-05-03 14:03:21,731 ERROR [stderr] (main) java.nio.file.FileSystemException: C:\Users\Jeff\AppData\Local\Temp\thorntailnarayana-jts-idlj-5.9.8.Final5320675149778258534.jar: O arquivo jß estß sendo usado por outro processo.
2023-05-03 14:03:21,731 ERROR [stderr] (main)

heeelp

Redis usage

Current SBRW core uses Redis for Matchmaking tasks, and while Redis itself is available for Linux-based OS, the Windows-based versions of Redis is outdated to be used properly on SBRW. However you can use "Memurai" (google it) as a Redis-compatible replacement on Windows OS. As I tried, it's pretty compatible enough.

Openfire and Server Console Errors

Server Console Errors
Openfire Errors

These errors are consistently occurring with these applications. I have followed the tutorial exactly as shown in the readme. Even after I have set up everything with MySQL and Openfire these errors still pop up.

java.nio.file.FileSystemException error

hello, everyting is ok but i get "The process cannot access the file because it is being used by another process" when i start core. jar script how can i fix?

Problems with Powerup Items

I read the instructions I see that you recommend installing MODNET.

I have set up the initial setup of index.json file and set it up in Database. But still can't use Powerup Item.

Can you advise me on installing MODNET Framework on Win 10 or Linux systems?

=======================

I'm trying to find out about MODNET, which I'm not sure if you mean this?
https://modnet.readthedocs.io/en/latest/

Thank you and Openfire version

Hello,

I just wanted to say thank you for making this awesome guide that works.
I also want to share that I had more luck with Openfire version 4.6.2. The version in the original repo had a wrong version of the JAXB-API and didn't want to work.

Thanks again.

cmd komutu problemi

dostum öncelikle eline sağlık, son aşamada start yaptıktan sonra herşey açılıyor fakat cmd komutu birdenbire kapanıyor throntail is ready olmadan, loglarını da bulamadım yardımcı olabilir misin rica etsem?

Cannot add my own server with SBRW Launcher

Hello everyones.

I tried to follow many times again and again to the Berkay's guide and nowadays, I haven't still get access to my server after tryed to add it on the list. However, I think, everythings than I did, I configured them well but I've got this as error:

SBRW Launcher Error Log

Add Server Check Encoutered an Error:
Unable to connect to the remote server

Would you Like to Open the Launcher Error Log and Send it to a Support Channel?
This would be Useful for Fixing Issues and Potential Solutions

And after clicked on Yes button, that's said me this in plus:

--- End of inner exception stack trace ---
at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request)
at System.Net.WebClient.DownloadString(Uri address)
at SBRW.Launcher.App.UI_Forms.Custom_Server_Add_Screen.Screen_Custom_Server_Add.<>c__DisplayClass5_0.<Button_Add_Click>b__0() in G:\GitHub\SoapboxRaceWorld\GameLauncher_NFSW\SBRW.Launcher.Net\App\UI_Forms\Custom_Server_Add_Screen\Screen_Custom_Server_Add.cs:line 112
09/20/2023 [ ERROR] ADD SERVER [Base]: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
09/20/2023 [ ERROR CODE] ADD SERVER [Base]: -2147467259
09/20/2023 [ FULL ERROR] ADD SERVER [Base]: System.Net.Sockets.SocketException (0x80004005): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress & address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)

Thanks for explain me where come from the problem.

: )

XMPPserver Dependency Error

I can't get past a build-script.bat issue, and I think it's because I can't figure out what certificate to install.

Core XMPP Server Failure:
[ERROR] Failed to execute goal on project xmppserver: Could not resolve dependencies for project org.igniterealtime.openfire:xmppserver:jar:4.5.0-SNAPSHOT: Could not transfer artifact org.glassfish.jaxb:jaxb-runtime:jar:4.0.0 from/to atlassian-public (https://maven.atlassian.com/repository/public): Transfer failed for https://maven.atlassian.com/repository/public/org/glassfish/jaxb/jaxb-runtime/4.0.0/jaxb-runtime-4.0.0.jar: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]

Also, I don't know if this is important to the build but I get a bunch of warnings just after ===== SBRW Projects Completed =====

[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.igniterealtime.openfire:xmppserver:jar:4.5.0-SNAPSHOT
[WARNING] 'dependencies.dependency.version' for javax.xml.bind:jaxb-api:jar is either LATEST or RELEASE (both of them are being deprecated) @ line 328, column 22
[WARNING] 'dependencies.dependency.version' for org.glassfish.jaxb:jaxb-runtime:jar is either LATEST or RELEASE (both of them are being deprecated) @ line 333, column 22
[WARNING] 'dependencies.dependency.version' for javax.activation:activation:jar is either LATEST or RELEASE (both of them are being deprecated) @ line 338, column 22
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.igniterealtime.openfire:starter:jar:4.5.0-SNAPSHOT
[WARNING] 'dependencies.dependency.systemPath' for install4j:install4j:jar should not point at files within the project directory, ${project.basedir}/libs/i4jruntime.jar will be unresolvable by dependent projects @ line 61, column 25
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]

Thanks for any help anyone would offer!


To help others open cmd window and use this line:
keytool -import -alias a -file C:\a.cer -keystore C:\AdoptOpenJDK10\lib\security\cacerts -storepass changeit

You can build the a.cer file by opening the https url in chrome, then click the padlock in the URL. Then Connection -> Certificiate is Valid -> Certification Path tab, click the top level certificate path -> View Certificate -> Details Tab -> Copy to file.

That file is what you use to add that certificate to the keystore.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.