Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- REM USE AT YOUR OWN RISK!!! NOTHING IS PROMISED BY THE SCRIPT!
- REM
- REM See Dedicated Server Documentation: https://stationeers-wiki.com/Dedicated_Server_Guide
- REM
- REM This script will install, config and launch the game server if it's not already installed.
- REM If the game server is already installed, any time the script runs it will stop any running servers, make a backup, update the server files and relaunch the server.
- REM
- REM The only settings that should need to be changed are in this section and the :CONFIG Section.
- REM Anything that requires a file path is listed here in the Variables section.
- REM
- REM
- REM Assumes you have 7Zip installed for backup and SteamCMD is also installed.
- REM Download SteamCMD from https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip
- REM Download 7Zip from http://www.7-zip.org/download.html
- REM
- REM Variables for starting the server with preferred settings
- REM Don't use spaces in the path names without enclosing it in quotation marks. See set zip as example.
- REM
- REM If you don't want your browser to autolaunch to the admin console, comment out or remove lines 105 through 110
- set WORLD=Stationeer.MP.World
- set SAVEINT=300
- set GAMEFOLDER=e:\SteamCMD\stationeers
- set GAMEEXE=e:\SteamCMD\stationeers\rocketstation_DedicatedServer.exe
- set STEAM=e:\SteamCMD\steamcmd.exe
- set SAVES=e:\SteamCMD\stationeers\saves
- set stamp=%date:~4,2%%date:~7,2%%date:~10,4%%time:~0,2%%time:~3,2%%time:~6,2%
- set ZIP="c:\Program Files\7-zip\7z.exe"
- set BAKDIR=z:\
- REM Kills the task if it's running then checks for updates and starts the game back up.
- REM If the game isn't running, it checks for updates and then launches.
- echo.
- echo ### Checking if server is already running. Will stop server if it is. ###
- taskkill /f /im "rocketstation_DedicatedServer.exe" && goto UPDATEINSTALLGAME
- if errorlevel 128 (
- goto UPDATEINSTALLGAME
- )
- :UPDATEINSTALLGAME
- REM Checks to see if dedicated server is installed. If installed it makes a backup of the world, updates the files and sends to be started.
- REM If the dedicated server is not installed, it begins the install using the path to SteamCMD from above. It then sends to be configured. UPDATE THE :CONFIG SECTION BELOW with your settings!!!
- echo.
- echo.
- echo ### Checking for server installation. ###
- if exist %GAMEFOLDER% (GOTO BACKUP-UPDATE) else GOTO INSTALL
- :BACKUP-UPDATE
- cls
- echo.
- echo.
- echo ### Backing up world and config files. ###
- %ZIP% a -mx9 %BAKDIR%%WORLD%-%stamp%.zip "%SAVES%" %GAMEFOLDER%\default.ini
- echo.
- echo ### Checking for game updates. ###
- start %STEAM% +login anonymous +force_install_dir "%GAMEFOLDER%" +app_update 600760 validate +quit
- echo.
- echo ### Starting server. ###
- goto START
- :INSTALL
- cls
- echo.
- echo ### No server install found ###
- echo.
- echo ### If you're sure you want to install the server and have configured everything in this file, press any key to proceed. ###
- echo ### Otherwise click the big red X at the top right of this window. ###
- pause
- echo.
- echo.
- echo ### Starting install of server to %GAMEFOLDER% ###
- mkdir %GAMEFOLDER%
- start %STEAM% +login anonymous +force_install_dir "%GAMEFOLDER%" +app_update 600760 validate +quit
- echo.
- echo.
- echo ### PRESS ANY KEY TO CONTINUE ONCE THE SERVER DOWNLOAD HAS FINISHED. ###
- pause
- goto CONFIG
- :CONFIG
- REM Update this section with how you want your server configured. Current ports and MAPNAME below are default. The server will be launched when config is finished.
- echo.
- echo ### CONFIGURING SERVER ###
- REM move %GAMEFOLDER%\rocketstation_DedicatedServer_Data\StreamingAssets\default.ini %GAMEDATA%\rocketstation_DedicatedServer\StreamingAssets\default.BAK
- echo [SERVER] > %GAMEFOLDER%\rocketstation_DedicatedServer_Data\StreamingAssets\default.ini
- echo SERVERNAME=CHANGE_ME >> %GAMEFOLDER%\rocketstation_DedicatedServer_Data\StreamingAssets\default.ini
- echo GAMEPORT=27500 >> %GAMEFOLDER%\rocketstation_DedicatedServer_Data\StreamingAssets\default.ini
- echo UPDATERPORT=27015 >> %GAMEFOLDER%\rocketstation_DedicatedServer_Data\StreamingAssets\default.ini
- echo PASSWORD=CHANGE_ME >> %GAMEFOLDER%\rocketstation_DedicatedServer_Data\StreamingAssets\default.ini
- echo MAPNAME=Moon >> %GAMEFOLDER%\rocketstation_DedicatedServer_Data\StreamingAssets\default.ini
- echo DESCRIPTION=Stationeers >> %GAMEFOLDER%\rocketstation_DedicatedServer_Data\StreamingAssets\default.ini
- echo MAXPLAYER=10 >> %GAMEFOLDER%\rocketstation_DedicatedServer_Data\StreamingAssets\default.ini
- echo >> %GAMEFOLDER%\rocketstation_DedicatedServer_Data\StreamingAssets\default.ini
- echo [RCON] >> %GAMEFOLDER%\rocketstation_DedicatedServer_Data\StreamingAssets\default.ini
- echo RCONPASSWORD=CHANGE_ME >> %GAMEFOLDER%\rocketstation_DedicatedServer_Data\StreamingAssets\default.ini
- echo.
- echo ### Starting server. ###
- goto START
- :START
- REM Simple. Starts the game using the variables set above.
- start %GAMEEXE% -autostart -nographics -batchmode -worldname=%WORLD% -autosaveinterval=%SAVEINT% -loadworld=%WORLD%
- echo ### Waiting a few seconds for server to launch ###
- echo.
- echo.
- PING 1.1.1.1 -n 1 -w 30000 >NUL
- echo ### Opening browser to server console. ###
- start "%ProgramFiles%\Internet Explorer\iexplore.exe" "http://127.0.0.1:27500/"
- exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement