@echo off
setlocal
cd /d "%~dp0"
set "PID_FILE=%~dp0ButlersMansionServer.pid"
if exist "%PID_FILE%" (
    for /f "usebackq delims=" %%p in ("%PID_FILE%") do (
        echo Stopping ButlersMansion dedicated server process %%p...
        taskkill /PID %%p /T /F
    )
    del "%PID_FILE%" >nul 2>nul
) else (
    echo No PID file found. Looking for ButlersMansionServer.exe...
    taskkill /IM "ButlersMansionServer.exe" /T /F
)
pause
