add current version of processing scripts

fix a crash in checkpasswd
This commit is contained in:
Enno Rehling 2015-01-11 01:23:47 +01:00
parent 50aa3cc444
commit 95d0b2a413
6 changed files with 66 additions and 6 deletions

31
process/cron/backup-eressea Executable file
View File

@ -0,0 +1,31 @@
#!/bin/bash
if [ -z $ERESSEA ] ; then
ERESSEA=$HOME/eressea
echo "The ERESSEA environment variable is not set. Assuming $ERESSEA."
fi
GAME=$1
if [ ! -d $ERESSEA/game-$GAME ]; then
echo "No such game: game-$GAME."
exit 1
fi
cd $ERESSEA/game-$GAME
TURN=$2
if [ -z $TURN ]; then
TURN=$(cat turn)
fi
if [ ! -e data/$TURN.dat ]; then
echo "No data for turn $TURN in game $GAME."
exit 2
fi
if [ ! -d backup ] ; then
echo "creating missing backup directory for game $GAME."
mkdir -p ~/backup/eressea/game-$GAME
ln -sf ~/backup/eressea/game-$GAME backup
fi
files="data/$TURN.dat parteien.full parteien"
if [ -e orders.$TURN ]; then
files="$files orders.$TURN"
fi
echo "backup turn $TURN, game $GAME, files: $files"
tar cjf backup/$TURN.tar.bz2 $files

16
process/cron/create-orders Executable file
View File

@ -0,0 +1,16 @@
GAME=$1
TURN=$2
if [ ! -d $ERESSEA/game-$GAME ] ; then
echo "No such game: $GAME"
exit 1
fi
cd $ERESSEA/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

View File

@ -12,14 +12,15 @@ if [ -d $REPORTS ]; then
rm -rf $REPORTS rm -rf $REPORTS
fi fi
mkdir $REPORTS mkdir $REPORTS
$BIN/backup-eressea $GAME $TURN
cd $ERESSEA/game-$GAME cd $ERESSEA/game-$GAME
if [ -d test ]; then if [ -d test ]; then
touch test/execute.lock touch test/execute.lock
fi fi
$BIN/create-orders $GAME $TURN
$BIN/backup-eressea $GAME $TURN
rm -f execute.lock rm -f execute.lock
$BIN/run-turn $GAME $BIN/run-turn $GAME $TURN
touch execute.lock touch execute.lock
if [ ! -s $ERESSEA/game-$GAME/orders.$TURN ]; then if [ ! -s $ERESSEA/game-$GAME/orders.$TURN ]; then

14
process/cron/run-turn Executable file
View File

@ -0,0 +1,14 @@
GAME=$1
TURN=$2
if [ ! -d $ERESSEA/game-$GAME ] ; then
echo "No such game: $GAME"
exit 1
fi
cd $ERESSEA/game-$GAME
echo "running turn $TURN, game $GAME"
$ERESSEA/server/bin/eressea -v1 -t $TURN run-turn.lua
mkdir -p log
ln -f eressea.log log/eressea.log.$TURN

View File

@ -1,3 +1,3 @@
#define VERSION_MAJOR 3 #define VERSION_MAJOR 3
#define VERSION_MINOR 3 #define VERSION_MINOR 3
#define VERSION_BUILD 694 #define VERSION_BUILD 695

View File

@ -274,9 +274,7 @@ unit *addplayer(region * r, faction * f)
bool checkpasswd(const faction * f, const char *passwd, bool shortp) bool checkpasswd(const faction * f, const char *passwd, bool shortp)
{ {
if (unicode_utf8_strcasecmp(f->passw, passwd) == 0) return (passwd && unicode_utf8_strcasecmp(f->passw, passwd) == 0);
return true;
return false;
} }
variant read_faction_reference(struct storage * store) variant read_faction_reference(struct storage * store)