From 7fbae8bfeb29783f4083b38c6397449c1e500229 Mon Sep 17 00:00:00 2001 From: fred Date: Thu, 6 Apr 2023 17:11:24 +0200 Subject: [PATCH] publishing PLAYER/FRIENDS/* in Station MAP --- ASTROBOT/MAP.refresh.sh | 39 ++++++++++++++++++++++++++++++ ASTROBOT/PLAYER.refresh.sh | 26 ++------------------ tools/Connect_PLAYER_To_Gchange.sh | 4 +++ 3 files changed, 45 insertions(+), 24 deletions(-) create mode 100755 ASTROBOT/MAP.refresh.sh diff --git a/ASTROBOT/MAP.refresh.sh b/ASTROBOT/MAP.refresh.sh new file mode 100755 index 00000000..72eb46b3 --- /dev/null +++ b/ASTROBOT/MAP.refresh.sh @@ -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 diff --git a/ASTROBOT/PLAYER.refresh.sh b/ASTROBOT/PLAYER.refresh.sh index 3add1d25..05a74b3a 100755 --- a/ASTROBOT/PLAYER.refresh.sh +++ b/ASTROBOT/PLAYER.refresh.sh @@ -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 diff --git a/tools/Connect_PLAYER_To_Gchange.sh b/tools/Connect_PLAYER_To_Gchange.sh index 413c0e67..572253fe 100755 --- a/tools/Connect_PLAYER_To_Gchange.sh +++ b/tools/Connect_PLAYER_To_Gchange.sh @@ -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