A guide on howto start your own Call of Duty 2 server for LAN or Internet gaming.
here we will show you howto start your own Call of Duty 2 Server if you are using Linux for your server [url=][this][/url] may help you for installation instructions, otherwise this tutorial will be very simple with examples all the way through. make sure you have your CoD2 Uploaded to your server (or on your local machnie for a LAN server), if uploading to a server this can be done with FTP / S-FTP (FTP over Secure Shell) or similar. once you have the files installed, we move on to configuring the server -->
<!--pagebreak-->
1. Writing your server Config's server.cfg
| Code: |
| // Wolfstuff : Call of Duty 2 : server.cfg // // Anything with "//" before it is a comment, it is not parsed by the server // // -------------------------------- // // server settings (very important) // // -------------------------------- // //Network Options set net_ip "xxx.xxx.xxx.xxx" set net_port "28960" set sv_disableClientConsole "0" //Master Server List set sv_master1 "cod2master.activision.com" set sv_master2 "master.gamespy.com:28960" set sv_master3 "master0.gamespy.com" set sv_master4 "clanservers.net" set sv_master5 "cod2authorize.activision.com" set sv_master6 "codmaster.activision.com" set sv_master7 "coduomaster.activision.com" set sv_master8 "master0.gamespy.com" set sv_master9 "master1.gamespy.com" set sv_master10 "master.gamespy.com:28960" set sv_master11 "coduoauthorize.activision.com" set sv_master12 "master0.gamespy.com" set sv_master13 "clanservers.net" set sv_master14 "codmaster.infinityward.com" set sv_master15 "codauthorize.activision.com" set sv_gamespy "1" sets _Website "http://www.wolfstuff.org" sets _Location "United Kingdom" set sv_hostname "^2# ^3Plus^6Net ^1CoD2" // name of the game server set scr_motd "" // motd broke in 1.0 set sv_privateClients "2" // reserved player count set sv_maxclients "24" set rcon_password "" // rcon password set sv_privatePassword "" // use this to password private slots (sv_privateClients must be set) set g_password "" // set this to password your game server sets g_needpass "0" // tell ASE (and others) if the server has a password enabled sets _Admin "MrAdmin" // admins name or nickname (optional) sets _Email "123@xyz.biz" // admins email address (optional) sets _URL "http://www.yoursite.com" // website address (optional) sets _HOST "Host" // be proud! (optional) sets _HOSTURL "www.host.net" // be proud! (optional) // ----------------------------------- // // match settings (fairly important) // // ----------------------------------- // set g_allowvote "0" // voting set scr_drawfriend "1" // draw team icons set scr_friendlyfire "0" // enable or disable friendly fire set scr_teambalance "1" // auto team balance set scr_killcam "1" // show the user how they were killed (useful for spotting cheaters) set scr_spectatefree "0" // free look set scr_spectateenemy "0" // spectate enemy set scr_forcerespawn "1" // force dead players to respawn // ----------------------------------- // // general settings (not so important) // // ----------------------------------- // set sv_pure "1" // pure file checking set sv_cheats "0" // enable / disable cheats set sv_minPing "0" set sv_maxPing "0" // max ping limit set sv_allowedClan1 "" // not sure what this does yet set sv_allowedClan2 "" // not sure what this does yet set sv_disableClientConsole "0" // disable clients console set sv_reconnectlimit "3" // limit how long a player must wait to reconnect seta sv_allowAnonymous "0" set sv_allowdownload "1" // enable downloading set sv_maxRate "25000" // max server rate 1kbs = 1000, 10kbs = 10000... set g_banIPs "" set sv_floodProtect "1" // flood protection set sv_voice "0" set sv_voiceQuality "1" set g_log "games_mp.log" // change to 'games_mp.log' to enable logging set g_logsync "1" // --------------- // // weapon settings // // --------------- // // weapon ammo pools set g_weaponAmmoPools "0" // snipers set scr_allow_enfieldsniper "1" set scr_allow_kar98ksniper "1" set scr_allow_nagantsniper "1" set scr_allow_springfield "1" set scr_allow_svt40 "1" // rifles set scr_allow_enfield "1" set scr_allow_kar98k "1" set scr_allow_m1carbine "1" set scr_allow_m1garand "1" set scr_allow_nagant "1" set scr_allow_g43 "1" // machine guns set scr_allow_bar "1" set scr_allow_bren "1" set scr_allow_mp44 "1" set scr_allow_ppsh "1" // sub-machine guns set scr_allow_sten "1" set scr_allow_mp40 "1" set scr_allow_thompson "1" set scr_allow_pps42 "1" set scr_allow_greasegun "1" // shotgun set scr_allow_shotgun "1" // grenades set scr_allow_smokegrenades "1" set scr_allow_fraggrenades "1" // ------------------ // // game type settings // // ------------------ // // S&D set scr_sd_scorelimit "7" set scr_sd_timelimit "350" set scr_sd_roundlimit "11" set scr_sd_roundlength "10" set scr_sd_graceperiod "10" // HQ set scr_hqt_scorelimit "600" set scr_hqt_timelimit "600" // SW set scr_sw_scorelimit "7" set scr_sw_timelimit "350" set scr_sw_roundlimit "11" set scr_sw_roundlength "10" set scr_sw_graceperiod "10" // TDM set scr_tdm_scorelimit "200" set scr_tdm_timelimit "600" // DM set scr_dm_scorelimit "150" set scr_dm_timelimit "600" // CTF set scr_ctf_scorelimit "5" set scr_ctf_timelimit "400" // ------------------ // // set gameype to run // // ------------------ // set g_gametype "tdm" // TDM = Team Death Match, DM = Death Match, CFT = Capture the Flag, HQ = Head Quarters, SD = Search and Destroy // ------------ // // map rotation // // ------------ // set sv_mapRotation "gametype hq map mp_breakout gametype hq map mp_brecourt gametype hq map mp_burgundy gametype hq map mp_carentan gametype hq map mp_dawnville gametype hq map mp_decoy gametype hq map mp_downtown gametype hq map mp_farmhouse gametype hq map mp_leningrad gametype hq map mp_matmata gametype hq map mp_railyard gametype hq map mp_toujane gametype hq map mp_trainstation" //make sure you specify the gametype before every map change you insert. set sv_maprotationcurrent "" map_rotate // this must be at the bottom of your config |
now all we need is our punkbuser config to finish the game world settings off punkbuster.cfg
| Code: |
//PunkBuster Server config
//Thanks to those on the SplashDamage forums for their contribution.
//Compiled by Erik Melen (Deveus) and Paul Goldilla (loony)
//Enable Punkbuster pb_sv_enable pb_sv_update
//Bad Names list
//Place any names that you feel players should not use on your server in here.
//To add more bad name entries, simply follow the format shown below. pb_sv_badname 30 Nazi pb_sv_badname 30 Hitler pb_sv_badname 30 Unknown
//CVARs for the PB server to check. Place checks to keep players from abusing CVARs. pb_sv_cvarempty
//pb_sv_cvar rate in 2500 25000
//pb_sv_cvar snaps in 20 40
//pb_sv_cvar cl_maxpackets in 30 100
//pb_sv_cvar cg_bobup in 0 0.005
//pb_sv_cvar r_picmip in 0 3
//pb_sv_cvar r_overbrightbits in 0 4
//pb_sv_cvar r_mapoverbrightbits in 0 4
//pb_sv_cvar cg_shadows in 0 1
//pb_sv_cvar r_rmse in 0 0
//pb_sv_cvar cg_fov in 65 80
//pb_sv_cvar r_allowextensions in 1
//pb_sv_cvar r_softwareGL in 0
//pb_sv_scorekick -6 //player gets kicked for having score below zero pb_sv_CQC 1
//Client Query Capability (i.e. can they query the server cvars)
pb_sv_MsgPrefix "My PB Server"
pb_sv_KickLen 5
pb_sv_LogSync 0
pb_sv_LogCeiling 1000
pb_sv_Sleep 100
pb_sv_PowerMin 10
pb_sv_PowerDef 1
pb_sv_PowerKickLen 5
pb_sv_httpAddr (Server IP eg: 212.159.6.230)
//enter Webtool address here pb_sv_httpPort (Port for Web Pannel eg: 28970)
//enter Webtool port here
pb_sv_httpRefresh 60
pb_sv_httpKey "webadminpassword"
// pb_sv_httpmaps mapname mapname mapname
//for the Web Tool map pull down menu
pb_sv_extChar 1
pb_sv_minName 3
pb_sv_dupNameGrace 30 //Prevents name stealing on the server.
pb_sv_changePeriod 10
pb_sv_changeMax 5 //Number of name changes before kicking a player.
pb_sv_emptyname 0 |
I'm sure you can edit these to your own needs for your server. make sure you put these in the same folder as your cod2 installation AND in the 'main' folder to be sure it will work. i'm assuming you know where you have installed CoD2. Linux:[b] ../server.cfg & ../punkbuster.cfg & ../main/server.cfg & ../main/punkbuster.cfg [b]windows: ..server.cfg & ..punkbuster.cfg & ..mainserver.cfg & ..mainpunkbuster.cfg next we'll look at starting your server -->
<!--pagebreak-->
2. Starting your Server Windows if you are using Windows, all you have todo is this
1. Right click on your CoD2MP_s.exe (in your CoD2 folder)
2. Click "Create Shortcut"
3. Right click on "Shortcut to CoD2MP_s.exe"
4. Click "Properties"
5. In the "Target" field after the "Drive:Path oCoD2CoD2MP_s.exe" marks put this - '+set dedicated 2 +set net_IP (Server IP) +exec server.cfg +exec punkbuster.cfg &' giving you something like this in the Target field: "E:Call of Duty 2CoD2MP_s.exe" +set dedicated 2 +set net_IP (Server IP) +exec server.cfg +exec punkbuster.cfg &
6. Click Apply and close the box
7. Rename the shortcut "Shortcut to CoD2MP_s.exe" to soemthing like "CoD2 Server Start [Internet]"
This will start an Internet Server, then to start your Windows Server, double click on the Shortcut and you should find a Dedicated Server Box appear after the loading screen.
That is the "Master Console" and walla one Windows CoD2 Server. To change this to a LAN Server all we change is the '+set dedicated' to 1 you can make another shortcut and have as many servers as your Server / PC can handel.
Linux 'Keep-Alive' Startup now, this is just a recommendation, you can choose to have just one script or you can have this set of scripts that should keep your server alive even if it crashes. we are going to write 3 files: 'codgo' 'start.sh' 'runcod.sh' these will all go in the 'root' folder of your cod2 installation '/path/to/cod2/'
codgo
| Code: |
| screen -dmS (Username) ./path/to/cod2/runcod.sh |
start.sh
| Code: |
| ./cod2_lnxded +set dedicated 2 +set net_IP (Server IP) +exec server.cfg +exec punkbuster.cfg & |
This is exactly the same as the Windows Shortcut as shown above, now, as the executable is pretty much the same you can change it between LAN & Internet.
runcod.sh
| Code: |
|
#!/bin/sh
while true do
N=`ps -ef | grep cod2_lnxded | grep (Server IP) | grep -v grep | wc -l`
if [ $N -eq 0 ] then
/path/to/cod2/start.sh
fi
sleep 60
done
|
this shell script will ensure the Call of Duty Server Process is still running every minute it will check this (sleep 60) you can change it to be quicker if you choose. now chmod all these files to 755 so they are in full permission and can be read and written to. user@localhost] chmod 755 *.sh user@localhost] chmod 755 codgo Then to start your server: user@localhost] ./codgo check the process is started with: user@localhost] ps -U (Username) should see a process "Screen"... Try connecting to your server and all should work if you have followed this correctly
Manual Startup (Linux) if you don't want your server to restart if the cod2 server process dies, you can just have one starting script like so: start.sh
| Code: |
cd /path/to/cod2/
screen -dmS (Username) ./cod2_lnxded +set dedicated 2 +set net_IP (Server IP) +exec server.cfg +exec punkbuster.cfg & |
Stopping and Restarting a Linux CoD2 Server
Type in your console:
user@localhost] ps -U (Username)
what you need to look for is the process 'Screen' we need the PID or Process ID of this process (shown to the very left) eg: 23834 with a process 'runcod.sh' if you are using the keep-alive scripted technique
user@localhost] kill (pid, eg 23834)
make sure the process is dead, and optionally kill the 'keep-alive' scripts PID
user@localhost] ps -U (Username)
Tthen assuming all is well, we restart the server...
user@localhost] ./codgo or user@localhost] ./start.sh
this particularly useful when changing configs and getting bugs out of your configs. Move on to see how to debug errors -->
<!--pagebreak-->
3. Debuging issues with Configs
If you have problems with a config try this...
user@localhost] cd /path/to/cod2 user@localhost] ./cod2_lnxded +set dedicated 2 +set net_IP (Server IP) +exec server.cfg +exec punkbuster.cfg &
if there are any errors they should be echoed in the terminal or SSH Box, enabeling you to see your errors or server problems.
<!--pagebreak-->
4. Remote Console (RCon) "Game World" Administration RCon is a remote console, it is used to change game settings for example changing a server from public to private for a clanwar. here are some commands to help you out:
| Code: |
/rcon login = Type this carefully!
/rconpassword = Stores RCon Password not commanly used
/rconaddress = Don't need to be in the server to Admin it, or if you are in a game and can't be bothered to connect to another Once Logged in< /rcon serverinfo Shows the current server's settings.
/rcon systeminfo Shows the current System Information.
/rcon status Displays info of all the players on the server.
/rcon exec [FILENAME] Executes a Server Config File
/rcon writeconfig [FILENAME] Saves a Server Config File
/rcon say Post a console message to all players. Map Commands<
/rcon map mapname Loads the map specified by mapname.
/rcon map_rotate Loads next map in rotation set in sv_maprotation.
/rcon map_restart Reloads the map.
/rcon fast_restart Restarts the map. Kick/Ban Commands<
/rcon kick Kicks a player by name from the server.
/rcon kick all Kicks all players from the server.
/rcon onlykick Kicks a player by name from the server.
/rcon onlykick all Kicks all players from the server.
/rcon clientkick Kicks a player by client id from the server.
/rcon banUser Bans a user by their ingame name. Writes their GUID to ban.txt
/rcon banClient Bans a user by their client number. Writes their GUID to ban.txt
/rcon tempBanUser Kicks and temporarily bans player by name from server.
/rcon tempBanClient Kicks and temporarily bans player by client id from server
/rcon unbanuser Unban every player banned with [name].
If you want to unban a single player whose name appears more than once, you should edit "ban.txt" manually. |
Loging in with RCon /rcon login (Password) should work, if not /rcon (Password) action you can kick, ban and mute players who are abusing your rules.
Changing maps is not too difficult also you can change settings in your config with RCon, example: /rcon set g_password "warisgreat" /rcon set g_needpass "1" this would set the password for the game to "warisgreat" and force the user to put that password in to connect to the server. you can quickly disable it and leave the password in the variable g_password /rcon set g_needpass "0" means no need for a password, then at a later date if you wnated another war you would just type /rcon set g_needpass "1" <!--pagebreak-->well that concludes my contents for now follow what i have said and not much should go wrong
Happy Fragging! Tutorial by =W=J4M32=[/color], Linux administration tips and tricks by =W=BattleRatCopyright © by Wolfstuff All Rights Reserved.