Advertisement
iKurdo

Iniciar y actualizar servidor DAYZ

May 13th, 2020 (edited)
580
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 3.19 KB | None | 0 0
  1. @echo off
  2. TITLE DayZ SA Server - Status
  3. COLOR 0A
  4.     :: DEFINE the following variables where applicable to your install
  5.     SET SteamLogin=anonymous
  6.     SET DayZBranch=223350
  7.     SET DayZServerPath="C:\DZServer"
  8.     SET SteamCMDPath="C:\steamcmd"
  9.     SET BECPath="C:\BEC"
  10.     :: DayZ Mod Parameters
  11.     set DayZModList=(C:\DZServer\Modlist.txt)
  12.     set SteamCMDWorkshopPath="C:\steamcmd\steamapps\workshop\content\221100"
  13.     set SteamCMDDelay=5
  14.     setlocal EnableDelayedExpansion
  15.     :: _______________________________________________________________
  16.  
  17. goto checkServer
  18. pause
  19.  
  20. :checkServer
  21. tasklist /fi "imagename eq DayZServer_x64.exe" 2>NUL | find /i /n "DayZServer_x64.exe">NUL
  22. if "%ERRORLEVEL%"=="0" goto checkBEC
  23. cls
  24. echo El servidor no se está ejecutando, chekeando...
  25. goto killServer
  26.  
  27. :checkBEC
  28. tasklist /fi "imagename eq BEC.exe" 2>NUL | find /i /n "BEC.exe">NUL
  29. if "%ERRORLEVEL%"=="0" goto loopServer
  30. cls
  31. echo Bec no se está ejecutando, chekeando...
  32. goto startBEC
  33.  
  34. :loopServer
  35. FOR /L %%s IN (30,-1,0) DO (
  36.     cls
  37.     echo Servidor activo, chekeando en %%s segundos..
  38.     timeout 1 >nul
  39. )
  40. goto checkServer
  41.  
  42. :killServer
  43. taskkill /f /im Bec.exe
  44. taskkill /f /im DayZServer_x64.exe
  45. taskkill /f /im DZSALModServer.exe
  46. goto updateServer
  47.  
  48. :updateServer
  49. cls
  50. echo Actualizando Servidor.
  51. timeout 1 >nul
  52. cls
  53. echo Actualizando Servidor..
  54. timeout 1 >nul
  55. cls
  56. echo Actualizando Servidor...
  57. cd "%SteamCMDPath%"
  58. steamcmd.exe +login %SteamLogin% +force_install_dir %DayZServerPath% +"app_update %DayZBranch%" +quit
  59. goto updateMods
  60.  
  61. :startServer
  62. cls
  63. echo Iniciando Servidor.
  64. timeout 1 >nul
  65. cls
  66. echo Iniciando Servidor..
  67. timeout 1 >nul
  68. cls
  69. echo Iniciando Servidor...
  70. cd "%DayZServerPath%"
  71. start DayZServer_x64.exe -instanceId=1 -config=serverDZ.cfg -profiles=ServerProfiles -port=2302 -bepath=C:\DZServer\battleye -mod=!MODS_TO_LOAD!% -cpuCount=4 -noFilePatching -dologs -adminlog -freezecheck
  72. FOR /l %%s IN (45,-1,0) DO (
  73.     cls
  74.     echo Iniciando Servidor, espere %%s segundos para iniciar BEC..  
  75.     timeout 1 >nul
  76. )
  77. goto startBEC
  78.  
  79. :startBEC
  80. cls
  81. echo Iniciando BEC.
  82. timeout 1 >nul
  83. cls
  84. echo Iniciando BEC..
  85. timeout 1 >nul
  86. cls
  87. echo Iniciando BEC...
  88. timeout 1 >nul
  89. cd "%BECPath%"
  90. start Bec.exe -f Config.cfg --dsc
  91. goto checkServer
  92.  
  93. :updateMods
  94. cls
  95. FOR /L %%s IN (%SteamCMDDelay%,-1,0) DO (
  96.     cls
  97.     echo Chekeando actualizaciones en %%s segundos..
  98.     timeout 1 >nul
  99. )
  100. echo Actualizando Mods...
  101. @ timeout 1 >nul
  102. cd %SteamCMDPath%
  103. for /f "tokens=1,2 delims=," %%g in %DayZModList% do steamcmd.exe +login %SteamLogin% +workshop_download_item 221100 "%%g" +quit
  104. cls
  105. echo Mods actualizados, sincronizando datos con el servidor...
  106. @ timeout 2 >nul
  107. cls
  108. @ for /f "tokens=1,2 delims=," %%g in %DayZModList% do robocopy "%SteamCMDWorkshopPath%\%%g" "%DayZServerPath%\%%h" *.* /mir
  109. @ for /f "tokens=1,2 delims=," %%g in %DayZModList% do forfiles /p "%DayZServerPath%\%%h" /m *.bikey /s /c "cmd /c copy @path %DayZServerPath%\keys"
  110. cls
  111. echo Sincronizacion completa!
  112. @ timeout 3 >nul
  113. cls
  114. set "MODS_TO_LOAD="
  115. for /f "tokens=1,2 delims=," %%g in %DayZModList% do (
  116. set "MODS_TO_LOAD=!MODS_TO_LOAD!%%h;"
  117. )
  118. set "MODS_TO_LOAD=!MODS_TO_LOAD:~0,-1!"
  119. ECHO Cargando mods: !MODS_TO_LOAD!%
  120. @ timeout 3 >nul
  121. goto startServer
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement