You are on page 1of 8

QuickandshortinstructionsforrunningandusingProjectCARSdedicatedserversonPC.

Lastupdated27.2.2015.

UsingDedicatedServersfromthegame
CreatingmultiplayersessionhostedonaDS
JoiningmultiplayersessionhostedonaDS
DedicatedServerandpasswordprotectedsessions
NamingsessionshostedonDedicatedServer
ServershostedbySMS
Serverbrowser
HostingDedicatedServers
DownloadandupdateDSviaSteamClient
DownloadandupdateDSviaSteamCMD
DSconfiguration
RunningDSinbackgroundonLinux(usingscreen)

Using Dedicated Servers from the game


IncurrentbuildthegamedoesnotyethavetheGUIupdatedforDedicatedServerssotouse
themyouwillhavetoutilizethecommandline.

TochangetheargumentspassedtothegamefromSteam,gotoyourLibrary,rightclick
ProjectCARSandchooseProperties.

ChooseSETLAUNCHOPTIONSontheGENERALtab:


Andthenenterthecommandlineoptionsintheboxthatappears.

YoucantusethebuiltinSteamsserverbrowsertoaccessProjectCARSdedicatedservers.

Creating multiplayer session hosted on a DS


CreatingmultiplayersessionsthatarehostedonaDedicatedServerisnotverydifferentfrom
creatingpeertopeersession.Infact,rightnowitsexactlythesame,andthetypeofthe
sessioncreatedwhenyouclicktheCreatebuttoniscanbecontrolledonlyfromthe
commandline.Therearetwocommandlineoptionsyoucanpasstothegame:
autods:Inthismodethegamewillenumeratealldedicatedserversthatarecurrently
availabletheserversmustbepublic,notpasswordprotectedandnotusedbythe
game.ItfirstlooksforserversavailableonyourLAN,thentheInternet,and
automaticallypickaserverwiththebestlatencyifthereareanypublicservers
available.
searchdsSERVERNAME:Searchesforavailablededicatedservermatching
SERVERNAME.Iftherearemultipleserversmatchingthatname(assubstring)the
serverwiththebestlatencywillbeused.Soforexamplesearchdstestwould
matchserversnamedSMStestserverormytestingserver.Theservercanbe
passwordprotected,inwhichcasethegamewillaskyouforthepasswordbefore
creatingasessionontheserver.

Soforexampletocreateasessionononeofourpublicdedicatedserversyouwouldusethis
commandlineargument:


Notethatwecantguaranteethatthisserverwillbealwaysavailable.Andevenifitis,there
mightnotbeenoughofficialserversrunningtosatisfyeveryoneattemptingtohostagameon
themtheCreateattemptwillfailifallserversmatchingthisnamearealreadyinuse.

ProperGUItocreateservershostedondedicatedserverswillbeaddedlater.

Joining multiplayer session hosted on a DS


Searchingforandjoiningmultiplayersessionshostedondedicatedserverisexactlythesame
asjoiningpeertopeersessions.Youcanusethebrowser,orjoinviamultiplayerinvitations
orfriendlists.Thebrowserhasnotyetbeenupdatedtoshowwhichsessionsarehostedona
serverandwhicharepeertopeer,butbydefaultthesessionsnamewillbethenameofthe
serverwhenhosted,notthenameoftheuserwhocreatedthesession.

Dedicated Server and password-protected sessions


ThepasswordthatcanbeconfiguredintheCreateoptionsisnotusedwhencreating
sessionshostedonadedicatedserver.Insteadthepasswordiscontrolledbythe
administratorofthededicatedserver,andmustbeenteredwhencreatinganewsessionon
theserverorwhenjoiningthesession.Thereisjustonepasswordfortheserver,thesame
passwordisrequiredforCreateandJoin.Thisisunlikelytochangeinthefuturebecauseit
wouldleadtotoomanyconfusingoptions,andwedliketohaveemptyserversappearinthe
Browseraswell,wherejoiningthemwouldautomaticallycreateasessionwithdefault
settings.

Naming sessions hosted on Dedicated Server


Bydefaultnewsessionscreatedonadedicatedserversusetheserversnameasthe
sessionsname.Thismakesiteasiertotellwhichsessionsarepeertopeer(namedafterthe
userwhocreatedthem)andwhichonesarehostedonaserver(namedaftertheserver).
Howevertheusercreatingthesessioncanoverridethenameinbothcases,onlywhenthe
nameisleftemptyintheoptionswillthedefaultbeused.

Servers hosted by SMS


GenerallywewillnotbehostingsufficientamountofserversforProjectCARStoletanyone
playonthem.DuringWMDprereleaseperiodwewillhaveatleastsomeserversupmostof

thetimehostedonourservers.Thisismostlysowecantestthemandanalyzelogsif
anythingwronghappens,sowecantguaranteeanythingabouttheiravailabilityanduptime.

ThepublicserverswillbealwayscalledOfficialSMStestingserverwiththeserversnumber
attached(ornothingattachedwhenwerunonlyoneserver).WemightalsohaveInternal
SMStestingserveravailable,thosewillbepasswordprotectedandintendedforinternal
testing.

Server browser
Untilingameserverbrowserisavailable,youcanviewthefulllistofrunningserversat
http://carsstatssteam.wmdportal.com/index.php/servers

Hosting Dedicated Servers


ThededicatedserverisavailableonSteamtoallusers,notjustownersofthegame.Soyou
candownloadandruntheserveranywhere.WindowsandLinuxversionsareavailable,
Steamwilldownloadtheappropriatebuildforyourcurrentplatformautomatically.

Onlycommandlineversionoftheserverisavailablefornow,withsimpletextfileusedto
configureit.TheexecutableiscalledDedicatedServerCmd.exe(onWindows)or
DedicatedServerCmd(onLinux).

Download and update DS via Steam Client


YoucandownloadtheserverfromtheSteamslibrary.GotoyourLibrary,thenswitchitfrom
GamestoTools,searchforProjectCARSDedicatedServerandinstallit.Sincetheserveris
acommandlineapplication,whileyoucanrunitfromthelibraryitwontshowanynice
configurationwindow.SofirstIrecommendconfiguringit.

Download and update DS via SteamCMD


YoudonthavetohaveSteamClientinstalledtobeabletodownloadandruntheserver.The
alternativetofullblownSteamClientistheSteamCMDutility.FullSteamCMDdocumentation
anddownloadlinksareavailablehere:
https://developer.valvesoftware.com/wiki/SteamCMD

TheinstallationviaSteamCMDwilldifferslightlydependingonyourplatformandtheexact
versionoftheOS.RightnowSteamCMDis32bitonly,soon64bitLinuxplatformsyoumight
havetoperformextrasteps.ForexamplewhenIwasinstallingitonour64bitUbuntubased
testingserver,thestepswere:
Install32bitgccsupport:aptgetinstalllib32gcc1
CreateSteamuser:addusersteam.Youwillalsoprobablywanttoedit/etc/sudoers
toletselectuserswitchtothisaccount,andremovepasswordfromthisuserto
preventdirectremotelogin:passwdlsteam.
SwitchtotheSteamaccount:sudosusteam
AndinstallSteamCMD:
cd
mkdirsteamcmd
cdsteamcmd
wget

http://media.steampowered.com/installer/steamcmd_linux.tar.gz
tarxvzfsteamcmd_linux.tar.gz
ThetoinstallthededicatedserverviaSteamCMD(ortoupdateit,thatsdonethesameway),
whilerunningasthesteamuser:

cd
cdsteamcmd
./steamcmd.sh
loginanonymous
force_install_dir./pcars
app_update332670validate
quit
Oryoucanjustrunitallonwithasinglecommand
./steamcmd.sh+loginanonymous+force_install_dir./pcars+app_update332670
validate+quit
Ofcoursetheforce_install_dirdirectoryisentirelyuptoyou.

Notethaton64bitLinuxyoumighthavetocopysome*.sofilesfromsteamcmd/linux32
directorytosteamcmd/pcars/lib32ifyouhavetroublesstartingit.Theserverisalso32bitand
Steamdoesnotbundleallnecessarylibsbydefaultwiththeserverpackage.

DS configuration
Afteryouinstalltheserver,beforerunningit,itsstronglyrecommendedtocustomizethe
serversconfig.Theconfigurationisreadfromfileserver.cfgfromthecurrentworking
directorywhentheserverstarts.Bydefaultthereisnosuchfile,butthereisasubdirectory
config_samplewithsomeexamples.Itsstronglyrecommendedtostartwiththose.Sousually
youwouldstartbycopyingconfig_sample/server.cfgto./server.cfgandtheneditit.

Thereisalsomoreadvancedconfigsampleavailableinconfig_sample/server_with_lists.cfg,
config_sample/blacklist.cfgandconfig_sample/whitelist.cfg.Usethosefilesifyouwanttouse
blacklistsorwhitelistsonyourserver.Dontforgettorenameserver_with_lists.cfgto
server.cfg.Alsomakesureyoueditthewhitelistinthatconfigifthereisanywhitelistset,
only
usersinthatlistwillbeabletoconnecttotheserver,andthesampleconfighasjustmy
IDinthelist.

Theoptionsinthesamplewillusuallymatchthedefaultoptionsbakedintotheexecutable.So
ifyoudontwanttocustomizesomeofthem,feelfreetocompletelyremovethemfromthe
config.Theonlyexceptionarethesampleblacklistandwhitelist,thoseareemptybydefault
butsettononemptyliststoprovideexamples.

TheconfigsformatislooselybasedonJSON,butitsabitmorefreeformandallowsyouto
omitcommasbetweenindividualoptions,anditsnotrequiredtohavethewholeconfig
enclosedintoplevel{}block.

Thesyntaxtosetanoptionsvalueis:
OPTION_NAME
:
OPTION_VALUE
Theoptionnamesarecasesensitive.


Strings(soalloptionnamesforexample)needtobedoublequoted,valuescanbestrings,
integersorbooleans(trueorfalse,withoutanyquotes).Insomecasesvaluescanalsobe
listsorobjects.Thesyntaxforalistoptionvalueis:
OPTION_NAME
:[
OPTION_VALUE_1
,
OPTION_VALUE_2
]
andthesyntaxforanobjectoptionvalueis:
OPTION_NAME
:{
KEY_1
:
VALUE_1
,
KEY_2
:
VALUE_2
}

Someoftheusefuloptionsyouwillwanttochangeare:
//,#orrem:Thisoptionswillbeignored,youcanusethemtowritecomments
intotheirvalues.
name:Theserversname.Thiswillappearinserverbrowser(whenimplemented)
andwillbealsothedefaultnameofsessionshostedontheserver.
password:Thepasswordrequiredtocreatesessionsontheserveraswellastojoin
thesessions.PasswordsetinCreateoptionsisignoredwhenusingadedicated
server.
blackList:ListofSteamIDstoneverletontotheserver.Thevaluecanbeeitheralist
oranobject.Inbothcasesonlythevaluesareused,whichallowsyoutousethemap
syntaxtowriteanycommentsinthekeysofthemapsoforexampletheusers
nameandreasonforbanning.ThevaluescanbeeitherSteamIDsoftheuserstobad,
orfilenames(iftheyarestrings).Thefilesreferencedfromtheblacklistshouldcontain
justaplainlistorobjectinsimilarformat,withmoreSteamIDs.SteamIDsandfile
namescanbemixedinanyorder.Thisforexampleallowsyoutoreferencetwofiles
withblacklistsfromthemainconfigonefilewithusersbannedfromthisspecific
server,andanotherfilewithgloballywellknownbadpeoplebannedfromasetof
servers(adminscanthensharethislistonapublicwebsiteforanyone,forexample).

Therearemoreoptionsavailable,allofthesupportedonesareincludedinthesample
configs,includingshortdocumentation.

Running DS in background on Linux (using screen)


TherearemanywaystorundedicatedserverinLinuxenvironment.Youcouldwriteaninit.d
scriptandthenusetheusualserver/daemoncommandstocontrolit.Wedontprovidesuch
scriptsatthemoment,astheytendtoslightlydifferfromOStoOS.

OneeasywaytorunaserverviaSSHwithouthavingtostayremotelyloggedinforeveris
screen.OnDebian/UbuntubasedOSyouwoulduseaptgetinstallscreentoinstallit.

Toruntheserverforthefirsttime:
SSHtotheserver
sudosusteam
script/dev/null

screen(thenpressentertoconfirmtheinitialscreen,readthroughitifyouwantto)
Thefollowingcommandswillberuninsidethescreen
cd
cdsteamcmd/pcars
./DedicatedServerCmd2>&1|teeserver.log
Pressctrlafollowedbydtodetachfromthescreen.
Pressctrldtoleavethescreen,thenfewmoretimestoleavethescript/sudo/logout.

Toreattachtotheserverlater:
SSHtotheserver
sudosusteam
Youcanreviewserver.login/home/steam/steamcmd/pcarsfollowtoreattachtothe
server
script/dev/null
screendr

Notethatthescript/dev/nullcommandisasemiuglytricktomakescreenworkinsudo
sessions.

You might also like