Просто для запуска:
StartLS.bat
StartGS.bat
Цикличный перезапуск:
StartLS.bat
StartGS.bat
LoginServerTask.bat
GameServerTask.bat
StartLS.bat
Код:
@echo off
set err=1
if exist log\java0.log.0 (
move log\java0.log.0 "log\%date:~6,4%-%date:~3,2%-%date:~0,2%_%time:~0,2%-%time:~3,2%-%time:~6,2%_java.log"
)
if exist log\stdout.log (
move log\stdout.log "log\%date:~6,4%-%date:~3,2%-%date:~0,2%_%time:~0,2%-%time:~3,2%-%time:~6,2%_stdout.log"
)
java -Djava.awt.headless=true %type% -jar ../libs/LoginServer.jar > log\stdout.log 2>&1
set err=%errorlevel%
if not %err%==0 (
echo Error: LoginServer exited with error code %err%
pause
)
StartGS.bat
Код:
@echo off
if exist log\java0.log.0 (
move log\java0.log.0 "log\%date:~6,4%-%date:~3,2%-%date:~0,2%_%time:~0,2%-%time:~3,2%-%time:~6,2%_java.log"
)
if exist log\stdout.log (
move log\stdout.log "log\%date:~6,4%-%date:~3,2%-%date:~0,2%_%time:~0,2%-%time:~3,2%-%time:~6,2%_stdout.log"
)
java -Djava.awt.headless=true %type% -jar ../libs/GameServer.jar > log\stdout.log 2>&1
if not errorlevel 2 (
echo Error: GameServer exited with error code %errorlevel%
pause
)
Цикличный перезапуск:
StartLS.bat
Код:
@echo off
start "" LoginServerTask.bat
StartGS.bat
Код:
@echo off
start "" GameServerTask.bat
LoginServerTask.bat
Код:
@echo off
:loop
if exist log\java0.log.0 (
move log\java0.log.0 "log\%date:~6,4%-%date:~3,2%-%date:~0,2%_%time:~0,2%-%time:~3,2%-%time:~6,2%_java.log"
)
if exist log\stdout.log (
move log\stdout.log "log\%date:~6,4%-%date:~3,2%-%date:~0,2%_%time:~0,2%-%time:~3,2%-%time:~6,2%_stdout.log"
)
java -Djava.awt.headless=true %type% -jar ../libs/LoginServer.jar > log\stdout.log 2>&1
if not errorlevel 2 (
goto end
)
timeout /t 10 /nobreak >nul
goto loop
:end
GameServerTask.bat
Код:
@echo off
:loop
if exist log\java0.log.0 (
move log\java0.log.0 "log\%date:~6,4%-%date:~3,2%-%date:~0,2%_%time:~0,2%-%time:~3,2%-%time:~6,2%_java.log"
)
if exist log\stdout.log (
move log\stdout.log "log\%date:~6,4%-%date:~3,2%-%date:~0,2%_%time:~0,2%-%time:~3,2%-%time:~6,2%_stdout.log"
)
java -Djava.awt.headless=true %type% -jar ../libs/GameServer.jar > log\stdout.log 2>&1
if not errorlevel 2 (
goto end
)
timeout /t 10 /nobreak >nul
goto loop
:end