Dedicated server

From SRB2 Wiki
Jump to: navigation, search

A dedicated server is a netgame server in which the host is not a player in the game. Instead, the host monitors the game from a terminal window, such as the Win32 console in Windows. The terminal window acts like the in-game console would normally, logging game events and allowing the host to execute console commands and set console variables. The host and other players can join the server normally. Dedicated servers are useful for hosting a server without having to be present in the game. This allows the host to leave the server running for other players while doing other things on their computer. Since the game window itself doesn't need to be displayed, dedicated servers also take up less CPU power than the regular game.

Hosting a dedicated server

To host a dedicated server, you must launch the game with the command line parameter -dedicated. To host on the Master Server, you also need to specify a room with the parameter -room ID. The room ID should be 33 for the Standard room and 28 for the Casual room.

If a console script file with the name adedserv.cfg exists in your SRB2 folder, it will automatically be loaded and executed upon starting a dedicated server. This allows you to specify game settings that you want to apply only when you're hosting a dedicated server.

Joining your own dedicated server

In order to join your own dedicated server as a player, you must run SRB2 on a different UDP port than the one used by your server. By default, SRB2 uses port 5029, so a good port to use is 5030. Run SRB2 with the -clientport 5030 (or any other unused port) and -connect [your local IP] parameters. In SRB2 v2.0 and older, you could use -connect 127.0.0.1 to connect to your own dedicated server. This is no longer possible in v2.1, so you will have to use your local IP address instead. See below for instructions on finding out your local IP address.

Alternatively, you can download Shardvexz's Dedicated Server Tools from here, which will make hosting and joining your own dedicated server easier. Put these files in your SRB2 folder and execute them to automatically start or join your own dedicated server.

Note that you will join your server as a normal client without host privileges. To perform administrative actions, you must give yourself administrative privileges by verifying yourself or logging in with a password. Only the host can verify players or set the password, so you will need to do this from the dedicated server terminal window. Likewise, some console variables, such as allowjoin or blamecfail, can only be set by the host, so you must set them through the terminal window as well.

What is my local IP?

To join your own dedicated server, you must connect to your local IP. Here are step-by-step instructions on how to obtain your local IP address on Windows:

  1. Open the Windows Command Prompt. In Windows 10, you can do this by right-clicking on the Start menu button and selecting "Command Prompt" from the context menu. In older Windows versions, open the Start menu and type in cmd in the search bar. The Command Prompt application should appear.
  2. Type ipconfig into the Command Prompt.
  3. You will see a list of various information related to your network connection. Your local IP is listed under "IPv4 Address".