|
|
让ai写成这样,就不用管理员了,直接运行。
新建一个a.txt复制下面的代码保存。然后改名为:启动00.cmd
===============
@@璐村惂鐢ㄦ埛_000076K馃惥 off
setlocal
cd /d "%~dp0"
title DFO 115us Launcher
rem ---- WFP firewall isolation requires administrator; auto-elevate ----
rem Use fltmc instead of "net session" (net session depends on the Server
rem service, which is often disabled, causing a false "not admin" result
rem and an endless relaunch loop). The "elevated" argument marks the
rem already-elevated instance so it never tries to re-elevate itself.
if /i "%~1"=="elevated" goto :run
fltmc >nul 2>&1
if errorlevel 1 (
echo Requesting administrator privileges...
powershell -NoProfile -ExecutionPolicy Bypass -Command "Start-Process -FilePath '%~f0' -ArgumentList 'elevated' -Verb RunAs"
exit /b
)
:run
chcp 65001 >nul
set "PYTHONIOENCODING=utf-8"
set "DFO_PYTHON=%~dp0tools\python\python.exe"
if not exist "%DFO_PYTHON%" (
echo [ERROR] Python not found: %DFO_PYTHON%
pause
exit /b 1
)
echo ============================================================
echo Starting DFO local environment...
echo 1. Start PostgreSQL ^(port 25438^) and Redis ^(port 26388^)
echo 2. Start channel server 127.0.0.1:7001 + game server
echo 3. Launch game client ^(first launch takes 20-40 seconds^)
echo Account: probe
echo This window can be closed after the game starts.
echo ============================================================
echo.
"%DFO_PYTHON%" "%~dp0server\work\dfo-lan\scripts\launch_local.py"
if errorlevel 1 (
echo.
echo [FAILED] Read the error message above, or check the troubleshooting
echo section in the tutorial file ^(the .md document in this folder^).
pause
exit /b 1
)
echo.
echo Client launched. Have fun! This window closes in 5 seconds...
timeout /t 5 >nul |
|