Hosting Your Own Server: Difference between revisions
(Created page with "If you're tired of our official servers, you're always free to <b>host your own server</b> and add any content you desire (as long as our server supports it, of course). This article will guide you through the steps you need to take in order to create and host your own MWO server for you and your friends to play on. <h1>Prerequisites</h1> <ul> <li>A PC running Windows or Linux</li> <li>A router capable of port forwarding to make sure other people ca...") |
m (fix dead links for server resources) |
||
(15 intermediate revisions by one other user not shown) | |||
Line 3: | Line 3: | ||
<h1>Prerequisites</h1> | <h1>Prerequisites</h1> | ||
<ul> | <ul> | ||
<li>A PC running Windows | <li>A PC running Windows</li> | ||
<li>A router capable of port forwarding to make sure other people can access your server</li> | <li>A router capable of port forwarding to make sure other people can access your server</li> | ||
<li>A basic understanding of JSON configs</li> | <li>A basic understanding of JSON configs</li> | ||
Line 10: | Line 10: | ||
<h1>Downloading the Server</h1> | <h1>Downloading the Server</h1> | ||
<ul> | <ul> | ||
<li>[https://content-api. | <li>[https://content-api.plakmp.com/plak/content/clients/mwo-server-package-windows-x86.zip Windows (x86)]</li> | ||
<li>[https://content-api. | <li>[https://content-api.plakmp.com/plak/content/clients/mwo-server-package-windows-x64.zip Windows (x64)]</li> | ||
<li> | <li><b>NOTE:</b> if you're downloading the server package to UPDATE your server due to a new version coming out, you don't need to unpack everything: in most cases dragging & dropping <code>mwo-server</code> and all DLL files into your existing server directory is enough.</li> | ||
</ul> | </ul> | ||
Once you've downloaded the server archive, unpack it somewhere and move on to the <b>Running the Server</b> section. | Once you've downloaded the server archive, unpack it somewhere and move on to the <b>Running the Server</b> section. | ||
Line 28: | Line 27: | ||
Once you've launched the server, you should see its console logs in their entirety. In a freshly launched server, the latest line of the logs will include your server's port. <b>You must FORWARD THAT PORT</b> AND <b>that port + 1</b> if you want your server to accept non-local connections. (In simpler words: if you see <b>1551</b>, forward <b>1551 AND 1552</b>!) | Once you've launched the server, you should see its console logs in their entirety. In a freshly launched server, the latest line of the logs will include your server's port. <b>You must FORWARD THAT PORT</b> AND <b>that port + 1</b> if you want your server to accept non-local connections. (In simpler words: if you see <b>1551</b>, forward <b>1551 AND 1552</b>!) | ||
<br> | <br> | ||
At this point, you should be able to join the server | <b>NOTE:</b> You must forward the ports for BOTH TCP AND UDP in order for the sync to work properly. | ||
<br> | |||
<br> | |||
At this point, you should be able to join the server via adding <code>127.0.0.1</code> in the MWO Launcher, using your account from official MWO servers. Check out the <b>Customizing the Server</b> section to learn how to change your server's name, ports, settings, timecycles, accounts, mods and much more! | |||
[[File:ServerConsoleScreenshot.png|300px|thumb|right|If you did everything right, you should see something similar once you launch the server. Note the port!]] | [[File:ServerConsoleScreenshot.png|300px|thumb|right|If you did everything right, you should see something similar once you launch the server. Note the port!]] | ||
<h1>Customizing the Server</h1> | <h1>Customizing the Server</h1> | ||
Now that you have an MWO server running, it's time to change it to better suit your needs. After all, it's literally just named <b> | Now that you have an MWO server running, it's time to change it to better suit your needs. After all, it's literally just named <b>An MWO Server</b> at this point: who wouldn't want to change that?! | ||
<h3>Server Config</h3> | <h3>Server Config</h3> | ||
Line 45: | Line 47: | ||
<h4>Ports</h4> | <h4>Ports</h4> | ||
A bit lower is the <code>gamePort</code> field: it defines the main network port of the server. If you plan on running more than one MWO server on your machine, consider changing it to keep it unique for every server instance. Set to 1551 by default, you may change it to any value you like. <i>(You WILL have to also change the <code>apiPort</code> field in the <code>webApi</code> section to a port higher by 1 than the game port in order to keep the server working properly!)</i> | A bit lower is the <code>gamePort</code> field: it defines the main network port of the server. If you plan on running more than one MWO server on your machine, consider changing it to keep it unique for every server instance. Set to 1551 by default, you may change it to any value you like. <i>(You WILL have to also change the <code>apiPort</code> field in the <code>webApi</code> section to a port higher by 1 than the game port in order to keep the server working properly!)</i> | ||
<h4>Using Radmin VPN to host without port forwarding</h4> | |||
If you for some reason can't (or don't want to) go through port forwarding to host your MWO server, consider using Radmin VPN to host it without having to do that: <b>[https://www.radmin-vpn.com/ Radmin VPN]</b> | |||
<br> | |||
In that case, players will have to join your Radmin network with the name & password you created in order to join your MWO server. Players will have to use the IP address shown next to your name in Radmin in the launcher. | |||
<h3>Making your server private</h3> | |||
You can lock your server behind a server-wide password. To enable it, set the <code>auth.enabled</code> field to <code>false</code> and the <code>multiplayer.passwordProtected</code> field to <code>true</code> in the server config, then head to [https://emn178.github.io/online-tools/sha256.html SHA256 Online] and generate a hash for your server password. Once you're done, copy&paste the password hash into the <code>multiplayer.serverPassword</code> field and restart the server. From that point onwards, anyone trying to join your server will be asked to provide the password you entered. <i>(NOTE: enabling a global server password will turn off accounts, and you will be able to join using any username at all!)</i> | |||
<h3>Becoming Admin</h3> | |||
<h4>Using admins.txt</h4> | |||
You can permanently grant yourself server-wide admin permissions by adding your name into the <code>admins.txt</code> file located in the server directory. Just add a new line into it containing your username. Example file: | |||
<syntaxhighlight lang="python" line> | |||
osdever | |||
ttwoti | |||
Zipper | |||
<your name here> | |||
</syntaxhighlight> | |||
You don't need to restart the server when changing admins.txt, however you do need to rejoin for your admin permissions to take effect. | |||
<h4>Using RCON</h4> | |||
You can temporarily grant yourself server-wide admin permissions via RCON. To enable it, set the <code>multiplayer.rconEnabled</code> field to <code>true</code> in the server config, then head to [https://emn178.github.io/online-tools/sha256.html SHA256 Online] and generate a hash for your RCON password. Once you're done, copy&paste the password hash into the <code>multiplayer.rconPassword</code> field and restart the server. Now, you can use the <code>/rclogin [password]</code> in-game command to gain admin access for the remainder of your session. | |||
<br> | |||
<b>Make sure to come up with a strong password and never tell it to anyone!</b> | |||
<h4>Using GPAuth</h4> | |||
Check [[GPAuth Summary]] for info regarding setting up GPAuth. | |||
<h3>Controlling the Anti-Cheat</h3> | |||
The anti-cheat system may interfere with mods you decide to install and overall limit the gameplay. In order to disable anti-cheat features, set the <code>verification.verifySyncPackets</code> and <code>verification.verifyVehicleAttributes</code> fields to <code>false</code> in the config. | |||
Respectively, you can set both values to <code>true</code> in order to enable anti-cheat (and possibly break all of your mods, since the anti-cheat database is built for Racing resources). | |||
<br> | |||
The anti-cheat is disabled by default so that people aren't confused about their server kicking them out whenever they change something. | |||
<h3>Installing Mods</h3> | |||
If you want to spice up the gameplay, feel free to install mods onto your server! All of your mods go into the <code>resources</code> folder in a specific manner: | |||
<ul> | |||
<li><b>Car model mods</b> go to <code>resources/game/CARS</code>.</li> | |||
<li><b>VLT modscripts</b> go to <code>resources/scripts</code>.</li> | |||
<li>In general, anything you put in <code>resources/game/</code> will override the vanilla game's file with the same path. Not all files can be overridded that way since some are loaded before MWO does its magic.</li> | |||
</ul> | |||
Do note that we currently don't support addons, and VLT scripts that are too complex may not work properly. | |||
<br> | |||
For a good start, consider downloading and unpacking the resources used on our official servers: | |||
<ul> | |||
<li><b>[https://content-api.plakmp.com/plak/content/clients/mwo-server-official-resources-normal.zip Career/Racing Server Resources (133MB)]</b> - The resources used on MWO Career and MWO Racing. Includes all addon car models.</li> | |||
<li>[https://content-api.plakmp.com/plak/content/clients/mwo-server-official-resources-insanity.zip AR-1 Server Resources (147MB)] - The resources used on AR-1. These will make your server hell, so have fun.</li> | |||
</ul> | |||
<h1>Controlling your Server</h1> | |||
All of the commands above are admin-only, so make sure to grant yourself the rights before trying them out. | |||
<h3>Punishments</h3> | |||
You can kick, ban or mute people using admin commands (provided you gave yourself admin access as mentioned above): | |||
<ul> | |||
<li><code>/kick [username] [reason]</code> - Disconnects a player. They can come back right away.</li> | |||
<li><code>/ban [username] [reason]</code> - Permanently bans a player. They can't come back until you unban them. The player doesn't need to be online, and the command also bans all of their alts.</li> | |||
<li><code>/unban [username]</code> - Unbans a previously banned player.</li> | |||
<li><code>/mute [username] [reason]</code> - Mutes a player from the chat. They can't write until you unmute them.</li> | |||
<li><code>/unmute [username]</code> - Unmutes a previously muted player.</li> | |||
</ul> | |||
<h3>Player Stuff</h3> | |||
You can perform various actions on players: | |||
<ul> | |||
<li><code>/broadcast <message in quotes></code> - Broadcasts a message to all online players.</li> | |||
<li><code>/alts [username]</code> - Shows a player's alt accounts.</li> | |||
<li><code>/tp [username] [target_username]</code> - Teleports the player <code>username</code> to player <code>target_username</code>.</li> | |||
<li><code>/tp [target_username]</code> - Teleports you to player <code>target_username</code>.</li> | |||
<li><code>/tpall [target_username]</code> - Teleports everybody to player <code>target_username</code>.</li> | |||
<li><code>/respawn [username] [vehicle] [mode]</code> - Respawns player <code>username</code>. Vehicles are specified by name of PVehicle node. Mode must be one of <code>default|override|clear</code>.</li> | |||
<li><code>/update-tuning [username] [property] [mode] [value]</code> - Updates current performance tuning for player <code>username</code>. | |||
<ul> | |||
<li><b>Properties:</b> <code>steering, handling, brakes, ride_height, aerodynamics, nos, induction</code></li> | |||
<li><b>Modes:</b> <code>set, add, sub, mul, div, =, +=, -=, *=, /=</code></li> | |||
</ul> | |||
</li> | |||
</ul> | |||
<h3>Developer Commands</h3> | |||
You can use these commands to control some inner workings of the server: | |||
<ul> | |||
<li><code>/reload-resources</code> - Reloads all server-side mods and scripts.</li> | |||
<li><code>/reload-restrictions</code> - Reloads all server-side restriction configs.</li> | |||
</ul> | |||
<h3>World Commands</h3> | |||
You can use these commands to control the game world: | |||
<ul> | |||
<li><code>/settime <hours> [minutes]</code> - Sets the world time to the specified value.</li> | |||
<li><code>/tcset <timecycle-name> [transition-time]</code> - Sets the world timecycle to the specified timecycle within the specified transition time (instantly by default).</li> | |||
<li><code>/tclist</code> - Lists all available timecycles.</li> | |||
</ul> | |||
<h1>Conclusion</h1> | |||
By the end of this article, you've learned how to set up a working MWO server for you and your friends to play on. Congratulations! To further customize your server, look into the [[Server Configuration Summary]] and try changing some of the values you see there. | |||
<h1>See also</h1> | |||
<ul> | |||
<li>[[Server Configuration Summary]]</li> | |||
</ul> | |||
<br> | |||
<i>The developers of Most Wanted Online are not required to provide you with any support and/or consultation regarding any servers you host. The MWO server software is provided AS IS with no warranties.</i> |
Latest revision as of 19:20, 5 September 2024
If you're tired of our official servers, you're always free to host your own server and add any content you desire (as long as our server supports it, of course). This article will guide you through the steps you need to take in order to create and host your own MWO server for you and your friends to play on.
Prerequisites
- A PC running Windows
- A router capable of port forwarding to make sure other people can access your server
- A basic understanding of JSON configs
Downloading the Server
- Windows (x86)
- Windows (x64)
- NOTE: if you're downloading the server package to UPDATE your server due to a new version coming out, you don't need to unpack everything: in most cases dragging & dropping
mwo-server
and all DLL files into your existing server directory is enough.
Once you've downloaded the server archive, unpack it somewhere and move on to the Running the Server section.
Running the Server
-
You can double-click the mwo-server executable to do the trick or run it through the console using
./mwo-server
in the server directory. -
You can pass
--config-path=[YOUR CONFIG FILE PATH]
and/or--log-path=[YOUR LOG FILE PATH]
as command-line arguments to mwo-server in order to make the server use different config and/or log files.
Once you've launched the server, you should see its console logs in their entirety. In a freshly launched server, the latest line of the logs will include your server's port. You must FORWARD THAT PORT AND that port + 1 if you want your server to accept non-local connections. (In simpler words: if you see 1551, forward 1551 AND 1552!)
NOTE: You must forward the ports for BOTH TCP AND UDP in order for the sync to work properly.
At this point, you should be able to join the server via adding 127.0.0.1
in the MWO Launcher, using your account from official MWO servers. Check out the Customizing the Server section to learn how to change your server's name, ports, settings, timecycles, accounts, mods and much more!
Customizing the Server
Now that you have an MWO server running, it's time to change it to better suit your needs. After all, it's literally just named An MWO Server at this point: who wouldn't want to change that?!
Server Config
In order to change your server's settings, you should look no further than the core-server.json
file. It contains all of the customization settings that you can (and probably should) change. (Look into the Server Configuration Summary for a near-complete explanation of the file's contents)
The server config file is written in JSON, and the server executable will expect it to be valid JSON. The rest of this article assumes you're at least somewhat acquainted with JSON: if not, you really should learn more about it!
Changing the server's Name, Description and Port
Name & Description
Right at the top of the config file are the serverName
and serverDescription
fields. You may change them to anything you like: the changes to the config file will only take effect once you restart the server though, so keep that in mind.
Ports
A bit lower is the gamePort
field: it defines the main network port of the server. If you plan on running more than one MWO server on your machine, consider changing it to keep it unique for every server instance. Set to 1551 by default, you may change it to any value you like. (You WILL have to also change the apiPort
field in the webApi
section to a port higher by 1 than the game port in order to keep the server working properly!)
Using Radmin VPN to host without port forwarding
If you for some reason can't (or don't want to) go through port forwarding to host your MWO server, consider using Radmin VPN to host it without having to do that: Radmin VPN
In that case, players will have to join your Radmin network with the name & password you created in order to join your MWO server. Players will have to use the IP address shown next to your name in Radmin in the launcher.
Making your server private
You can lock your server behind a server-wide password. To enable it, set the auth.enabled
field to false
and the multiplayer.passwordProtected
field to true
in the server config, then head to SHA256 Online and generate a hash for your server password. Once you're done, copy&paste the password hash into the multiplayer.serverPassword
field and restart the server. From that point onwards, anyone trying to join your server will be asked to provide the password you entered. (NOTE: enabling a global server password will turn off accounts, and you will be able to join using any username at all!)
Becoming Admin
Using admins.txt
You can permanently grant yourself server-wide admin permissions by adding your name into the admins.txt
file located in the server directory. Just add a new line into it containing your username. Example file:
osdever
ttwoti
Zipper
<your name here>
You don't need to restart the server when changing admins.txt, however you do need to rejoin for your admin permissions to take effect.
Using RCON
You can temporarily grant yourself server-wide admin permissions via RCON. To enable it, set the multiplayer.rconEnabled
field to true
in the server config, then head to SHA256 Online and generate a hash for your RCON password. Once you're done, copy&paste the password hash into the multiplayer.rconPassword
field and restart the server. Now, you can use the /rclogin [password]
in-game command to gain admin access for the remainder of your session.
Make sure to come up with a strong password and never tell it to anyone!
Using GPAuth
Check GPAuth Summary for info regarding setting up GPAuth.
Controlling the Anti-Cheat
The anti-cheat system may interfere with mods you decide to install and overall limit the gameplay. In order to disable anti-cheat features, set the verification.verifySyncPackets
and verification.verifyVehicleAttributes
fields to false
in the config.
Respectively, you can set both values to true
in order to enable anti-cheat (and possibly break all of your mods, since the anti-cheat database is built for Racing resources).
The anti-cheat is disabled by default so that people aren't confused about their server kicking them out whenever they change something.
Installing Mods
If you want to spice up the gameplay, feel free to install mods onto your server! All of your mods go into the resources
folder in a specific manner:
- Car model mods go to
resources/game/CARS
. - VLT modscripts go to
resources/scripts
. - In general, anything you put in
resources/game/
will override the vanilla game's file with the same path. Not all files can be overridded that way since some are loaded before MWO does its magic.
Do note that we currently don't support addons, and VLT scripts that are too complex may not work properly.
For a good start, consider downloading and unpacking the resources used on our official servers:
- Career/Racing Server Resources (133MB) - The resources used on MWO Career and MWO Racing. Includes all addon car models.
- AR-1 Server Resources (147MB) - The resources used on AR-1. These will make your server hell, so have fun.
Controlling your Server
All of the commands above are admin-only, so make sure to grant yourself the rights before trying them out.
Punishments
You can kick, ban or mute people using admin commands (provided you gave yourself admin access as mentioned above):
/kick [username] [reason]
- Disconnects a player. They can come back right away./ban [username] [reason]
- Permanently bans a player. They can't come back until you unban them. The player doesn't need to be online, and the command also bans all of their alts./unban [username]
- Unbans a previously banned player./mute [username] [reason]
- Mutes a player from the chat. They can't write until you unmute them./unmute [username]
- Unmutes a previously muted player.
Player Stuff
You can perform various actions on players:
/broadcast <message in quotes>
- Broadcasts a message to all online players./alts [username]
- Shows a player's alt accounts./tp [username] [target_username]
- Teleports the playerusername
to playertarget_username
./tp [target_username]
- Teleports you to playertarget_username
./tpall [target_username]
- Teleports everybody to playertarget_username
./respawn [username] [vehicle] [mode]
- Respawns playerusername
. Vehicles are specified by name of PVehicle node. Mode must be one ofdefault|override|clear
./update-tuning [username] [property] [mode] [value]
- Updates current performance tuning for playerusername
.- Properties:
steering, handling, brakes, ride_height, aerodynamics, nos, induction
- Modes:
set, add, sub, mul, div, =, +=, -=, *=, /=
- Properties:
Developer Commands
You can use these commands to control some inner workings of the server:
/reload-resources
- Reloads all server-side mods and scripts./reload-restrictions
- Reloads all server-side restriction configs.
World Commands
You can use these commands to control the game world:
/settime <hours> [minutes]
- Sets the world time to the specified value./tcset <timecycle-name> [transition-time]
- Sets the world timecycle to the specified timecycle within the specified transition time (instantly by default)./tclist
- Lists all available timecycles.
Conclusion
By the end of this article, you've learned how to set up a working MWO server for you and your friends to play on. Congratulations! To further customize your server, look into the Server Configuration Summary and try changing some of the values you see there.
See also
The developers of Most Wanted Online are not required to provide you with any support and/or consultation regarding any servers you host. The MWO server software is provided AS IS with no warranties.