@echo off CHCP 65001 setlocal EnableDelayedExpansion @REM 默认渠道号 set "def_channel_num=1" set input=%1 set is_all_srv=%2 @REM 用于记录渠道名 set channel="" goto func_input :func_input if "%input%"=="" ( echo. echo 对应的渠道号: echo 1 零点一 echo 2 千幻 echo 3 六道 echo 4 纸鹤 echo 5 零点一混服 echo 6 小七 goto over ) if "%input%"=="1" ( set "channel=zero_1" ) else if "%input%"=="2" ( set "channel=k_mirages" ) else if "%input%"=="3" ( set "channel=six_channels" ) else if "%input%"=="4" ( set "channel=paper_crane" ) else if "%input%"=="5" ( set "channel=zero_1_hf" ) else if "%input%"=="6" ( set "channel=xseven" ) else if "%input%"=="0" ( @REM 是否是默认渠道号 set input=%def_channel_num% goto :func_input ) else if "%input%"=="cp_com_res" ( @REM 复制通用的资源并移除 goto :func_copy_common_resources ) else ( goto func_end ) goto func_init goto func_end :func_init if "%is_all_srv%"=="1" ( rem DEMO的 echo CHANNEL_ID = '%channel%'>.\src\channel\__demo__\channel_name.lua copy /Y .\src\channel\__demo__\main.lua .\src\main.lua ) else if "%is_all_srv%"=="2" ( rem 指定渠道的客户端 copy /Y .\src\channel\%channel%\main2.lua .\src\main.lua ) else ( copy /Y .\src\channel\%channel%\main.lua .\src\main.lua ) start ./runtime/Debug.win32/game.exe goto over :func_copy_common_resources set "base_dir=%cd%\res__com" rem 设置目标目录 set "TargetDir=.\res__com" for /R "%TargetDir%" %%F in (*) do ( set "FullPath=%%~fF" @REM 提取出相对路径 set source=!FullPath:%base_dir%=! copy /Y .\res__com!source! .\res_k_mirages!source! copy /Y .\res__com!source! .\res_paper_crane!source! copy /Y .\res__com!source! .\res_six_channels!source! copy /Y .\res__com!source! .\res_zero_1!source! copy /Y .\res__com!source! .\res_xseven!source! del /q .\res__com!source! ) goto over :func_end pause > nul :over