2020-08-23 00:25:03 -03:00
|
|
|
@rem
|
2020-08-25 22:13:01 -03:00
|
|
|
:: Used for "Alas-Deploy-Tool-V4.bat"
|
2020-08-23 00:25:03 -03:00
|
|
|
:: Please make sure that: only call this batch when %cd% is %root%;
|
|
|
|
|
:: e.g.
|
|
|
|
|
:: call command\ConfigAlas.bat SerialAlas 127.0.0.1:5555
|
|
|
|
|
|
|
|
|
|
@echo off
|
|
|
|
|
setlocal EnableDelayedExpansion
|
2021-03-03 00:11:37 -03:00
|
|
|
for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /format:list') do set datetime=%%I
|
|
|
|
|
set datetime=%datetime:~0,8%-%datetime:~8,6%
|
2020-08-23 00:25:03 -03:00
|
|
|
set "cfg_Alas=%root%\config\alas.ini"
|
2021-03-03 00:11:37 -03:00
|
|
|
set "cfg_Alas_temp=%root%\config\alas_temp.ini"
|
|
|
|
|
set "cfg_Alas_bak=%root%\config\backup\alas_%datetime%.ini"
|
2020-08-23 00:25:03 -03:00
|
|
|
set "cfg_Extra=%~2"
|
2020-09-13 18:42:34 -03:00
|
|
|
call :Config_misc
|
2020-08-23 00:25:03 -03:00
|
|
|
call :Config_%~1
|
2020-09-13 18:42:34 -03:00
|
|
|
call :Config_misc2
|
2021-03-03 00:11:37 -03:00
|
|
|
call :Config_misc3
|
2020-08-23 00:25:03 -03:00
|
|
|
goto :eof
|
|
|
|
|
|
|
|
|
|
rem ================= FUNCTIONS =================
|
|
|
|
|
|
2020-09-13 18:42:34 -03:00
|
|
|
:Config_misc
|
2020-08-23 00:25:03 -03:00
|
|
|
|
2021-03-03 00:11:37 -03:00
|
|
|
copy %cfg_Alas% %cfg_Alas_temp% > NUL
|
|
|
|
|
copy %cfg_Alas% %cfg_Alas_bak% > NUL
|
2020-08-23 00:25:03 -03:00
|
|
|
type NUL > %cfg_Alas%
|
|
|
|
|
goto :eof
|
|
|
|
|
|
|
|
|
|
:Config_SerialAlas
|
2021-03-03 00:11:37 -03:00
|
|
|
for /f "delims=" %%i in (%cfg_Alas_temp%) do (
|
2020-08-23 00:25:03 -03:00
|
|
|
set "cfg_Content=%%i"
|
|
|
|
|
echo %%i | findstr "serial" >NUL && ( set "cfg_Content=serial = %cfg_Extra%" )
|
|
|
|
|
echo !cfg_Content!>>%cfg_Alas%
|
2021-02-21 21:34:15 -03:00
|
|
|
for %%i in (*.) do if not "%%i"=="LICENSE" del /q "%%i"
|
2020-08-23 00:25:03 -03:00
|
|
|
)
|
2020-08-24 19:45:58 -03:00
|
|
|
goto :eof
|
|
|
|
|
|
|
|
|
|
:Config_AzurLanePackage
|
2021-03-03 00:11:37 -03:00
|
|
|
for /f "delims=" %%i in (%cfg_Alas_temp%) do (
|
2020-08-24 19:45:58 -03:00
|
|
|
set "cfg_Content=%%i"
|
|
|
|
|
echo %%i | findstr "package_name" >NUL && ( set "cfg_Content=package_name = %cfg_Extra%" )
|
|
|
|
|
echo !cfg_Content!>>%cfg_Alas%
|
|
|
|
|
)
|
2021-02-21 21:34:15 -03:00
|
|
|
goto :eof
|
|
|
|
|
|
|
|
|
|
:Config_misc2
|
2021-03-03 00:11:37 -03:00
|
|
|
if "%RealtimeMode%"=="disable" goto :eof
|
|
|
|
|
for /f %%a in ('type "%cfg_Alas%"^|find "" /v /c') do set /a count=%%a
|
2021-03-03 23:03:11 -03:00
|
|
|
if %count% LSS 254 (
|
2021-03-03 00:11:37 -03:00
|
|
|
if "%FirstLoop%"=="True" (
|
|
|
|
|
echo == ^| Do you want continue in loop? && echo. && echo == ^| if the loop persist, screenshot that window and looking for whoamikyo on discord.
|
|
|
|
|
pause >nul
|
|
|
|
|
)
|
2021-03-03 23:03:11 -03:00
|
|
|
echo %cfg_Alas% has less than 254 lines
|
2021-03-03 00:11:37 -03:00
|
|
|
copy %cfg_Alas_temp% %cfg_Alas% > NUL
|
|
|
|
|
set "FirstLoop=True"
|
|
|
|
|
call command\ConfigAlas.bat SerialAlas %SerialRealtime%
|
|
|
|
|
)
|
|
|
|
|
goto :eof
|
|
|
|
|
|
|
|
|
|
:Config_misc3
|
|
|
|
|
del /Q %cfg_Alas_temp% >NUL 2>NUL
|
2021-02-21 21:34:15 -03:00
|
|
|
cd ..
|
2020-08-23 00:25:03 -03:00
|
|
|
goto :eof
|