diff --git a/etc/report-mail.de.txt b/etc/report-mail.de.txt new file mode 100644 index 000000000..e40d86b53 --- /dev/null +++ b/etc/report-mail.de.txt @@ -0,0 +1,10 @@ +Freust Du Dich, dass es diese Woche wieder einen Eressea-Report gibt? +Möchtest Du dazu beitragen, dass das auch nächste Woche wieder passiert? +Eressea ist ein freiwilliges gratis-Angebot, und die Spielleitung bezahlt +seit Jahren die Entwicklung und das Hosting aus eigener Tasche. Wenn Dir +das etwas wert ist, kannst Du das auf +https://flattr.com/thing/681354/Eressea zum Ausdruck bringen. + +Diese Mail enthält ein Attachment mit Deinem Eressea-Report in +komprimierter Form. Um ihn zu entpacken benötigst Du ein Programm, +das ZIP-Archive öffnen kann, wie z.B. 7-Zip (http://www.7-zip.org/) diff --git a/etc/report-mail.en.txt b/etc/report-mail.en.txt new file mode 100644 index 000000000..58a8e0c19 --- /dev/null +++ b/etc/report-mail.en.txt @@ -0,0 +1,6 @@ +If you feel that getting a report every weekend is worth something to you, +why not flattr Eressea at https://flattr.com/thing/681354/Eressea ? + +This email contains an Attachment with your Eressea report in compressed +form. To open the attachment, you will need a program that can extract +ZIP files, e.g. 7-Zip (http://www.7-zip.org/). diff --git a/etc/report-mail.txt b/etc/report-mail.txt new file mode 100644 index 000000000..4101243e7 --- /dev/null +++ b/etc/report-mail.txt @@ -0,0 +1,14 @@ +Freust Du Dich, dass es diese Woche wieder einen Eressea-Report gibt? +Möchtest Du dazu beitragen, dass das auch nächste Woche wieder passiert? +Eressea ist ein freiwilliges gratis-Angebot, und die Spielleitung bezahlt +seit Jahren die Entwicklung und das Hosting aus eigener Tasche. Wenn Dir +das etwas wert ist, kannst Du das auf +https://flattr.com/thing/681354/Eressea zum Ausdruck bringen. + +Diese Mail enthält ein Attachment mit Deinem Eressea-Report in +komprimierter Form. Um ihn zu entpacken benötigst Du ein Programm, +das ZIP-Archive öffnen kann, wie z.B. 7-Zip (http://www.7-zip.org/) + +This email contains an attachment with your Eressea report in compressed +form. To open the attachment, you will need a program that can extract +ZIP files, e.g. 7-Zip (http://www.7-zip.org/). diff --git a/process/cron/crontab b/process/cron/crontab deleted file mode 100644 index 9d7e155cb..000000000 --- a/process/cron/crontab +++ /dev/null @@ -1,17 +0,0 @@ -# Crontab for Eressea on gruenbaer.kn-bremen.de - -PATH=/home/eressea/bin:/opt/bin:/usr/local/bin:/usr/bin:/bin -ERESSEA=/home/eressea/eressea -ENABLED=yes -PREVIEW=yes -CONFIRM=yes - -# m h dom mon dow command -00 00 * * * $HOME/bin/fetchmail.cron -00 22 * * * $HOME/bin/backup-db.sh - -15 21 * * Sat [ "$ENABLED" = "yes" ] && $ERESSEA/server/bin/run-eressea.cron 3 -25 21 * * Sat [ "$ENABLED" = "yes" ] && $ERESSEA/server/bin/run-eressea.cron 4 -35 21 * * Sat [ "$ENABLED" = "yes" ] && $ERESSEA/server/bin/run-eressea.cron 2 -30 07 * * Sun [ "$PREVIEW" = "yes" ] && $ERESSEA/server/bin/preview.cron -*/5 * * * * [ "$CONFIRM" = "yes" ] && $ERESSEA/server/bin/orders.cron 2 3 4 diff --git a/process/cron/orders.cron b/process/cron/orders.cron index be573fe86..114a870a5 100755 --- a/process/cron/orders.cron +++ b/process/cron/orders.cron @@ -5,6 +5,10 @@ # this here script to make a non-blocking syntax check and reject or # accept the order file. +if [ "yes" != "$CONFIRM" ] ; then + exit +fi + for GAME in $* do if [ "$GAME" == "eressea" ]; then GAME=2 ; fi diff --git a/process/cron/preview.cron b/process/cron/preview.cron index 985ddf40b..71ebd0571 100755 --- a/process/cron/preview.cron +++ b/process/cron/preview.cron @@ -1,6 +1,8 @@ #!/bin/bash -[ -z ${ERESSEA} ] && ERESSEA=~/eressea +[ "$PREVIEW" != "yes" ] && exit +[ -z ${ERESSEA} ] && ERESSEA=$HOME/eressea + branch="develop" if [ -e ${ERESSEA}/build/.preview ]; then branch=`cat ${ERESSEA}/build/.preview` diff --git a/process/cron/run-eressea.cron b/process/cron/run-eressea.cron index 8b506a633..4ea38184c 100755 --- a/process/cron/run-eressea.cron +++ b/process/cron/run-eressea.cron @@ -1,7 +1,11 @@ #!/bin/bash GAME=$1 -BIN=$HOME/bin -export ERESSEA=$HOME/eressea + +[ "$ENABLED" != "yes" ] && exit +[ -z ${ERESSEA} ] && ERESSEA=$HOME/eressea + +export ERESSEA +BIN=$ERESSEA/server/bin TURN=$(cat $ERESSEA/game-$GAME/turn) if [ ! -e $ERESSEA/game-$GAME/data/$TURN.dat ]; then echo "data file $TURN is missing, cannot run turn for game $GAME" @@ -14,6 +18,18 @@ fi mkdir $REPORTS cd $ERESSEA/game-$GAME + +# wait for the queue lock to go away +maxt=5 +to=5 +while [ -e orders.queue.lock ] ; do + echo "waiting for orders to finish processing." + sleep $to + let to=$to+$to + let mast=$maxt-1 + [ $maxt -lt 0 ] && break +done + if [ -d test ]; then touch test/execute.lock fi diff --git a/process/orders.cron b/process/orders.cron deleted file mode 100755 index be573fe86..000000000 --- a/process/orders.cron +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -## this script processes incoming order files. -# files are delivered into an incoming queue by procmail, then cron runs -# this here script to make a non-blocking syntax check and reject or -# accept the order file. - -for GAME in $* -do - if [ "$GAME" == "eressea" ]; then GAME=2 ; fi - if [ "$GAME" == "e3a" ]; then GAME=3 ; fi - if [ -e $HOME/eressea/game-$GAME/orders.queue ] - then - $HOME/bin/orders-process $GAME - fi -done diff --git a/process/run-turn b/process/run-turn index 0c5ee8fd2..c0d0d6a40 100755 --- a/process/run-turn +++ b/process/run-turn @@ -1,3 +1,5 @@ +#!/bin/sh + GAME=$1 TURN=$2 @@ -12,3 +14,4 @@ echo "running turn $TURN, game $GAME" $ERESSEA/server/bin/eressea -v3 -t $TURN run-turn.lua mkdir -p log ln -f eressea.log log/eressea.log.$TURN + diff --git a/process/run-turn.sh b/process/run-turn.sh deleted file mode 100755 index 9cc4e4ffd..000000000 --- a/process/run-turn.sh +++ /dev/null @@ -1,22 +0,0 @@ -GAME=$1 -TURN=$2 - -if [ ! -d $ERESSEA/game-$GAME ] ; then - echo "No such game: $GAME" - exit 1 -fi - -cd $ERESSEA/game-$GAME -if [ -z $TURN ]; then - TURN=$(cat turn) -fi - -echo "running turn $TURN, game $GAME" -if [ -d orders.dir.$TURN ]; then - echo "orders.dir.$TURN already exists" -else - mv orders.dir orders.dir.$TURN - mkdir -p orders.dir -fi -ls -1rt orders.dir.$TURN/turn-* | xargs cat > orders.$TURN -$ERESSEA/bin/eressea -t $TURN run-turn.lua