updata: 更新服务端启动脚本

This commit is contained in:
2024-11-16 13:41:55 +08:00
parent b28d752e54
commit 1fc4832690
14 changed files with 259 additions and 1 deletions

View File

@@ -0,0 +1 @@
放置需要玩家挂载的mod

View File

@@ -0,0 +1,5 @@
将需要删除的模组, 放置到这里, 然后重新运行
initGamesServer.bat
就会将对应的模组卸载掉. 并会更新启动脚本.

View File

@@ -0,0 +1 @@
模组配置存放目录

View File

@@ -0,0 +1 @@
纯服务端模组, 模组名字要按照普通模组的文件命名

View File

@@ -0,0 +1,12 @@
RConport 2314
RConPassword STmvYKpryKunWA0
RestrictRCon 1
MaxSetDamagePerInterval 3 1
MaxSetPosPerInterval 3 1
MaxAddBackpackCargoPerInterval 1 1
MaxAddMagazineCargoPerInterval 1 1
MaxAddWeaponCargoPerInterval 1 1
MaxCreateVehiclePerInterval 1 1
MaxDeleteVehiclePerInterval 1 1
MaxPacketLoss 10
LogLevel 2

Binary file not shown.

Binary file not shown.

BIN
DayZServerStart/bin/jq.exe Normal file

Binary file not shown.

View File

@@ -0,0 +1,7 @@
{
"serverPath" : "E:\\SteamLibrary\\steamapps\\common\\DayZServer",
"mpmissions" : "E:\\SteamLibrary\\steamapps\\common\\DayZServerStart\\mpmissions\\dayzOffline.chernarusplus",
"serverCfg" : "E:\\SteamLibrary\\steamapps\\common\\DayZServerStart\\serverDZ.cfg",
"serverPort" : 2302,
"cpuCount" : 4
}

View File

@@ -0,0 +1,135 @@
@echo off
fsutil behavior set disablelastaccess 0 >nul
::CODER BY Mr.Yu POWERD BY iBAT
cd /d %~dp0
set "config=%~dp0config.json"
set "jq=%~dp0bin\jq.exe"
@REM get dayz game server root path
for /f "delims=" %%i in ('type %config% ^|%jq% -r ".serverPath"') do (
set serverPath=%%i
)
@REM get dayz missions path
for /f "delims=" %%i in ('type %config% ^|%jq% -r ".mpmissions"') do (
set mpmissions=%%i
)
@REM get server config file path
for /f "delims=" %%i in ('type %config% ^|%jq% -r ".serverCfg"') do (
set serverCfg=%%i
)
@REM get game service port
for /f "delims=" %%i in ('type %config% ^|%jq% -r ".serverPort"') do (
set serverPort=%%i
)
@REM get cpu counts
for /f "delims=" %%i in ('type %config% ^|%jq% -r ".cpuCount"') do (
set cpuCount=%%i
)
set "ModPath=A_Mods"
set "ServerModPath=A_ServerMods"
set "ProfilePath=A_Profiles"
set "DelModPath=A_NeedDel"
if NOT EXIST %ModPath% mkdir %ModPath%
if NOT EXIST %ServerModPath% mkdir %ServerModPath%
if NOT EXIST %ProfilePath% mkdir %ProfilePath%
if NOT EXIST %DelModPath% mkdir %DelModPath%
echo [Processing need delete modules]
for /f "delims=" %%i in ('dir /a/b/s %DelModPath% ^|findstr ".bikey .bisign"') do (
Setlocal enabledelayedexpansion
if %%~xi == .bisign (
set "dbisignName=%%~ni.bisign"
del /f/q "%serverPath%\Addons\!dbisignName!"
echo SignFile [!dbisignName!] was deleted
)
if %%~xi == .bikey (
set "dbikeyName=%%~ni.bikey"
del /f/q "%serverPath%\Keys\!dbikeyName!"
echo KeyFile [!dbikeyName!] was deleted
)
endlocal
)
echo.
rd /s/q "%DelModPath%"
mkdir "%DelModPath%"
set "mpath="
for /l %%z in (1 1 2) do (
Setlocal enabledelayedexpansion
if %%z EQU 1 (
set mpath=%ModPath%
echo [Processing client modules]
) else (
set mpath=%ServerModPath%
echo [Processing server modules]
)
for /f "delims=" %%i in ('dir /a/b/s !mpath! ^|findstr ".bikey .bisign"') do (
if %%~xi == .bisign (
cd /d %%~dpi
set "cbisignName=%%~ni.bisign"
set "cbisignNamePath=%%~dpni.bisign"
xcopy /y "!cbisignNamePath!" "%serverPath%\Addons" >nul
echo signFile ["!cbisignName!"] update success
)
if %%~xi == .bikey (
cd /d %%~dpi
set "cbikeyName=%%~ni.bikey"
set "cbikeyNamePath=%%~dpni.bikey"
xcopy /y "!cbikeyNamePath!" "%serverPath%\Keys" >nul
echo KeyFile ["!cbikeyName!"] update success
)
)
endlocal
echo.
)
cd /d %~dp0
set "modsName="
Setlocal enabledelayedexpansion
for /f "delims=" %%i in ('dir /a:d /b %~dp0%ModPath% ^|findstr /b "@"') do (
set currPath=%%~dpi%ModPath%\%%i
set modsName=!modsName!!currPath!;
)
set "serverModsName="
for /f "delims=" %%i in ('dir /a:d /b %~dp0%ServerModPath% ^|findstr /b "@"') do (
set currPath=%%~dpi%ServerModPath%\%%i
set serverModsName=!serverModsName!!currPath!;
)
set "clientMods=-mod=%modsName%"
set "serverMods=-servermod=%serverModsName%"
set "startParameter=-port=%serverPort% -cpuCount=%cpuCount%"
set "otherParameter=-adminlog -dologs -netlog -noFilePatching"
set "profilesPath=-profiles=%~dp0A_Profiles"
set "missionsPath=-mission=%mpmissions%"
set "serverCfgPath=-config=%~dp0serverDZ.cfg"
echo @echo off > startDayZServer.bat
echo mode con lines=32 cols=50 >> startDayZServer.bat
echo title Server-side monitor >> startDayZServer.bat
echo. >> startDayZServer.bat
echo :setup >> startDayZServer.bat
echo start /wait /high "" "%serverPath%\DayZServer_x64.exe" ^^>> startDayZServer.bat
echo "%serverCfgPath%" ^^>> startDayZServer.bat
echo %startParameter% ^^>> startDayZServer.bat
echo %otherParameter% ^^>> startDayZServer.bat
echo "%profilesPath%" ^^>> startDayZServer.bat
echo "%missionsPath%" ^^>> startDayZServer.bat
echo "%clientMods%" ^^>> startDayZServer.bat
echo "%serverMods%">> startDayZServer.bat
echo goto :setup >> startDayZServer.bat
endlocal
pause
call startDayZServer.bat

View File

@@ -0,0 +1,7 @@
@echo off
wmic process where name="wmic.exe" get ParentProcessId|(
for /f %%a in ('findstr [0-9]')do taskkill /f /t /fi "pid ne %%a" /im cmd.exe
)
taskkill /im DayZServer_x64.exe /f

View File

@@ -0,0 +1 @@
这里放置地图任务文件, 可以从服务端复制过来.

View File

@@ -0,0 +1,85 @@
hostname = "DayZ Server Powered By DcrClub"; // Server name
password = ""; // Password to connect to the server
passwordAdmin = ""; // Password to become a server admin
BattlEye = 1;
enableCfgGameplayFile = 1; //使用json配置文件的配置
enableWhitelist = 0; // Enable/disable whitelist (value 0-1)
maxPlayers = 10; // Maximum amount of players
verifySignatures = 0; // Verifies .pbos against .bisign files. (only 2 is supported)
forceSameBuild = 1; // When enabled, the server will allow the connection only to clients with same the .exe revision as the server (value 0-1)
disableVoN = 0; // Enable/disable voice over network (value 0-1)
vonCodecQuality = 20; // Voice over network codec quality, the higher the better (values 0-30)
disable3rdPerson=0; // Toggles the 3rd person view for players (value 0-1)
disableCrosshair=0; // Toggles the cross-hair (value 0-1)
disablePersonalLight = 1; // Disables personal light for all clients connected to server
lightingConfig = 0; // 0 for brighter night setup, 1 for darker night setup
serverTime="2022/3/15/08/00"; // Initial in-game time of the server. "SystemTime" means the local time of the machine. Another possibility is to set the time to some value in "YYYY/MM/DD/HH/MM" format, f.e. "2015/4/8/17/23" .
serverTimeAcceleration=1; // Accelerated Time (value 0-24)// This is a time multiplier for in-game time. In this case, the time would move 24 times faster than normal, so an entire day would pass in one hour.
serverNightTimeAcceleration=1; // Accelerated Nigh Time - The numerical value being a multiplier (0.1-64) and also multiplied by serverTimeAcceleration value. Thus, in case it is set to 4 and serverTimeAcceleration is set to 2, night time would move 8 times faster than normal. An entire night would pass in 3 hours.
serverTimePersistent=1; // Persistent Time (value 0-1)// The actual server time is saved to storage, so when active, the next server start will use the saved time value.
guaranteedUpdates=1; // Communication protocol used with game server (use only number 1)
loginQueueConcurrentPlayers=2; // The number of players concurrently processed during the login process. Should prevent massive performance drop during connection when a lot of people are connecting at the same time.
loginQueueMaxPlayers=10; // The maximum number of players that can wait in login queue
instanceId = 3; // DayZ server instance id, to identify the number of instances per box and their storage folders with persistence files
lootHistory = 1; // How many persistence history files should be kept by instance, number is looped over during save
storeHouseStateDisabled = false; // Disable houses/doors persistence (value true/false), usable in case of problems with persistence
storageAutoFix = 1; // Checks if the persistence files are corrupted and replaces corrupted ones with empty ones (value 0-1)
respawnTime = 3; // Sets the respawn delay (in seconds) before the player is able to get a new character on the server, when the previous one is dead
maxPing= 200; // Max ping value until server kick the user (value in milliseconds)
timeStampFormat = "Short"; // Format for timestamps in the .rpt file (value Full/Short)
logAverageFps = 0; // Logs the average server FPS (value in seconds), needs to have ''-doLogs'' launch parameter active
logMemory = 0; // Logs the server memory usage (value in seconds), needs to have the ''-doLogs'' launch parameter active
logPlayers = 0; // Logs the count of currently connected players (value in seconds), needs to have the ''-doLogs'' launch parameter active
logFile = "ServerLogs\server_console.log"; // Saves the server console log to a file in the folder with the other server logs
adminLogPlayerHitsOnly = 1; // 1 - log player hits only / 0 - log all hits ( animals/infected )
adminLogPlacement = 1; // 1 - log placement action ( traps, tents )
adminLogBuildActions = 1; // 1 - log basebuilding actions ( build, dismantle, destroy )
adminLogPlayerList = 1; // 1 - log periodic player list with position every 5 minutes
enableDebugMonitor = 0; // shows info about the character using a debug window in a corner of the screen (value 0-1)
steamQueryPort = 2305; // defines Steam query port, should fix the issue with server not being visible in client server browser
allowFilePatching = 0; // if set to 1 it will enable connection of clients with "-filePatching" launch parameter enabled
simulatedPlayersBatch = 10; // 20, Set limit of how much players can be simulated per frame (for server performance gain)
multithreadedReplication = 1; // enables multi-threaded processing of server's replication system
// number of worker threads is derived by settings of jobsystem in dayzSettings.xml by "maxcores" and "reservedcores" parameters (value 0-1)
speedhackDetection = 3; // enable speedhack detection, values 1-10 (1 strict, 10 benevolent, can be float)
networkRangeClose = 20; // network bubble distance for spawn of close objects with items in them (f.i. backpacks), set in meters, default value if not set is 20
networkRangeNear = 150; // network bubble distance for spawn (despawn +10%) of near inventory items objects, set in meters, default value if not set is 150
networkRangeFar = 500; // network bubble distance for spawn (despawn +10%) of far objects (other than inventory items), set in meters, default value if not set is 1000
networkRangeDistantEffect = 2500; // network bubble distance for spawn of effects (currently only sound effects), set in meters, default value if not set is 4000
defaultVisibility=1375; // highest terrain render distance on server (if higher than "viewDistance=" in DayZ client profile, clientside parameter applies)
defaultObjectViewDistance=1375; // highest object render distance on server (if higher than "preferredObjectViewDistance=" in DayZ client profile, clientside parameter applies)
disableBaseDamage = 0; // set to 1 to disable damage/destruction of fence and watchtower
disableContainerDamage = 0; // set to 1 to disable damage/destruction of tents, barrels, wooden crate and seachest
disableRespawnDialog = 1; // set to 1 to disable the respawn dialog (new characters will be spawning as random)
class Missions
{
class DayZ
{
template="dayzOffline.chernarusplus"; // Mission to load on server startup. <MissionName>.<TerrainName>
// Vanilla mission: dayzOffline.chernarusplus
// DLC mission: dayzOffline.enoch
};
};