Advertisement
Guest User

Stationeers Launcher v1

a guest
Feb 18th, 2018
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 5.20 KB | None | 0 0
  1. @echo off
  2. REM USE AT YOUR OWN RISK!!!  NOTHING IS PROMISED BY THE SCRIPT!
  3. REM
  4. REM See Dedicated Server Documentation: https://stationeers-wiki.com/Dedicated_Server_Guide
  5. REM
  6. REM This script will install, config and launch the game server if it's not already installed.
  7. 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.
  8. REM
  9. REM The only settings that should need to be changed are in this section and the :CONFIG Section.
  10. REM Anything that requires a file path is listed here in the Variables section.
  11. REM
  12. REM
  13. REM Assumes you have 7Zip installed for backup and SteamCMD is also installed.
  14. REM Download SteamCMD from https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip
  15. REM Download 7Zip from http://www.7-zip.org/download.html
  16. REM
  17. REM Variables for starting the server with preferred settings
  18. REM Don't use spaces in the path names without enclosing it in quotation marks.  See set zip as example.
  19. REM
  20. REM If you don't want your browser to autolaunch to the admin console, comment out or remove lines 105 through 110
  21.  
  22. set WORLD=Stationeer.MP.World
  23. set SAVEINT=300
  24. set GAMEFOLDER=e:\SteamCMD\stationeers
  25. set GAMEEXE=e:\SteamCMD\stationeers\rocketstation_DedicatedServer.exe
  26. set STEAM=e:\SteamCMD\steamcmd.exe
  27. set SAVES=e:\SteamCMD\stationeers\saves
  28. set stamp=%date:~4,2%%date:~7,2%%date:~10,4%%time:~0,2%%time:~3,2%%time:~6,2%
  29. set ZIP="c:\Program Files\7-zip\7z.exe"
  30. set BAKDIR=z:\
  31.  
  32. REM Kills the task if it's running then checks for updates and starts the game back up.
  33. REM If the game isn't running, it checks for updates and then launches.
  34.  
  35. echo.
  36. echo ### Checking if server is already running.  Will stop server if it is.  ###
  37. taskkill /f /im "rocketstation_DedicatedServer.exe" && goto UPDATEINSTALLGAME
  38. if errorlevel 128 (
  39. goto UPDATEINSTALLGAME
  40. )
  41.  
  42. :UPDATEINSTALLGAME
  43. 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.
  44. 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!!!
  45. echo.
  46. echo.
  47. echo ###  Checking for server installation.  ###
  48. if exist %GAMEFOLDER% (GOTO BACKUP-UPDATE) else GOTO INSTALL
  49.  
  50. :BACKUP-UPDATE
  51. cls
  52. echo.
  53. echo.
  54. echo ###  Backing up world and config files.  ###
  55. %ZIP% a -mx9 %BAKDIR%%WORLD%-%stamp%.zip "%SAVES%" %GAMEFOLDER%\default.ini
  56. echo.
  57. echo ###  Checking for game updates.  ###
  58. start %STEAM% +login anonymous +force_install_dir "%GAMEFOLDER%" +app_update 600760 validate +quit
  59. echo.
  60. echo ###  Starting server.  ###
  61. goto START
  62.  
  63. :INSTALL
  64. cls
  65. echo.
  66. echo ###  No server install found  ###
  67. echo.
  68. echo ###  If you're sure you want to install the server and have configured everything in this file, press any key to proceed.  ###
  69. echo ###  Otherwise click the big red X at the top right of this window.  ###
  70. pause
  71. echo.
  72. echo.
  73. echo ###  Starting install of server to %GAMEFOLDER%  ###
  74. mkdir %GAMEFOLDER%
  75. start %STEAM% +login anonymous +force_install_dir "%GAMEFOLDER%" +app_update 600760 validate +quit
  76. echo.
  77. echo.
  78. echo ###  PRESS ANY KEY TO CONTINUE ONCE THE SERVER DOWNLOAD HAS FINISHED.  ###
  79. pause
  80. goto CONFIG
  81.  
  82. :CONFIG
  83. 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.
  84. echo.
  85. echo ###  CONFIGURING SERVER  ###
  86. REM move %GAMEFOLDER%\rocketstation_DedicatedServer_Data\StreamingAssets\default.ini %GAMEDATA%\rocketstation_DedicatedServer\StreamingAssets\default.BAK
  87. echo [SERVER] > %GAMEFOLDER%\rocketstation_DedicatedServer_Data\StreamingAssets\default.ini
  88. echo SERVERNAME=CHANGE_ME >> %GAMEFOLDER%\rocketstation_DedicatedServer_Data\StreamingAssets\default.ini
  89. echo GAMEPORT=27500 >> %GAMEFOLDER%\rocketstation_DedicatedServer_Data\StreamingAssets\default.ini
  90. echo UPDATERPORT=27015 >> %GAMEFOLDER%\rocketstation_DedicatedServer_Data\StreamingAssets\default.ini
  91. echo PASSWORD=CHANGE_ME >> %GAMEFOLDER%\rocketstation_DedicatedServer_Data\StreamingAssets\default.ini
  92. echo MAPNAME=Moon >> %GAMEFOLDER%\rocketstation_DedicatedServer_Data\StreamingAssets\default.ini
  93. echo DESCRIPTION=Stationeers >> %GAMEFOLDER%\rocketstation_DedicatedServer_Data\StreamingAssets\default.ini
  94. echo MAXPLAYER=10 >> %GAMEFOLDER%\rocketstation_DedicatedServer_Data\StreamingAssets\default.ini
  95. echo  >> %GAMEFOLDER%\rocketstation_DedicatedServer_Data\StreamingAssets\default.ini
  96. echo [RCON] >> %GAMEFOLDER%\rocketstation_DedicatedServer_Data\StreamingAssets\default.ini
  97. echo RCONPASSWORD=CHANGE_ME >> %GAMEFOLDER%\rocketstation_DedicatedServer_Data\StreamingAssets\default.ini
  98. echo.
  99. echo ###  Starting server.  ###
  100. goto START
  101.  
  102. :START
  103. REM Simple.  Starts the game using the variables set above.
  104. start %GAMEEXE% -autostart -nographics -batchmode -worldname=%WORLD% -autosaveinterval=%SAVEINT% -loadworld=%WORLD%
  105. echo ###  Waiting a few seconds for server to launch  ###
  106. echo.
  107. echo.
  108. PING 1.1.1.1 -n 1 -w 30000 >NUL
  109. echo ###  Opening browser to server console.  ###
  110. start "%ProgramFiles%\Internet Explorer\iexplore.exe" "http://127.0.0.1:27500/"
  111. exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement