Professional Documents
Culture Documents
Lastupdated27.2.2015.
UsingDedicatedServersfromthegame
CreatingmultiplayersessionhostedonaDS
JoiningmultiplayersessionhostedonaDS
DedicatedServerandpasswordprotectedsessions
NamingsessionshostedonDedicatedServer
ServershostedbySMS
Serverbrowser
HostingDedicatedServers
DownloadandupdateDSviaSteamClient
DownloadandupdateDSviaSteamCMD
DSconfiguration
RunningDSinbackgroundonLinux(usingscreen)
TochangetheargumentspassedtothegamefromSteam,gotoyourLibrary,rightclick
ProjectCARSandchooseProperties.
ChooseSETLAUNCHOPTIONSontheGENERALtab:
Andthenenterthecommandlineoptionsintheboxthatappears.
YoucantusethebuiltinSteamsserverbrowsertoaccessProjectCARSdedicatedservers.
Soforexampletocreateasessionononeofourpublicdedicatedserversyouwouldusethis
commandlineargument:
Notethatwecantguaranteethatthisserverwillbealwaysavailable.Andevenifitis,there
mightnotbeenoughofficialserversrunningtosatisfyeveryoneattemptingtohostagameon
themtheCreateattemptwillfailifallserversmatchingthisnamearealreadyinuse.
ProperGUItocreateservershostedondedicatedserverswillbeaddedlater.
thetimehostedonourservers.Thisismostlysowecantestthemandanalyzelogsif
anythingwronghappens,sowecantguaranteeanythingabouttheiravailabilityanduptime.
ThepublicserverswillbealwayscalledOfficialSMStestingserverwiththeserversnumber
attached(ornothingattachedwhenwerunonlyoneserver).WemightalsohaveInternal
SMStestingserveravailable,thosewillbepasswordprotectedandintendedforinternal
testing.
Server browser
Untilingameserverbrowserisavailable,youcanviewthefulllistofrunningserversat
http://carsstatssteam.wmdportal.com/index.php/servers
Onlycommandlineversionoftheserverisavailablefornow,withsimpletextfileusedto
configureit.TheexecutableiscalledDedicatedServerCmd.exe(onWindows)or
DedicatedServerCmd(onLinux).
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.
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.