@echo off

rem Uncomment this line to force usage of the GAGE timer.
rem set MOAGG_TIMER=GAGE

rem Uncomment this line to force usage of the SYSTEM timer.
rem set MOAGG_TIMER=SYSTEM





set MOAGG_PROPERTIES=-Djava.library.path=jar -Dlog4j.configuration=file:log4j.properties
if not "%MOAGG_TIMER%" == "" (
	set MOAGG_PROPERTIES=%MOAGG_PROPERTIES% -Dmoagg.timer=%MOAGG_TIMER%
)

set JAVA_EXE=""
if not "%JAVA_HOME%" == "" (
	if exist "%JAVA_HOME%\bin\java.exe" (
		set JAVA_EXE="%JAVA_HOME%\bin\java.exe"
	) else (
		echo JAVA_HOME '%JAVA_HOME%' points to an invalid path.
	)
) else (
	echo JAVA_HOME is not set.
)

if %JAVA_EXE% == "" (
	echo Trying to execute java directly.
	set JAVA_EXE=java.exe
)

%JAVA_EXE% -cp jar\moagg-1.95.jar;data %MOAGG_PROPERTIES% moagg.game.MoaggGameEngine

pause
