mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-13 08:01:33 +01:00
add function to invoke rq once for all the relayIDs in the set of
devices making up a game. Actually using it make the script fail for some reason and so it's commented out, but it helped to debug the relay.
This commit is contained in:
parent
0bbf7272aa
commit
5bf87b3bea
1 changed files with 17 additions and 0 deletions
|
@ -141,6 +141,22 @@ close_device() {
|
|||
unset LOGS[$ID]
|
||||
}
|
||||
|
||||
kill_from_logs() {
|
||||
CMDS=""
|
||||
while [ $# -gt 0 ]; do
|
||||
LOG=${LOGS[$1]}
|
||||
RELAYID=$(./scripts/relayID.sh $LOG)
|
||||
if [ -n "$RELAYID" ]; then
|
||||
CMDS="$CMDS -d $RELAYID"
|
||||
fi
|
||||
shift
|
||||
done
|
||||
if [ -n "$CMDS" ]; then
|
||||
echo "../relay/rq $CMDS"
|
||||
../relay/rq $CMDS 2>/dev/null || true
|
||||
fi
|
||||
}
|
||||
|
||||
kill_from_log() {
|
||||
LOG=$1
|
||||
RELAYID=$(./scripts/relayID.sh $LOG)
|
||||
|
@ -189,6 +205,7 @@ check_game() {
|
|||
|
||||
if [ -n "$OTHERS" ]; then
|
||||
echo -n "Closing $CONNNAME: "
|
||||
# kill_from_logs $OTHERS $KEY
|
||||
for ID in $OTHERS $KEY; do
|
||||
echo -n "${LOGS[$ID]}, "
|
||||
kill_from_log ${LOGS[$ID]} || true
|
||||
|
|
Loading…
Reference in a new issue