Merge branch lewd-hypnosis-city-hypnosm:main into main

This commit is contained in:
RenNyan 2026-05-10 18:39:49 +00:00
commit 65df75b0e1
5 changed files with 247 additions and 260 deletions

View file

@ -1,14 +1,9 @@
@echo off
setlocal
REM Copy GAMEUPDATE.bat to a new file
copy "gameupdate\patch.bat" "gameupdate\patch2.bat"
REM Run the new file
REM Copy patch.bat to a temp name so the live patch.bat can be overwritten during updates
copy /Y "gameupdate\patch.bat" "gameupdate\patch2.bat" >nul
call "gameupdate\patch2.bat"
del /Q "gameupdate\patch2.bat" >nul 2>&1
REM Delete the new file
del "gameupdate\patch2.bat"
endlocal
@echo on
endlocal

View file

@ -43538,7 +43538,7 @@
"code": 401,
"indent": 0,
"parameters": [
"\\{Gustav ― you mean Gustav Kreutz!? The Marshal of this country, and Aegis No. I!?"
"\\{Gustav ― you mean Gustav Kreutz!?\nThe Marshal of this country, and Aegis No. I!?"
]
},
{

View file

@ -97,15 +97,13 @@ try {
if (Test-Path -LiteralPath $StateFile) {
$previousSha = (Get-Content -LiteralPath $StateFile -Raw).Trim()
} else {
Write-Host 'Previous SHA hash not found. Assuming first time patching...'
Write-Host 'First run: comparing with remote...'
}
if ($previousSha -eq $latestSha) {
$exitCode = 10
return
exit 10
}
Write-Host 'Update found! Patching...'
Write-Host 'Downloading latest patch... (backend: iwr, GitLab API)'
Write-Host 'Downloading patch...'
$zipPath = Join-Path $PWD.Path 'repo.zip'
# Use a short temp extract root to avoid Windows MAX_PATH issues when
# GitLab archive root folder includes long commit SHA suffixes.

View file

@ -1,238 +1,237 @@
@echo off
setlocal EnableExtensions EnableDelayedExpansion
REM Check if being run from gameupdate folder (incorrect usage)
for %%I in ("%CD%") do set "CURRENT_FOLDER=%%~nxI"
if /I "%CURRENT_FOLDER%"=="gameupdate" (
echo.
echo ========================================
echo ERROR: Do not run patch.bat directly!
echo ========================================
echo.
echo You are running this from the gameupdate folder.
echo This will not work correctly!
echo.
echo Please go back to the game's root folder and
echo run GameUpdate.bat instead.
echo ========================================
echo.
pause
exit /b 1
)
REM Determine important paths
set "SCRIPT_DIR=%~dp0"
set "ROOT_DIR=%CD%"
set "CONFIG_FILE=%SCRIPT_DIR%patch-config.txt"
echo Using root directory: "%ROOT_DIR%"
echo Using config: "%CONFIG_FILE%"
echo Checking for pwsh...
set "_my_shell=pwsh"
where /q !_my_shell!
if !errorlevel! neq 0 (
echo pwsh not found.
if /I "%GAMEUPDATE_PROMPT_PWSH%"=="1" (
echo.
set /p "INSTALL_PWSH=PowerShell 7 is faster. Install now via winget? (Y/N): "
if /I "!INSTALL_PWSH!"=="Y" (
echo Installing PowerShell 7 via winget...
winget install --id Microsoft.PowerShell --source winget --accept-package-agreements --accept-source-agreements
where /q pwsh
if !errorlevel! equ 0 (
set "_my_shell=pwsh"
echo PowerShell 7 installed; using pwsh.
) else (
echo Install failed or unavailable; falling back to powershell.
set "_my_shell=powershell"
)
) else (
echo Skipping install; falling back to powershell.
set "_my_shell=powershell"
)
) else (
echo Tip: Set GAMEUPDATE_PROMPT_PWSH=1 to offer PowerShell 7 install.
echo Falling back to powershell...
set "_my_shell=powershell"
)
where /q !_my_shell!
if !errorlevel! neq 0 (
echo ERROR: Neither pwsh nor powershell was found.
pause
exit /b 1
)
) else (
echo pwsh found.
)
echo Using !_my_shell! for script execution.
REM Check if patch-config.txt exists in gameupdate folder
if not exist "%CONFIG_FILE%" (
echo "Config file (gameupdate\patch-config.txt) not found! Assuming no patching needed."
pause
exit /b
)
REM Read configuration from file
for /f "usebackq tokens=1,2 delims==" %%a in ("%CONFIG_FILE%") do (
if "%%a"=="username" set "username=%%b"
if "%%a"=="repo" set "repo=%%b"
if "%%a"=="branch" set "branch=%%b"
)
REM Validate required config keys early for clearer errors
if "%username%"=="" (
echo ERROR: 'username=' is missing in gameupdate\patch-config.txt
pause
exit /b 1
)
if "%repo%"=="" (
echo ERROR: 'repo=' is missing in gameupdate\patch-config.txt
pause
exit /b 1
)
if "%branch%"=="" (
echo ERROR: 'branch=' is missing in gameupdate\patch-config.txt
pause
exit /b 1
)
REM For PowerShell (proper URL encoding; avoids cmd %% pitfalls)
set "GU_USERNAME=%username%"
set "GU_REPO=%repo%"
set "GU_BRANCH=%branch%"
REM --------------------------------------------------------
REM PRE-SETUP: Ensure SRPG data and patch structure exists
REM Run Steps 1 and 2 BEFORE pulling repo patch to avoid overwriting updates
REM 1) Unpack once if data folder doesn't exist (and data.dts does)
REM 2) Create Patch once if patch folder doesn't exist
REM --------------------------------------------------------
set "UNPACKER=%ROOT_DIR%\SRPG_Unpacker.exe"
if exist "%ROOT_DIR%\data.dts" (
if exist "%UNPACKER%" (
echo [Pre-Setup] Running SRPG_Unpacker preparation steps...
REM Step 1: Unpack (once)
if not exist "%ROOT_DIR%\data\" (
set "SHOULD_UNPACK=1"
) else if not exist "%ROOT_DIR%\data\project.dat" (
set "SHOULD_UNPACK=1"
) else (
set "SHOULD_UNPACK=0"
)
if "!SHOULD_UNPACK!"=="1" (
if exist "%ROOT_DIR%\data.dts" (
echo [Pre-Setup] Step 1: Unpacking data.dts to data
pushd "%ROOT_DIR%"
"%UNPACKER%" -o "data" "data.dts"
if !errorlevel! neq 0 (
echo [Pre-Setup] ERROR: Unpack failed. Continuing.
)
popd
) else (
echo [Pre-Setup] Step 1: Skipping unpack - no data folder and no data.dts found.
)
) else (
echo [Pre-Setup] Step 1: data folder exists; skipping unpack.
)
REM Step 2: Create Patch (once)
if not exist "%ROOT_DIR%\patch\" (
if exist "%ROOT_DIR%\data\project.dat" (
echo [Pre-Setup] Step 2: Creating patch from data\project.dat
pushd "%ROOT_DIR%"
"%UNPACKER%" ".\data\project.dat" -c
if !errorlevel! neq 0 (
echo [Pre-Setup] ERROR: Create Patch failed. Continuing.
)
popd
) else (
echo [Pre-Setup] Step 2: Skipping create patch - data\project.dat not found.
)
) else (
echo [Pre-Setup] Step 2: patch folder exists; skipping create.
)
) else (
echo [Pre-Setup] SRPG_Unpacker.exe not found in root; skipping pre-setup steps.
)
) else (
echo [Pre-Setup] data.dts not found; skipping pre-setup SRPG steps.
)
:download_extract
REM Download/extract via patch-download.ps1 (IWR-based); Bypass avoids ExecutionPolicy prompts
if not exist "%SCRIPT_DIR%patch-download.ps1" (
echo ERROR: patch-download.ps1 not found next to patch.bat in the gameupdate folder.
pause
exit /b 1
)
!_my_shell! -NoProfile -ExecutionPolicy Bypass -File "%SCRIPT_DIR%patch-download.ps1" -GameRoot "%ROOT_DIR%" -StateFile "%SCRIPT_DIR%previous_patch_sha.txt"
set "PATCH_DL_EXIT=!errorlevel!"
if "!PATCH_DL_EXIT!"=="10" (
echo Patch is up to date.
endlocal
pause
exit /b 0
)
if not "!PATCH_DL_EXIT!"=="0" (
echo Download or extraction failed!
if exist "%ROOT_DIR%\repo.zip" del "%ROOT_DIR%\repo.zip"
if exist "%ROOT_DIR%\_patch_extract_tmp" rmdir /s /q "%ROOT_DIR%\_patch_extract_tmp"
pause
exit /b 1
)
echo "Applying patch..."
REM Files merged by Copy-Item above
REM --------------------------------------------------------
REM POST-APPLY: Run Steps 3 and 4 after patch files are merged
REM 3) Apply Patch to data\project.dat
REM 4) Pack data back into data.dts
REM --------------------------------------------------------
set "UNPACKER=%ROOT_DIR%\SRPG_Unpacker.exe"
if exist "%ROOT_DIR%\data.dts" (
if exist "%UNPACKER%" (
echo Running SRPG_Unpacker apply/pack steps...
REM Step 3: Apply Patch
if exist "%ROOT_DIR%\data\project.dat" (
echo Step 3: Applying patch to data\project.dat
pushd "%ROOT_DIR%"
"%UNPACKER%" ".\data\project.dat" -a
if !errorlevel! neq 0 (
echo ERROR: Apply Patch failed.
)
popd
) else (
echo ERROR: data\project.dat not found; cannot apply patch.
)
REM Step 4: Pack
if exist "%ROOT_DIR%\data\" (
echo Step 4: Packing data to data.dts
pushd "%ROOT_DIR%"
"%UNPACKER%" -o "data.dts" "data"
if !errorlevel! neq 0 (
echo WARNING: Pack failed.
)
popd
) else (
echo Step 4: Skipping pack - data folder not found.
)
) else (
echo SRPG_Unpacker.exe not found in root; skipping SRPG patch steps.
)
) else (
echo data.dts not found; skipping SRPG patch steps.
)
REM Clean up
echo "Cleaning up..."
del "%ROOT_DIR%\repo.zip"
if exist "%ROOT_DIR%\_patch_extract_tmp" rmdir /s /q "%ROOT_DIR%\_patch_extract_tmp"
endlocal
pause
exit /b
@echo off
setlocal EnableExtensions
REM Check if being run from gameupdate folder (incorrect usage)
for %%I in ("%CD%") do set "CURRENT_FOLDER=%%~nxI"
if /I "%CURRENT_FOLDER%"=="gameupdate" (
echo.
echo ========================================
echo ERROR: Do not run patch.bat directly!
echo ========================================
echo.
echo You are running this from the gameupdate folder.
echo This will not work correctly!
echo.
echo Please go back to the game's root folder and
echo run GameUpdate.bat instead.
echo ========================================
echo.
pause
exit /b 1
)
REM Determine important paths
set "SCRIPT_DIR=%~dp0"
set "ROOT_DIR=%CD%"
set "CONFIG_FILE=%SCRIPT_DIR%patch-config.txt"
echo Root: %ROOT_DIR%
setlocal EnableDelayedExpansion
set "_my_shell=pwsh"
where /q !_my_shell!
if !errorlevel! neq 0 (
echo PowerShell 7 ^(pwsh^) not found.
if /I "%GAMEUPDATE_PROMPT_PWSH%"=="1" (
echo.
set /p "INSTALL_PWSH=PowerShell 7 is faster. Install now via winget? (Y/N): "
if /I "!INSTALL_PWSH!"=="Y" (
echo Installing PowerShell 7 via winget...
winget install --id Microsoft.PowerShell --source winget --accept-package-agreements --accept-source-agreements
where /q pwsh
if !errorlevel! equ 0 (
set "_my_shell=pwsh"
echo PowerShell 7 installed; using pwsh.
) else (
echo Install failed or unavailable; falling back to powershell.
set "_my_shell=powershell"
)
) else (
echo Skipping install; falling back to powershell.
set "_my_shell=powershell"
)
) else (
echo Tip: Set GAMEUPDATE_PROMPT_PWSH=1 to offer PowerShell 7 install.
echo Falling back to powershell...
set "_my_shell=powershell"
)
where /q !_my_shell!
if !errorlevel! neq 0 (
echo ERROR: Neither pwsh nor powershell was found.
pause
exit /b 1
)
)
REM Check if patch-config.txt exists in gameupdate folder
if not exist "%CONFIG_FILE%" (
echo Config file gameupdate\patch-config.txt not found - skipping patch.
pause
exit /b
)
REM Read configuration from file
for /f "usebackq tokens=1,2 delims==" %%a in ("%CONFIG_FILE%") do (
if "%%a"=="username" set "username=%%b"
if "%%a"=="repo" set "repo=%%b"
if "%%a"=="branch" set "branch=%%b"
)
REM Validate required config keys early for clearer errors
if "%username%"=="" (
echo ERROR: 'username=' is missing in gameupdate\patch-config.txt
pause
exit /b 1
)
if "%repo%"=="" (
echo ERROR: 'repo=' is missing in gameupdate\patch-config.txt
pause
exit /b 1
)
if "%branch%"=="" (
echo ERROR: 'branch=' is missing in gameupdate\patch-config.txt
pause
exit /b 1
)
REM For PowerShell (proper URL encoding; avoids cmd %% pitfalls)
set "GU_USERNAME=%username%"
set "GU_REPO=%repo%"
set "GU_BRANCH=%branch%"
REM --------------------------------------------------------
REM PRE-SETUP: Ensure SRPG data and patch structure exists
REM Run Steps 1 and 2 BEFORE pulling repo patch to avoid overwriting updates
REM 1) Unpack once if data folder doesn't exist (and data.dts does)
REM 2) Create Patch once if patch folder doesn't exist
REM --------------------------------------------------------
set "UNPACKER=%ROOT_DIR%\SRPG_Unpacker.exe"
if exist "%ROOT_DIR%\data.dts" (
if exist "%UNPACKER%" (
REM Step 1: Unpack (once)
if not exist "%ROOT_DIR%\data\" (
set "SHOULD_UNPACK=1"
) else if not exist "%ROOT_DIR%\data\project.dat" (
set "SHOULD_UNPACK=1"
) else (
set "SHOULD_UNPACK=0"
)
if "!SHOULD_UNPACK!"=="1" (
if exist "%ROOT_DIR%\data.dts" (
echo [Pre-Setup] Unpacking data.dts to data\
pushd "%ROOT_DIR%"
"%UNPACKER%" -o "data" "data.dts"
if !errorlevel! neq 0 (
echo [Pre-Setup] ERROR: Unpack failed. Continuing.
)
popd
) else (
echo [Pre-Setup] Skipping unpack: data.dts missing.
)
REM Step 2: Create Patch (once)
if not exist "%ROOT_DIR%\patch\" (
if exist "%ROOT_DIR%\data\project.dat" (
echo [Pre-Setup] Creating patch folder from data\project.dat
pushd "%ROOT_DIR%"
"%UNPACKER%" ".\data\project.dat" -c
if !errorlevel! neq 0 (
echo [Pre-Setup] ERROR: Create Patch failed. Continuing.
)
popd
) else (
echo [Pre-Setup] Skipping create patch: data\project.dat not found.
)
)
) else (
REM SHOULD_UNPACK=0: only Step 2 may still be needed
if not exist "%ROOT_DIR%\patch\" (
if exist "%ROOT_DIR%\data\project.dat" (
echo [Pre-Setup] Creating patch folder from data\project.dat
pushd "%ROOT_DIR%"
"%UNPACKER%" ".\data\project.dat" -c
if !errorlevel! neq 0 (
echo [Pre-Setup] ERROR: Create Patch failed. Continuing.
)
popd
) else (
echo [Pre-Setup] Skipping create patch: data\project.dat not found.
)
)
)
) else (
echo [Pre-Setup] SRPG_Unpacker.exe not found; skipping data setup.
)
)
:download_extract
REM Download/extract via patch-download.ps1 (IWR-based); Bypass avoids ExecutionPolicy prompts
if not exist "%SCRIPT_DIR%patch-download.ps1" (
echo ERROR: patch-download.ps1 not found next to patch.bat in the gameupdate folder.
pause
exit /b 1
)
!_my_shell! -NoProfile -ExecutionPolicy Bypass -File "%SCRIPT_DIR%patch-download.ps1" -GameRoot "%ROOT_DIR%" -StateFile "%SCRIPT_DIR%previous_patch_sha.txt"
set "PATCH_DL_EXIT=!errorlevel!"
if "!PATCH_DL_EXIT!"=="10" (
echo Already up to date.
endlocal
pause
exit /b 0
)
if not "!PATCH_DL_EXIT!"=="0" (
echo Download or extraction failed^!
if exist "%ROOT_DIR%\repo.zip" del "%ROOT_DIR%\repo.zip"
if exist "%ROOT_DIR%\_patch_extract_tmp" rmdir /s /q "%ROOT_DIR%\_patch_extract_tmp"
pause
exit /b 1
)
echo Applying patch...
REM Files merged by Copy-Item above
REM --------------------------------------------------------
REM POST-APPLY: Run Steps 3 and 4 after patch files are merged
REM 3) Apply Patch to data\project.dat
REM 4) Pack data back into data.dts
REM --------------------------------------------------------
set "UNPACKER=%ROOT_DIR%\SRPG_Unpacker.exe"
if exist "%ROOT_DIR%\data.dts" (
if exist "%UNPACKER%" (
REM Step 3: Apply Patch
if exist "%ROOT_DIR%\data\project.dat" (
echo Applying patch to data\project.dat...
pushd "%ROOT_DIR%"
"%UNPACKER%" ".\data\project.dat" -a
if !errorlevel! neq 0 (
echo ERROR: Apply Patch failed.
)
popd
) else (
echo ERROR: data\project.dat not found; cannot apply patch.
)
REM Step 4: Pack
if exist "%ROOT_DIR%\data\" (
echo Packing data folder to data.dts...
pushd "%ROOT_DIR%"
"%UNPACKER%" -o "data.dts" "data"
if !errorlevel! neq 0 (
echo WARNING: Pack failed.
)
popd
) else (
echo Step 4: Skipping pack - data folder not found.
)
) else (
echo SRPG_Unpacker.exe not found in root; skipping SRPG patch steps.
)
)
REM Clean up
echo Cleaning up...
del "%ROOT_DIR%\repo.zip"
if exist "%ROOT_DIR%\_patch_extract_tmp" rmdir /s /q "%ROOT_DIR%\_patch_extract_tmp"
endlocal
pause
exit /b

View file

@ -128,8 +128,6 @@ if [ -f "$ROOT_DIR/data.dts" ]; then
else
echo "[Pre-Setup] SRPG_Unpacker.exe not found in root; skipping pre-setup steps."
fi
else
echo "[Pre-Setup] data.dts not found; skipping pre-setup SRPG steps."
fi
download_extract() {
@ -205,8 +203,6 @@ download_extract() {
else
echo "SRPG_Unpacker.exe not found in root; skipping SRPG patch steps."
fi
else
echo "data.dts not found; skipping SRPG patch steps."
fi
echo "$latest_patch_sha" > "$STATE_FILE"
@ -214,8 +210,7 @@ download_extract() {
# Check if previous_patch_sha.txt exists in gameupdate
if [ ! -f "$STATE_FILE" ]; then
echo "Previous SHA hash not found!"
echo "Assuming first time patching..."
echo "No saved patch version yet (first run); comparing with remote..."
download_extract
else
previous_patch_sha=$(tr -d '[:space:]' < "$STATE_FILE")
@ -224,6 +219,6 @@ else
echo "Update found! Patching..."
download_extract
else
echo "Patch is up to date."
echo "Already up to date (matches latest patch commit)."
fi
fi