@echo off
title L2jCore GameServer
:start
color 17
echo.
REM ----------- Set Class Paths and Calls setenv.bat -----------------
SET OLDCLASSPATH=%CLASSPATH%
call setgame.bat
REM ------------------------------------------------------------------

REM -------------------------------------
REM Default parameters for a basic server.
REM -------------------------------------

java -Dfile.encoding=UTF8 -Xmx1024m -XX:+UseParallelGC -XX:+AggressiveOpts com.l2jcore.Game.GameServer

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 -------------------------------------

SET CLASSPATH=%OLDCLASSPATH%

if ERRORLEVEL 7 goto telldown
if ERRORLEVEL 6 goto tellrestart
if ERRORLEVEL 5 goto taskrestart
if ERRORLEVEL 4 goto taskdown
REM 3 - abort
if ERRORLEVEL 2 goto restart
if ERRORLEVEL 1 goto error
goto end
:tellrestart
echo.
echo Telnet server Restart ...
echo.
goto start
:taskrestart
echo.
echo Auto Task Restart ...
echo.
goto start
:restart
echo.
echo Admin Restart ...
echo.
goto start
:taskdown
echo .
echo Server terminated (Auto task)
echo .
:telldown
echo .
echo Server terminated (Telnet)
echo .
:error
echo.
echo Server terminated abnormaly
echo.
:end
echo.
echo server terminated
echo.
:question
set choix=q
set /p choix=Restart(r) or Quit(q)
if /i %choix%==r goto start
if /i %choix%==q goto exit
:exit
exit
pause
