@echo off title RFCP Backend Debug Console echo ============================================ echo RFCP Backend - Debug Mode echo ============================================ echo. :: Kill any running instance taskkill /F /IM rfcp-server.exe 2>nul if %ERRORLEVEL% EQU 0 ( echo [DEBUG] Killed existing rfcp-server.exe timeout /t 2 /nobreak >nul ) else ( echo [DEBUG] No existing rfcp-server.exe running ) :: Force unbuffered Python output set PYTHONUNBUFFERED=1 set RFCP_DEBUG=1 set RFCP_HOST=127.0.0.1 set RFCP_PORT=8888 echo [DEBUG] PYTHONUNBUFFERED=%PYTHONUNBUFFERED% echo [DEBUG] RFCP_DEBUG=%RFCP_DEBUG% echo [DEBUG] RFCP_HOST=%RFCP_HOST% echo [DEBUG] RFCP_PORT=%RFCP_PORT% echo. :: Check if exe exists in dist/ or current dir if exist "%~dp0dist\rfcp-server.exe" ( set EXE_PATH=%~dp0dist\rfcp-server.exe ) else if exist "%~dp0rfcp-server.exe" ( set EXE_PATH=%~dp0rfcp-server.exe ) else ( echo [ERROR] rfcp-server.exe not found! echo Looked in: echo %~dp0dist\rfcp-server.exe echo %~dp0rfcp-server.exe pause exit /b 1 ) echo [DEBUG] Starting: %EXE_PATH% echo [DEBUG] Working dir: %~dp0dist echo. echo ---- Server output below ---- echo. cd /d "%~dp0dist" "%EXE_PATH%" echo. echo ---- Server stopped ---- pause