mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-16 15:41:16 +01:00
Merge branch 'relay_proxy' of ssh://xwords.git.sourceforge.net/gitroot/xwords/xwords into relay_proxy
This commit is contained in:
commit
acb52d11dc
2 changed files with 14 additions and 7 deletions
|
@ -3,6 +3,10 @@
|
|||
NGAMES=${NGAMES:-1}
|
||||
NROOMS=${NROOMS:-1}
|
||||
TIMEOUT=${TIMEOUT:-600}
|
||||
HOST=${HOST:-localhost}
|
||||
PORT=${PORT:-10997}
|
||||
|
||||
NAMES=(Brynn Ariela Kati Eric)
|
||||
|
||||
LOGDIR=$(basename $0)_logs
|
||||
mv $LOGDIR /tmp/$LOGDIR_$$
|
||||
|
@ -17,7 +21,7 @@ fi
|
|||
usage() {
|
||||
echo "usage: [env=val *] $0" 1>&2
|
||||
echo " current env variables and their values: " 1>&2
|
||||
for VAR in NGAMES NROOMS USE_GTK TIMEOUT; do
|
||||
for VAR in NGAMES NROOMS USE_GTK TIMEOUT HOST PORT; do
|
||||
echo "$VAR:" $(eval "echo \$${VAR}") 1>&2
|
||||
done
|
||||
exit 0
|
||||
|
@ -41,8 +45,9 @@ do_device() {
|
|||
STOPTIME=$(($(date "+%s") + TIMEOUT))
|
||||
while :; do
|
||||
sleep $((RANDOM%5))
|
||||
./obj_linux_memdbg/xwords -C $ROOM -r edd $OTHERS \
|
||||
-d dict.xwd -f $FILE -z 1:3 $PLAT_PARMS >/dev/null 2>>$LOG &
|
||||
./obj_linux_memdbg/xwords -C $ROOM -r ${NAMES[$DEV]} $OTHERS \
|
||||
-d dict.xwd -p $PORT -a $HOST -f $FILE -z 1:3 $PLAT_PARMS \
|
||||
>/dev/null 2>>$LOG &
|
||||
PID=$!
|
||||
sleep $((RANDOM%10+5))
|
||||
while :; do
|
||||
|
@ -59,8 +64,8 @@ do_device() {
|
|||
echo -n "timeout exceeded for device $DEV in game $GAME ($LOG)"
|
||||
date
|
||||
break
|
||||
elif ! pidof xwrelay > /dev/null; then
|
||||
break
|
||||
elif [ ! -d $LOGDIR ]; then
|
||||
break;
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
|
|
@ -5,6 +5,8 @@ COOKIE=${COOKIE:-foo}
|
|||
NGAMES=${NGAMES:-1}
|
||||
NPLAYERS=${NPLAYERS:-2}
|
||||
USE_GTK=${USE_GTK:-FALSE}
|
||||
HOST=${HOST:-localhost}
|
||||
PORT=${PORT:-10997}
|
||||
|
||||
[ $USE_GTK = FALSE ] && CURSES_PARM="-u -0"
|
||||
|
||||
|
@ -14,7 +16,7 @@ mkdir -p $LOGDIR
|
|||
usage() {
|
||||
echo "usage: [env=val *] $0" 1>&2
|
||||
echo " current env variables and their values: " 1>&2
|
||||
for VAR in COOKIE DICT NGAMES NPLAYERS USE_GTK; do
|
||||
for VAR in COOKIE DICT NGAMES NPLAYERS HOST PORT USE_GTK; do
|
||||
echo "$VAR:" $(eval "echo \$${VAR}") 1>&2
|
||||
done
|
||||
exit 0
|
||||
|
@ -35,7 +37,7 @@ for II in $(seq $NGAMES); do
|
|||
done
|
||||
for JJ in $(seq $NPLAYERS); do
|
||||
./obj_linux_memdbg/xwords $CURSES_PARM -d $DICT -r Eric $REMOTES \
|
||||
-C $COOKIE -q 2 2>${LOGDIR}/log_${II}_${JJ}.txt >/dev/null &
|
||||
-a $HOST -p $PORT -C $COOKIE -q 2 2>${LOGDIR}/log_${II}_${JJ}.txt >/dev/null &
|
||||
done
|
||||
done
|
||||
|
||||
|
|
Loading…
Reference in a new issue