mirror of
https://github.com/Grasscutters/GrassClipper.git
synced 2024-11-23 00:01:36 +00:00
Fix incorrect command (?)
This commit is contained in:
parent
f9eb06c3e7
commit
5f4a4b2aae
@ -23,10 +23,10 @@ if "%PROXY_IP%" EQU "localhost" (
|
|||||||
|
|
||||||
:loop
|
:loop
|
||||||
:: Check if the game is even running
|
:: Check if the game is even running
|
||||||
@rem QPROCESS "%GAME_EXE_NAME%">NUL
|
:: tasklist /fi "ImageName eq %GAME_EXE_NAME%" /fo csv 2>NUL | find /I "%GAME_EXE_NAME%.exe">NUL
|
||||||
@rem IF %ERRORLEVEL% NEQ 0 (
|
:: IF %ERRORLEVEL% NEQ 0 (
|
||||||
@rem exit /b
|
:: exit /b
|
||||||
@rem )
|
:: )
|
||||||
|
|
||||||
:: Check if the proxy server process is running
|
:: Check if the proxy server process is running
|
||||||
:: https://stackoverflow.com/questions/162291/how-to-check-if-a-process-is-running-via-a-batch-script
|
:: https://stackoverflow.com/questions/162291/how-to-check-if-a-process-is-running-via-a-batch-script
|
||||||
@ -87,6 +87,6 @@ if "%PROXY_IP%" EQU "localhost" (
|
|||||||
:: Reconnect to the WiFi
|
:: Reconnect to the WiFi
|
||||||
netsh wlan connect name="%WIFI%"
|
netsh wlan connect name="%WIFI%"
|
||||||
|
|
||||||
taskkill /f /fi "WINDOWTITLE eq Administrator: PS Killswitch"
|
:: taskkill /f /fi "WINDOWTITLE eq Administrator: PS Killswitch"
|
||||||
|
|
||||||
exit
|
exit
|
@ -1,4 +1,4 @@
|
|||||||
@echo off
|
:: @echo off
|
||||||
|
|
||||||
:: Ensure admin
|
:: Ensure admin
|
||||||
>nul 2>&1 reg query "HKU\S-1-5-19" || (
|
>nul 2>&1 reg query "HKU\S-1-5-19" || (
|
||||||
@ -32,7 +32,7 @@ start "Proxy Server" %ORIGIN%/ext/mitmdump.exe -s "%ORIGIN%/proxy/proxy.py" --ss
|
|||||||
|
|
||||||
echo Opening %GAME_PATH%
|
echo Opening %GAME_PATH%
|
||||||
|
|
||||||
:: Allow the proxy server to create the certificates
|
:: Allow the proxy server to open fully
|
||||||
ping 127.0.0.1 -n 5 > nul
|
ping 127.0.0.1 -n 5 > nul
|
||||||
|
|
||||||
for %%A in ("%GAME_PATH%") do (
|
for %%A in ("%GAME_PATH%") do (
|
||||||
@ -52,21 +52,26 @@ if "%ENABLE_KILLSWITCH%" EQU "true" (
|
|||||||
|
|
||||||
:: On exit clean proxy stuff
|
:: On exit clean proxy stuff
|
||||||
:EXIT
|
:EXIT
|
||||||
if "%PROXY%" == "" (
|
echo Exiting...
|
||||||
|
|
||||||
|
if "%PROXY%" EQU "" (
|
||||||
echo Proxy not started, no need to clean up.
|
echo Proxy not started, no need to clean up.
|
||||||
) else (
|
|
||||||
:: Clean proxy settings
|
|
||||||
echo Cleaning up proxy settings
|
|
||||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d "%ORIG_PROXY_ENABLE%" /f >nul 2>nul
|
|
||||||
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "%ORIG_PROXY_SERVER%" /f >nul 2>nul
|
|
||||||
|
|
||||||
:: Kill proxy server
|
|
||||||
taskkill /f /im mitmdump.exe
|
|
||||||
|
|
||||||
echo Done! See you next time!
|
|
||||||
|
|
||||||
timeout /t 2 /nobreak >nul
|
|
||||||
taskkill /f /fi "WINDOWTITLE eq Administrator: PS Launcher Script"
|
|
||||||
|
|
||||||
exit /b
|
exit /b
|
||||||
)
|
)
|
||||||
|
|
||||||
|
:: Clean proxy settings
|
||||||
|
echo Cleaning up proxy settings...
|
||||||
|
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d "%ORIG_PROXY_ENABLE%" /f >nul 2>nul
|
||||||
|
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "%ORIG_PROXY_SERVER%" /f >nul 2>nul
|
||||||
|
|
||||||
|
:: Kill proxy server
|
||||||
|
taskkill /f /im mitmdump.exe
|
||||||
|
|
||||||
|
echo Done! See you next time!
|
||||||
|
|
||||||
|
timeout /t 2 /nobreak >nul
|
||||||
|
|
||||||
|
:: taskkill /f /fi "WINDOWTITLE eq Administrator: PS Launcher Script"
|
||||||
|
|
||||||
|
exit /b
|
Loading…
Reference in New Issue
Block a user