Installer Steam
connexion
|
langue
简体中文 (chinois simplifié)
繁體中文 (chinois traditionnel)
日本語 (japonais)
한국어 (coréen)
ไทย (thaï)
Български (bulgare)
Čeština (tchèque)
Dansk (danois)
Deutsch (allemand)
English (anglais)
Español - España (espagnol castillan)
Español - Latinoamérica (espagnol d'Amérique latine)
Ελληνικά (grec)
Italiano (italien)
Bahasa Indonesia (indonésien)
Magyar (hongrois)
Nederlands (néerlandais)
Norsk (norvégien)
Polski (polonais)
Português (portugais du Portugal)
Português - Brasil (portugais du Brésil)
Română (roumain)
Русский (russe)
Suomi (finnois)
Svenska (suédois)
Türkçe (turc)
Tiếng Việt (vietnamien)
Українська (ukrainien)
Signaler un problème de traduction
some mods makers dont make a keys folder and makes a key folder
so it never gets moved/updated
such as the below?
:: Section to copy keys from each mod's keys folder to the server's keys directory
:: Ensure the target keys directory exists
if not exist "%KEYS_DIR%" mkdir "%KEYS_DIR%"
:: Loop through each mod folder to copy keys
for /F "tokens=1* delims= " %%a in ('type "%MODLIST_PATH%"') do (
if exist "%SERVER_DIR%\%%b\keys\*" (
xcopy "%SERVER_DIR%\%%b\keys\*" "%KEYS_DIR%" /E /I /Y
)
)
if not exist "%KEYS_DIR%" mkdir "%KEYS_DIR%"
:: Loop through each mod folder to copy keys
for /F "tokens=1* delims= " %%a in ('type "%MODLIST_PATH%"') do (
if exist "%SERVER_DIR%\%%b\key\*" (
xcopy "%SERVER_DIR%\%%b\key\*" "%KEYS_DIR%" /E /I /Y
)
)
anyway to change app id and still allow the workshop to update?
i guess add another check for it?
If you already have a mod with a key, and the mod works, you don't need to update the key when you update the mod .. keys are assigned to the Mod Author, not the individual mod itself. Example: All my Mods, use the same Key, so if I forget to add the Key to one I upload, all you need to do is use the key from one of my other mods. If you have 2 mods from the same person, they both use one key in the server Keys folder.
modlist.txt file format the same. Mods should start at line 1 and each mod must be on a new line
------------------------------------------------------------------------------------------------
1559212036 @CF
2545327648 @Dabs Framework
2116157322 @DayZ-Expansion-Licensed
2572331007 @DayZ-Expansion-Bundle
1828439124 @VPPAdminTools
------------------------------------------------------------------------------------------------
Dont include quotes unless stated
1. Create empty server folder in C:\ directory (C:\DayZServer)
2. Create "steamcmd" folder in C:\DayZServer and place steamcmd.exe in this folder. Download it here https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip
3. open cmd
4. cd into steam cmd directory. Type "cd C:\DayZServer\steamcmd"
5. type "steamcmd.exe" to enetr steamcmd prompt
6. type "force_install_dir C:\DayZServer\steamcmd"
7. type "login USERNAME" (replace USERNAME with your steam username)
8. It will ask for password, go ahead an enter it. Will only need to do this once
9. type "app_update 223350 validate" to install server
10. After installation, type "exit" to exit steamcmd and return to windows cmd prompt
11. Place above modlist.txt with desired mods in format above into C:\DayServer folder
Note: I still recommend installing steam and subscribing to mods just to make sure they download to the workshop directory properly.
Create .bat file with the script in it below. I created two files. One to just handle restarts and mod updates and one that does the same but also updates/verifys the server files. The only change if you want to only update mods and do server reboots, you can comment out the following line (line 27 on my file):
echo app_update %DAYZ_APP_ID% validate >> "%SERVER_DIR%\steamcmd_script.txt"
@echo off
setlocal enabledelayedexpansion
:: SteamCMD configuration
set "STEAMCMD_PATH=C:\DayZServer\steamcmd"
:: Set the Steam login credentials
set "STEAM_USERNAME=your_steam_username"
:: Reminder: For security reasons, you might want to input the password during execution.
:: Set the server directory where mods will be installed or updated
set "SERVER_DIR=C:\DayZServer"
:: Path to the modlist file
set "MODLIST_PATH=C:\DayZServer\modlist.txt"
:: DayZ App ID
set "DAYZ_APP_ID=221100"
:: Steam Workshop content directory
set "WORKSHOP_CONTENT_DIR=C:\Program Files (x86)\Steam\steamapps\workshop\content\221100"
:: Set Keys Directory
set "KEYS_DIR=%SERVER_DIR%\keys"
:modFoldersAndContent
:: Update mods using SteamCMD
echo Updating DayZ Mods...
:: Initialize SteamCMD script with force_install_dir before login
echo force_install_dir "%SERVER_DIR%" > "%SERVER_DIR%\steamcmd_script.txt"
echo login %STEAM_USERNAME% >> "%SERVER_DIR%\steamcmd_script.txt"
:: Commented out the line below to not update day server files
echo app_update %DAYZ_APP_ID% validate >> "%SERVER_DIR%\steamcmd_script.txt"
for /F "tokens=1* delims= " %%a in ('type "%MODLIST_PATH%"') do (
echo workshop_download_item %DAYZ_APP_ID% %%a >> "%SERVER_DIR%\steamcmd_script.txt"
)
echo quit >> "%SERVER_DIR%\steamcmd_script.txt"
:: Execute the constructed SteamCMD command sequence from a script file
"%STEAMCMD_PATH%\steamcmd.exe" +runscript "%SERVER_DIR%\steamcmd_script.txt"
:: Move the downloaded content from Steam Workshop to the server folder
for /F "tokens=1* delims= " %%a in ('type "%MODLIST_PATH%"') do (
set "numericID=%%a"
set "modName=%%b"
set "modFolder=%%b" :: Corrected line: Use the mod name without extra '@'
:: Delete the old mod folder if it exists
if exist "%SERVER_DIR%\!modFolder!\" (
echo Deleting existing mod folder: !modFolder!
rmdir /S /Q "%SERVER_DIR%\!modFolder!" :: Deletes existing mod folder and all its contents
)
:: Create the mod folder if it doesn't exist
echo Creating mod folder: !modFolder!
mkdir "%SERVER_DIR%\!modFolder!"
:: Copy the downloaded content from Steam Workshop to the server folder
echo Copying contents for: %%b from !numericID!
xcopy "%WORKSHOP_CONTENT_DIR%\!numericID!\*" "%SERVER_DIR%\!modFolder!\" /E /I /Y
)
:: Initialize the mods string for server launch
set "MODS="
:: Construct the mod launch parameter from the modlist
for /F "tokens=1* delims= " %%a in ('type "%MODLIST_PATH%"') do (
set "modFolder=%%b" :: Corrected line: Use the mod name without extra '@'
set "MODS=!MODS!;!modFolder!"
)
:: Remove the leading semicolon from the mods string
set "MODS=!MODS:~1!"
echo Mods to be loaded: !MODS!
:: Section to copy keys from each mod's keys folder to the server's keys directory
:: Ensure the target keys directory exists
if not exist "%KEYS_DIR%" mkdir "%KEYS_DIR%"
:: Loop through each mod folder to copy keys
for /F "tokens=1* delims= " %%a in ('type "%MODLIST_PATH%"') do (
if exist "%SERVER_DIR%\%%b\keys\*" (
xcopy "%SERVER_DIR%\%%b\keys\*" "%KEYS_DIR%" /E /I /Y
)
)
:start
:: Server configurations
set "serverName=server_name"
set "serverLocation=C:\DayZServer"
set "profile=whatever_you_name_it"
set "serverPort=####"
set "steamQueryPort=####"
set "serverConfig=serverDZ.cfg"
set "serverCPU=# of cores"
title %serverName% batch
cd /d "%serverLocation%"
echo (%time%) %serverName% started.
:: Launch parameters
::output to ensure modlist is correct for start command
echo start "DayZ Server" /min DayZServer_x64.exe "-mod=%MODS%" -profiles=%profile% -config=%serverConfig% -port=%serverPort% -cpuCount=%serverCPU% -dologs -adminlog -netlog -freezecheck
start "DayZ Server" /min DayZServer_x64.exe "-mod=%MODS%" -profiles=%profile% -config=%serverConfig% -port=%serverPort% -cpuCount=%serverCPU% -dologs -adminlog -netlog -freezecheck
:: Wait before restarting server process
timeout /t 28880 /nobreak
:: Optionally kill DayZ Server process before restarting
taskkill /im DayZServer_x64.exe /F
goto modFoldersAndContent