#!/bin/sh

# Uncomment this line to force usage of the GAGE timer.
#MOAGG_TIMER="GAGE"

# Uncomment this line to force usage of the SYSTEM timer.
#MOAGG_TIMER="SYSTEM"





MOAGG_PROPERTIES="-Dlog4j.configuration=file:log4j.properties"
if test "x$MOAGG_TIMER" != "x"
then
	MOAGG_PROPERTIES="$MOAGG_PROPERTIES -Dmoagg.timer=$MOAGG_TIMER"
fi

if test "x$JAVA_HOME" != "x"
then
	if test -x "$JAVA_HOME/bin/java"
	then
		JAVA="$JAVA_HOME/bin/java"
	else
		echo JAVA_HOME \'$JAVA_HOME\' points to an invalid path.
	fi
else
	echo JAVA_HOME is not set.
fi

if test "x$JAVA" = "x"
then
	echo Trying to execute java directly.
	JAVA=java
fi

exec "$JAVA" -cp jar/moagg-1.95.jar:data $MOAGG_PROPERTIES moagg.game.MoaggGameEngine
