@echo off
color 4
title GameServer Console
:start
echo ------------------------------
echo Starting Game Server...
echo ------------------------------
echo.
SET OLDCLASSPATH=%CLASSPATH%
call lib_gs.bat
java -Dfile.encoding=UTF-8 -server [color="#8B0000"]-[/color]Xmx1024m -Xms512m -Xmn256m -XX:PermSize=256m -XX:SurvivorRatio=8 -Xnoclassgc -XX:+AggressiveOpts l2jlionna.gameserver.GameServer
SET CLASSPATH=%OLDCLASSPATH%-Xmx2048m
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 Send you bug to : http://l2j.lionna.net/talk/
echo.
goto start
:taskrestart
echo.
echo Auto Task Restart ...
echo Send you bug to : http://l2j.lionna.net/talk/
echo.
goto start
:restart
echo.
echo Admin Restart ...
echo Send you bug to : http://l2j.lionna.net/talk/
echo.
goto start
:taskdown
echo .
echo Server terminated (Auto task)
echo Send you bug to : http://l2j.lionna.net/talk/
echo .
:telldown
echo .
echo Server terminated (Telnet)
echo Send you bug to : http://l2j.lionna.net/talk/
echo .
:error
echo.
echo Server terminated abnormaly
echo Send you bug to : http://l2j.lionna.net/talk/
echo.
:end
echo.
echo server terminated
echo Send you bug to : http://l2j.lionna.net/talk/
echo.
:question
set choix=q
set /p choix=Restart® or Quit(q)
if /i %choix%==r goto start
if /i %choix%==q goto exit
:exit
exit