Old Dedicated Server Guide
From PromodeWiki
Cleaned up a bit and formatted, --shaun 16:57, 19 Jun 2005 (CDT)
The only way to play
If you are going to run a server you may as well do it right; so here I'll explain how to start a dedicated server for both linux and Win32.
The main ingredient for a dedicated server is the server configuration file, as the name suggests, this file is used to set the server up. It is a plain text file which includes the variables you wish to set for your server, any necessary variables you leave out will use their default values. Here is a link to a sample config, feel free to use this as a starting point for your own cfgs. For more information on server variables read here.
Well it's about time we actually start this server. I'll break this section into two parts, one for win32 the other for linux. Now if you are just setting up a server for a few games against mates or a local tournament, it really doesn't matter if you use windows or linux. If you are setting up a permanent/semi-perminant internet server though, I'd strongly suggest you use linux; more on this later.
Win32
First step is to copy your server.cfg file into your cpma dir. Then we just make a batch file to start up the server; a batch file is a text file with a .bat extension (eg cpma-svr.bat). Here is a sample batch file you would put in your cpma dir too.
To start the server, just double click on the batch file. You may want to create a shortcut on your desktop.
Linux
As with Win32, copy your server.cfg file into your cpma dir. Now I'm assuming your in the console and have vim installed:
go to your own bin dir
- cd ~/bin/
Create a script to start up ded svr
- vim cpma-1.svr
- i
- /usr/local/games/quake3/q3ded +set sv_pure 1 +set vm_game 2 +set vm_cgame 2 +set vm_ui 2 +set net_ip XXX.XXX.XXX.XXX +set dedicated 2 +set fs_game cpma +set com_hunkmegs 32 +exec server.cfg
- Esc
- :wq
Now make it executable
- chmod +x cpma-1.svr
- Notes on above
- dedicated 2 makes an internet server, use dedicated 1 for a LAN server. XXX.XXX.XXX.XXX should be replaced with YOUR IP address, your machine may be setup so that this variable (net_ip) is unnecessary. Make sure the path at the beginning reflects where YOU have Quake3 installed. I have been generous with com_hunkmegs, you can use a smaller value 12, 16, 24, but note that now we have multiarena maps which take up alot more memory, if you start getting memory errors with MA's, it might be due to this. Make sure you replace server.cfg with the name of you server configuration file.
Before I go onto starting the server, I'll explain the pimpin' for linux earlier. It was because of linux's brilliant remote administration. You can login from where-ever and administer the server as if you were at your box. Change the game settings, stop and restart servers, change your cfg files, download new maps, download new version of cpma, reboot machine.
The specific programms you will want running on your linux box to accomplish this are: ssh demon, screen, maybe ftp demon. More on them at another time.
Though we will use screen to "hold" our servers. Before we start the server make sure ALL files and dirs under your quake3 dir are lower case. Use this script to convert a directory's files from upper to lower case.
Go to a console, type
- screen
now type the name of the script we made earlier
- cpma-1.svr
your server will now start in the screen, by entering quake/cpma commands the server will change accordingly (NB some changes require a map restart).
The great thing about using screen is that we can now disconnect from screen (Ctrl+a, d) even logout from linux and our server will continue to operate in the background. To reconnect to the screen, get back on your linux box either locally or remotley using ssh. Then type:
- screen -r
this will (r)econnect you to your running screen session.
Well enough adminning, get on and have a game.
Have fun
Wednesday, 28 March 2001 by ki11ingtime