Files
Sun1602/Server/_bin/util/injection/InjectionDBInfo.bat
T
2022-10-26 12:25:11 +08:00

55 lines
1.5 KiB
Batchfile

::call "..\_bin\util\injection\InjectionDBInfo.bat" $(TargetName) $(TargetDir)
@echo off
setlocal
set log=_Injection%1.log
set dbp_file=%2\%1.exe
set CountryCode_Path=..\..\..\..\ProgramCommon\CountryCode.h
if "%1" == "DatabaseProxy" (set mola_file=TheMOLA.dbproxy.info)
if "%1" == "DatabaseProxy_d" (set mola_file=TheMOLA.dbproxy.info)
if "%1" == "AccountDatabaseProxy" (set mola_file=TheMOLA.account.info)
if "%1" == "AccountDatabaseProxy_d" (set mola_file=TheMOLA.account.info)
cd /d %2\..\_bin\util\injection
del %log%
echo ¢¹ %date: =% / %time: =0% >> %log%
for /f "tokens=1,2 delims= " %%i in (%CountryCode_Path%) do (if "%%i" == "#define" (set CountryCode=%%j& goto FIND))
goto ERR_FILE
:FIND
if "%CountryCode%" == "_KOREA" (set code=korea)
if "%CountryCode%" == "_JAPAN" (set code=japan)
if "%CountryCode%" == "_TAIWAN" (set code=taiwan)
if "%CountryCode%" == "_CHINA" (set code=china)
if "%CountryCode%" == "_USA" (set code=england)
if "%CountryCode%" == "_GLOBAL" (set code=england)
if "%CountryCode%" == "_AMERICA" (set code=england)
if "%CountryCode%" == "_ENGLAND" (set code=england)
if "%CountryCode%" == "_RUSSIA" (set code=russia)
echo ¢¹ %CountryCode%(%code%) >> %log%
echo ¢¹ %dbp_file% >> %log%
::xcopy %dbp_file% .\ /Y
TheMola.FileInjector.exe %dbp_file% %mola_file%.%code% DBP >> %log%
goto EXIT
:ERR_FILE
echo ¢¹ file error = %CountryCode_Path% >> %log%
goto EXIT
:ERR_COUNTRYCODE
echo ¢¹ ..not found CountryCode >> %log%
goto EXIT
:EXIT
cls
TYPE %log%
pause
endlocal