2014-05-10 22:33:46 +02:00
|
|
|
#!/bin/bash
|
2014-05-10 18:57:04 +02:00
|
|
|
GAME=$1
|
|
|
|
BIN=$HOME/bin
|
|
|
|
export ERESSEA=$HOME/eressea
|
2014-05-10 22:33:46 +02:00
|
|
|
TURN=$(cat $ERESSEA/game-$GAME/turn)
|
2014-05-10 18:57:04 +02:00
|
|
|
if [ ! -e $ERESSEA/game-$GAME/data/$TURN.dat ]; then
|
|
|
|
echo "data file $TURN is missing, cannot run turn for game $GAME"
|
|
|
|
exit 1
|
|
|
|
fi
|
2014-05-10 22:33:46 +02:00
|
|
|
REPORTS=$ERESSEA/game-$GAME/reports
|
2014-05-10 18:57:04 +02:00
|
|
|
if [ -d $REPORTS ]; then
|
|
|
|
rm -rf $REPORTS
|
|
|
|
fi
|
|
|
|
mkdir $REPORTS
|
2014-06-01 11:07:22 +02:00
|
|
|
$BIN/backup-eressea $GAME
|
2014-07-17 15:55:50 +02:00
|
|
|
$BIN/run-turn $GAME
|
2014-05-10 18:57:04 +02:00
|
|
|
if [ ! -s $ERESSEA/game-$GAME/orders.$TURN ]; then
|
|
|
|
echo "server did not create orders for turn $TURN in game $GAME"
|
|
|
|
exit 2
|
|
|
|
fi
|
2014-05-10 22:33:46 +02:00
|
|
|
let TURN=$TURN+1
|
2014-05-10 18:57:04 +02:00
|
|
|
if [ ! -s $ERESSEA/game-$GAME/data/$TURN.dat ]; then
|
|
|
|
echo "server did not create data for turn $TURN in game $GAME"
|
|
|
|
exit 3
|
|
|
|
fi
|
|
|
|
if [ ! -s $REPORTS/reports.txt ]; then
|
|
|
|
echo "server did not create reports.txt for turn $TURN in game $GAME"
|
|
|
|
exit 4
|
|
|
|
fi
|
|
|
|
$BIN/compress.sh $GAME $TURN
|
|
|
|
$BIN/sendreports.sh $GAME
|
2014-06-01 11:07:22 +02:00
|
|
|
$BIN/backup-eressea $GAME
|
2014-07-17 15:55:50 +02:00
|
|
|
[ $GAME -lt 4 ] && $BIN/send-summary $GAME
|