publishing PLAYER/FRIENDS/* in Station MAP

This commit is contained in:
fred 2023-04-06 17:11:24 +02:00
parent c1f8201a85
commit 7fbae8bfeb
3 changed files with 45 additions and 24 deletions

39
ASTROBOT/MAP.refresh.sh Executable file
View File

@ -0,0 +1,39 @@
#!/bin/bash
################################################################################
# Author: Fred (support@qo-op.com)
# Version: 0.2
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
################################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
. "$MY_PATH/../tools/my.sh"
################################################################################
## Publish All PLAYER TW,
# Run TAG subprocess: tube, voeu
############################################
echo "## RUNNING MAP.refresh"
#################################################################
## IPFSNODEID ASTRONAUTES SIGNALING ## 12345 port
############################
# UDATE STATION BALISE
if [[ -d ~/.zen/tmp/${IPFSNODEID} ]]; then
# ONLY FRESH DATA HERE
# BSIZE=$(du -b ~/.zen/tmp/${IPFSNODEID} | tail -n 1 | cut -f 1)
## Getting actual online version
# ipfs get -o ~/.zen/tmp/${IPFSNODEID} /ipns/${IPFSNODEID}/
## COPY COINS VALUE OF THE DAY
cp ~/.zen/tmp/coucou/*.COINS ~/.zen/tmp/${IPFSNODEID}/
## COPY FRIENDS BY LEVEL
############################################
NSIZE=$(du -b ~/.zen/tmp/${IPFSNODEID} | tail -n 1 | cut -f 1)
ROUTING=$(ipfs add -rwHq ~/.zen/tmp/${IPFSNODEID}/* | tail -n 1 )
ipfs name publish /ipfs/$ROUTING
echo ">> $NSIZE Bytes STATION BALISE > ${myIPFS}/ipns/${IPFSNODEID}"
fi

View File

@ -224,30 +224,8 @@ for PLAYER in ${PLAYERONE[@]}; do
&& ipfs name publish --key="${PLAYER}_feed" /ipfs/$FRAME
done
#################################################################
## IPFSNODEID ASTRONAUTES SIGNALING ## 12345 port
############################
# UDATE STATION BALISE
if [[ -d ~/.zen/tmp/${IPFSNODEID} ]]; then
# ONLY FRESH DATA HERE
# BSIZE=$(du -b ~/.zen/tmp/${IPFSNODEID} | tail -n 1 | cut -f 1)
## Getting actual online version
# ipfs get -o ~/.zen/tmp/${IPFSNODEID} /ipns/${IPFSNODEID}/
## COPY COINS VALUE OF THE DAY
cp ~/.zen/tmp/coucou/*.COINS ~/.zen/tmp/${IPFSNODEID}/
############################################
NSIZE=$(du -b ~/.zen/tmp/${IPFSNODEID} | tail -n 1 | cut -f 1)
ROUTING=$(ipfs add -rwHq ~/.zen/tmp/${IPFSNODEID}/* | tail -n 1 )
ipfs name publish /ipfs/$ROUTING
echo ">> $NSIZE Bytes STATION BALISE > ${myIPFS}/ipns/${IPFSNODEID}"
fi
echo "PLAYER.refresh DONE."
${MY_PATH}/MAP.refresh.sh
exit 0

View File

@ -330,6 +330,10 @@ do
done
## CLONE IN MAP CACHE
mkdir -p ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/FRIENDS/
cp -Rf ~/.zen/game/players/${PLAYER}/FRIENDS/* ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/FRIENDS/
else
#########################################
## COOL FEATURE FOR GCHANGE ACCOUNT CONFIDENCE