Call of Duty 4
Dedicated Linux Server Setup Guide
Dedicated Linux Server Setup Guide
General Info
§ I created this guide
using Centos 6 64 bit (Fedora,Centos,RedHat Should
all work, other distos with minor changes in
dependency install should also work)
§ Unless you really
understand SELinux is should be disabled to prevent
issues with the game server and Punkbuster
§ In this guide
replace <newuser> with the
user name you want to run cod4 as
§ You don't want to run
the server as root, so let's create a new user
useradd -d /home/<newuser>
-s /bin/bash <newuser>
§ Set a new password
for your user
passwd <newuser>
§ log out as root and
login as your new user
§ create a new
directory for your game server /home/<newuser>/cod4
§ Just type in 'su -' and your root password to elevate to root for
installs etc.
§ The above commands
create a new user with a home directory of /home/<newuser>.
Running the game as a non privileged user from the users home directory will help keep your server secure.
yum -y install glibc.i686 libgcc.i686 libstdc++.i686
zlib.i686 screen.x86_64
Get the files
Linux Server Files
§ Get the COD4 linux server files from the link below
COD4 Game files
§ These files should
already be on your computer. You'll want to copy over everything in the
"Call of Duty 4" directory to your /home/<newuser>/cod4
directory
§ Make sure your new
user owns the cod4-linux-server directory and recursively all sub folders and
files.
chown <newuser>:<newuser> /home/<newuser>/
-R
§ You can use 7zip to
compress the game directory and then decompress after copy if you like
§ The server file
cod4_lnxded must be in the same directory as the localization.txt file
PunkBuster
§ You need to download
the 32 bit punkbuster files from evenbalance.com. I
could not get the 64bit ones to work on Centos6.
§ View the UELA
agreement
./pbsetup.run -e
§ If you agree to Y.
Make sure you get confirmation that the game was added and not an error here.
./pbsetup.run -ag cod4 -ap /home/<newuser>/cod4/
§ Update the punkbuster files
./pbsetup.run -u
Test Launch the
Server
§ If you have errors
with /lib/ld-linux or with libgcc
libraries see the comments at the start of this guide and make sure you ran the
command to install dependencies
§ run the command
./cod4_lnxded +set dedicated 2 +set sv_punkbuster
1
§ You should see the server
start up. You can quite the server now, we just want to know that it loads at
this point.
§ Confirm that you see punkbuster load up
§ Quit the server
quit
Setup Server
Configuration
§ Create a server
configuration file
vim /home/<newuser>/cod4/main/mp-server.cfg
§ Copy and paste this
data into the file, modify it to your server needs
set scr_hardcore
1
set sv_hostname
"<servername>"
set _Admin "<adminname>"
set g_logsync
"2" // 0=no log, 1=buffered, 2=continuous, 3=append
set logfile
"1" // 0 = NO log, 1 = log file enabled
set g_log
"games_mp.log" // Name of log file, default is games_mp.log
set sv_log_damage
"1"
// Network options
set net_ip
"<serverip>" //our servers IP address
set net_port
"28960" // Set your port number
sv_connectTimeout 90 // [0-n] (seconds)
sv_timeout 240 // [0-n] (seconds)
// Server Network Mode
set dedicated "2" // 0 = Listen,
1 = LAN, 2 = Internet
// Password Settings
set rcon_password
"<rconpass>" // RCON must supply pw to use
set sv_privatePassword
"" // Private slots, non-public slots
// Ping
set sv_minPing
"0" // MIN player ping on CONNECT, any lower and player isnt allowed to connect
set sv_maxping
"300" // MAX player ping on CONNECT, any higher and player isnt allowed to connect
// Rate
set sv_maxRate
"25000"
// Drop inactive players
set sv_timeout
"300"
set sv_zombietime
"1"
set g_inactivity
"0"
set g_inactivityspectator
"0"
// AntiFlooding Settings
set sv_floodProtect
"1"
set sv_reconnectlimit
"3"
// Anti Cheat Settings
set sv_disableClientConsole
"0"
set cl_autocmd
"0"
set sv_cheats
"0"
set sv_pure
"1"
//set g_banIPs
""
//set g_no_script_spam
"1"
// Temporary Ban duration, in seconds
set sv_kickBanTime
"1"
// In-game voice communication system
set sv_voice
"0"
set sv_voiceQuality
"7"
set voice_deadChat
"0"
set voice_global
"0"
set voice_localEcho
"0"
set winvoice_mic_mute
"1"
//Free for all deatmatch
//-----------------------
scr_dm_scorelimit 2500 //[0-n]
scr_dm_timelimit 15 //[0-n] (minutes)
set scr_dm_waverespawndelay
0
set scr_dm_playerrespawndelay
1
//domination
//-----------
scr_dom_scorelimit 2500 //[0-n]
scr_dom_timelimit 15 //[0-n] (minutes)
//team deathmatch
//-----------------
scr_war_scorelimit 2500 // [0-n]
scr_war_timelimit 15 //[0-n] (minutes)
set scr_war_waverespawndelay
0
set scr_war_playerrespawndelay
1
//sabotage
//---------
scr_sab_scorelimit 8 // [1-n] (points)
scr_sab_timelimit 5 //[0-n] (minutes)
scr_sab_roundswitch 1 // [0-n] (after how many rounds)
scr_sab_bombtimer 40 // [0-n] (seconds)
scr_sab_planttime 10 // [0-n] (seconds)
scr_sab_defusetime 10 //[0-n] (seconds)
scr_sab_hotpotato 1 // [0-1] (shared bomb timer)
//search and destroy
//-------------------
scr_sd_scorelimit 7 // [1-n] (points)
scr_sd_timelimit 4 //[0-n] (minutes)
scr_sd_roundswitch 5 // [0-n] (number of rounds before
switching teams)
scr_sd_bombtimer 30 // [0-n] (seconds)
scr_sd_planttime 5 //[0-n] (seconds)
scr_sd_defusetime 5 //[0-n] (seconds)
scr_sd_multibomb 1 //[0-1]
//headquarters
//-------------
scr_koth_scorelimit 2500
scr_koth_timelimit 5
koth_autodestroytime 90 //[0-n] (seconds)
koth_kothmode 1 //[0-1] (classic mode, non-classic)
koth_spawntime 10 //[0-n] (seconds, hq spawn time)
// Team Settings
set scr_teambalance
"1"
set scr_team_respawntime
"0"
set scr_team_fftype 1//[0-3] (Disabled, Enabled, Reflect,
Shared)
set g_deadChat
set g_allowvote
1
//execute additional config
files
exec maprotation.cfg
§ Create your map
rotation config file
vim /home/<newuser>/cod4/main/maprotation.cfg
§ Add the following to the
file and save it
set sv_mapRotation
"gametype sd map mp_broadcast gametype sd map mp_creek gametype sab map mp_backlot
gametype sd map mp_bloc gametype sd map mp_bog gametype
dm map mp_citystreets gametype sd map mp_convoy
gametype sd map mp_countdown gametype sd map mp_crash gametype sab map mp_crossfire gametype sd map mp_farm
gametype sd map mp_overgrown gametype sab map mp_pipeline gametype sd map mp_showdown gametype sd map mp_strike"
Firewalls and
Ports
§ Allow the following
ports in iptables
20800 UDP
20810 UDP
28960 UDP (or whatever port your server is on if
you changed from the default 28960)
§ To allow these ports
in add the following lines to your /etc/sysconfig/iptables file
§ You must add them
before the 'reject all' rule
-A INPUT -m state --state
NEW -m udp -p udp --dport 20800 -j ACCEPT
-A INPUT -m state --state
NEW -m udp -p udp --dport 20810 -j ACCEPT
-A INPUT -m state --state
NEW -m udp -p udp --dport 28960 -j ACCEPT
§ You will need to
forward the ports through your firewall to your linux
server if your server does not have a publicly routable IP address.
§ The rule should flow
like this
from any source IP with source port of
28960 to your gameserver IP with a desination port of 28960.
§ Make the rule for
each port number, your firewalls manual should offer insight on how to do this
./cod4_lnxded +set dedicated 2 +set sv_punkbuster
1 +exec mp-server.cfg
§ This should bring
your server up
§ If you can't see or
connect to your server there is an issue with your iptables
or forwarding the ports into your server. If correctly configured your server
will show and you can connect to it.
0 comments:
Post a Comment