update: 更新单玩家数据回档脚本

This commit is contained in:
2024-11-16 14:03:45 +08:00
parent 2996734d76
commit 2b1602ac3d
3 changed files with 33 additions and 1 deletions

View File

@@ -0,0 +1,31 @@
@echo off
setlocal
set "PLAYERS1_DB=%~1"
set "PLAYERS2_DB=%~2"
set "PLAYER_UID=%~3"
echo Checking if player exists in players1.db...
sqlite3 "%PLAYERS1_DB%" "SELECT COUNT(*) FROM Players WHERE UID = '%PLAYER_UID%';" > temp.txt
set /p COUNT=<temp.txt
del temp.txt
if "%COUNT%"=="0" (
echo No player data found for UID: %PLAYER_UID%
pause
exit /b
)
echo Transferring player data from "%PLAYERS1_DB%" to "%PLAYERS2_DB%"...
echo ATTACH DATABASE '%PLAYERS1_DB%' AS db1; > temp.sql
echo CREATE TEMP TABLE IF NOT EXISTS tmp_players AS SELECT * FROM db1.Players WHERE UID = '%PLAYER_UID%'; >> temp.sql
echo INSERT OR REPLACE INTO Players (Id, Alive, UID, Data) SELECT Id, Alive, UID, Data FROM tmp_players; >> temp.sql
echo DETACH DATABASE db1; >> temp.sql
sqlite3 "%PLAYERS2_DB%" < temp.sql
del temp.sql
echo Data transfer complete.
pause

Binary file not shown.

View File

@@ -3,4 +3,5 @@
仓库中存放一些DayZ的服务端用脚本, 或者玩家端使用的脚本. 仓库中存放一些DayZ的服务端用脚本, 或者玩家端使用的脚本.
## 目录说明: ## 目录说明:
- DayZServerStart DayZ开服脚本. - DayZServerStart DayZ开服脚本.
- PlayerDataReturnGear 单玩家数据回档.