Advertisement
predath0r

Quake Live Dedicated Windows Server start script

Oct 27th, 2015
2,139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 2.77 KB | None | 0 0
  1. @echo off
  2. setlocal enableextensions enabledelayedexpansion
  3.  
  4. rem This script starts a dedicated QL server under Windows
  5. rem and takes care of downloading Steam Workshop items
  6.  
  7. rem <config>
  8. set steamcmdExe=c:\steamcmd\steamcmd.exe
  9. set hostname=^[DE^] beham.biz WeaponStay FFA
  10. set maxclients=10
  11. set tags=WeaponStay
  12. set stats_password=
  13. set rcon_password=
  14. rem </config>
  15.  
  16. cd /d %~dp0
  17. set dir=%cd%
  18. set instance=%~1
  19. set appid=282440
  20. if "%instance%"=="" goto usage
  21. if "%instance%"=="0" goto defaultInstance
  22.  
  23. :numberedInstance
  24. set homepath=%cd%\home_%instance%
  25. set port1=27959
  26. set /a port1+=%instance%
  27. set port2=28959
  28. set /a port2+=%instance%
  29. set hostname=%hostname% ^#%instance%
  30. mkdir "%homepath%\baseq3" >NUL
  31. goto launch
  32.  
  33. :defaultInstance
  34. set homepath=%cd%
  35. set port1=27960
  36. set port2=5555
  37. goto launch
  38.  
  39. :launch
  40. if not exist "%homepath%\steamclient.dll" call :downloadSteamworksSDK
  41. echo 282440>"%homepath%\steam_appid.txt"
  42. call :updateWorkshopItems
  43.  
  44. set enabled=0
  45. if not "%stats_password%"=="" set enabled=1
  46. set zmq_stats=+set zmq_stats_enable %enabled% +set zmq_stats_port %port1% +set zmq_stats_password "%stats_password%"
  47.  
  48. set enabled=0
  49. if not "%rcon_password%"=="" set enabled=1
  50. set zmq_rcon=+set zmq_rcon_enable %enabled% +set zmq_rcon_port %port2% +set zmq_rcon_password "%rcon_password%"
  51.  
  52. set sv_settings=+set sv_maxclients %maxclients% +set sv_tags "%tags%"
  53.  
  54. start quakelive_steam.exe +set dedicated 1 +set sv_pure 1 +set fs_homepath "%homepath%" +set net_port %port1% %zmq_stats% %zmq_rcon% %sv_settings% +set sv_hostname "%hostname%"
  55. goto:eof
  56.  
  57. :downloadSteamworksSDK
  58. echo.
  59. echo.
  60. echo downloading Steamworks SDK Redist files...
  61. "%steamcmdExe%" +login anonymous +app_update 1007 +quit
  62. xcopy /q /y "%homepath%\..\..\Steamworks SDK Redist\*.dll" "%homepath%\..\"
  63. goto:eof
  64.  
  65. :updateWorkshopItems
  66. if not exist "%steamcmdExe%" goto:eof
  67. set workshopTxt=%homepath%\baseq3\workshop.txt
  68. if not exist "%workshopTxt%" set workshopTxt=%cd%\baseq3\workshop.txt
  69. if not exist "%workshopTxt%" goto:eof
  70. echo updating workshop items...
  71. set itemIds=
  72. for /F "usebackqtokens=1" %%l in ("%workshopTxt%") do if not "%%l"=="#" set itemIds=!itemIds! +workshop_download_item %appid% %%l
  73. if not "%itemIds%"=="" "%steamcmdExe%" +login anonymous %itemIds% +quit
  74. echo.
  75. echo.
  76. echo copying workshop folders...
  77. for /D %%d in (..\..\workshop\content\%appid%\*) do xcopy /q /y /s "%%d\*" "%homepath%"
  78. for %%f in ("%homepath%\*.pk3") do call :moveWorkshopPk3 "%%f"
  79. goto:eof
  80.  
  81. :moveWorkshopPk3
  82. rem workshop packages with pk3s do not include a baseq3 folder, but the files must be put in a baseq3 folder
  83. echo.
  84. echo moving workshop pk3 files...
  85. set target=%homepath%\baseq3\%~n1%~x1
  86. if exist "%target%" del "%target%"
  87. move "%~1" "%target%"
  88. goto:eof
  89.  
  90. :usage
  91. echo Usage: %0 ^<instance^>
  92. goto:eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement