Make killswitch actually do something

This commit is contained in:
SpikeHD 2022-04-21 15:23:52 -07:00
parent 3c8a983915
commit 68ecc051be
2 changed files with 14 additions and 6 deletions

View File

@ -380,7 +380,7 @@ async function launchPrivate() {
Neutralino.storage.setData('config', JSON.stringify(config))
// Pass IP and game folder to the private server launcher
Neutralino.os.execCommand(`${NL_CWD}/scripts/private_server_launch.cmd ${ip} "${config.genshinImpactFolder}/${await getGenshinExecName()}"`).catch(e => console.log(e))
Neutralino.os.execCommand(`${NL_CWD}/scripts/private_server_launch.cmd ${ip} "${config.genshinImpactFolder}/${await getGenshinExecName()}" "${NL_CWD}" ${config.enableKillswitch}`).catch(e => console.log(e))
}
/**

View File

@ -1,9 +1,11 @@
@echo off
echo Killswitch %4
:: Ensure admin
>nul 2>&1 reg query "HKU\S-1-5-19" || (
set params = %*:"="""%
cd /d "%~dp0" && ( if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" ) && fsutil dirty query %systemdrive% 1>nul 2>nul || ( echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "cmd.exe", "/k cd ""%~sdp0"" && %~s0 %1 "%2" ""%cd%"" ", "", "runas", 1 >> "%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" && exit /B )
cd /d "%~dp0" && ( if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" ) && fsutil dirty query %systemdrive% 1>nul 2>nul || ( echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "cmd.exe", "/k cd ""%~sdp0"" && %~s0 %1 "%2" ""%cd%"" %4", "", "runas", 1 >> "%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" && exit /B )
)
echo Starting Proxy Server
@ -13,6 +15,7 @@ set GAME_PATH=%2
set GAME_PATH=%GAME_PATH:"=%
set ORIGIN=%3
set ORIGIN=%ORIGIN:"=%
set ENABLE_KILLSWITCH=%4
set PROXY=true
@rem Store original proxy settings
@ -31,12 +34,17 @@ echo Opening %GAME_PATH%
:: Allow the proxy server to create the certificates
ping 127.0.0.1 -n 5 > nul
For %%A in ("%GAME_PATH%") do (
Set GAME_EXE=%%~nxA
for %%A in ("%GAME_PATH%") do (
set GAME_EXE=%%~nxA
)
echo Killswitch: %ENABLE_KILLSWITCH%
if "%ENABLE_KILLSWITCH%" EQU "true" (
echo Killswitch is enabled!
:: Start killswitch
start /b %ORIGIN%\scripts\killswitch.cmd "%GAME_EXE%" %IP%"
)
:: Launch game
"%GAME_PATH%"