Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- setlocal enableextensions enabledelayedexpansion
- rem This script starts a dedicated QL server under Windows
- rem and takes care of downloading Steam Workshop items
- rem <config>
- set steamcmdExe=c:\steamcmd\steamcmd.exe
- set hostname=^[DE^] beham.biz WeaponStay FFA
- set maxclients=10
- set tags=WeaponStay
- set stats_password=
- set rcon_password=
- rem </config>
- cd /d %~dp0
- set dir=%cd%
- set instance=%~1
- set appid=282440
- if "%instance%"=="" goto usage
- if "%instance%"=="0" goto defaultInstance
- :numberedInstance
- set homepath=%cd%\home_%instance%
- set port1=27959
- set /a port1+=%instance%
- set port2=28959
- set /a port2+=%instance%
- set hostname=%hostname% ^#%instance%
- mkdir "%homepath%\baseq3" >NUL
- goto launch
- :defaultInstance
- set homepath=%cd%
- set port1=27960
- set port2=5555
- goto launch
- :launch
- if not exist "%homepath%\steamclient.dll" call :downloadSteamworksSDK
- echo 282440>"%homepath%\steam_appid.txt"
- call :updateWorkshopItems
- set enabled=0
- if not "%stats_password%"=="" set enabled=1
- set zmq_stats=+set zmq_stats_enable %enabled% +set zmq_stats_port %port1% +set zmq_stats_password "%stats_password%"
- set enabled=0
- if not "%rcon_password%"=="" set enabled=1
- set zmq_rcon=+set zmq_rcon_enable %enabled% +set zmq_rcon_port %port2% +set zmq_rcon_password "%rcon_password%"
- set sv_settings=+set sv_maxclients %maxclients% +set sv_tags "%tags%"
- 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%"
- goto:eof
- :downloadSteamworksSDK
- echo.
- echo.
- echo downloading Steamworks SDK Redist files...
- "%steamcmdExe%" +login anonymous +app_update 1007 +quit
- xcopy /q /y "%homepath%\..\..\Steamworks SDK Redist\*.dll" "%homepath%\..\"
- goto:eof
- :updateWorkshopItems
- if not exist "%steamcmdExe%" goto:eof
- set workshopTxt=%homepath%\baseq3\workshop.txt
- if not exist "%workshopTxt%" set workshopTxt=%cd%\baseq3\workshop.txt
- if not exist "%workshopTxt%" goto:eof
- echo updating workshop items...
- set itemIds=
- for /F "usebackqtokens=1" %%l in ("%workshopTxt%") do if not "%%l"=="#" set itemIds=!itemIds! +workshop_download_item %appid% %%l
- if not "%itemIds%"=="" "%steamcmdExe%" +login anonymous %itemIds% +quit
- echo.
- echo.
- echo copying workshop folders...
- for /D %%d in (..\..\workshop\content\%appid%\*) do xcopy /q /y /s "%%d\*" "%homepath%"
- for %%f in ("%homepath%\*.pk3") do call :moveWorkshopPk3 "%%f"
- goto:eof
- :moveWorkshopPk3
- rem workshop packages with pk3s do not include a baseq3 folder, but the files must be put in a baseq3 folder
- echo.
- echo moving workshop pk3 files...
- set target=%homepath%\baseq3\%~n1%~x1
- if exist "%target%" del "%target%"
- move "%~1" "%target%"
- goto:eof
- :usage
- echo Usage: %0 ^<instance^>
- goto:eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement