@@cd /d %~dp0
@echo off
title Game Server Console
:start
@@DEL __wait__ 2>NUL
echo Starting L2J Game Server.
echo.
REM -------------------------------------
REM Default parameters for a basic server.
@@move UPDATE\l2jserver.jar . 2>NUL
@@call L2LogRotate.bat
SET JAVA=java -Djava.util.logging.manager=com.l2jserver.util.L2LogManager -Xms1024m -Xmx1024m -cp ./../libs/*;l2jserver.jar com.l2jserver.gameserver.GameServer
@@cmd /v:on /c "%JAVA% 2>&1 & echo exit /b !ERRORLEVEL! > __errorlevel.bat" |tee log/stdout.log
@@call __errorlevel.bat
REM
REM If you have a big server and lots of memory, you could experiment for example with
REM java -server -Xmx1536m -Xms1024m -Xmn512m -XX:PermSize=256m -XX:SurvivorRatio=8 -Xnoclassgc -XX:+AggressiveOpts
REM If you are having troubles on server shutdown (saving data),
REM add this to startup paramethers: -Djava.util.logging.manager=com.l2jserver.L2LogManager. Example:
REM java -Djava.util.logging.manager=com.l2jserver.util.L2LogManager -Xmx1024m -cp ./../libs/*;l2jserver.jar com.l2jserver.gameserver.GameServer
REM -------------------------------------
if ERRORLEVEL 2 goto restart
if ERRORLEVEL 1 goto error
goto end
:restart
echo.
echo Admin Restart ...
echo.
goto start
:error
echo.
echo Server terminated abnormaly
echo.
:end
@@IF EXIST __wait__ waitServer.bat %0
echo.
echo server terminated
echo.
@@IF "%~0" == "%cd%\%~nx0" @PAUSE
