Updating PLAYER refresh & GCHANGE friendship

This commit is contained in:
fred 2023-10-20 01:53:09 +02:00
parent f9dbfd8dc9
commit 20ff5746ca
2 changed files with 11 additions and 8 deletions

View File

@ -39,9 +39,10 @@ if [[ -d ~/.zen/tmp/${IPFSNODEID} ]]; then
echo "FOUND : ${PLAYERONE[@]}"
## RUNING FOR ALL LOCAL PLAYERS
for PLAYER in ${PLAYERONE[@]}; do
echo "${PLAYER} SEEKING OWN FRIENDS"
mkdir -p ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/FRIENDS/
cp -Rf ~/.zen/game/players/${PLAYER}/FRIENDS/* ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/FRIENDS/
echo "${PLAYER} GCHANGE FRIENDS"
[[ -d ~/.zen/tmp/${IPFSNODEID}/${PLAYER} && ${PLAYER} != "" ]] && rm -Rf ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/ ## TODO REMOVE (PROTOCOL UPGRADE)
mkdir -p ~/.zen/tmp/${IPFSNODEID}/GCHANGE/${PLAYER}/FRIENDS/
cp -Rf ~/.zen/game/players/${PLAYER}/FRIENDS/* ~/.zen/tmp/${IPFSNODEID}/GCHANGE/${PLAYER}/FRIENDS/
done
cp ~/.zen/GPS ~/.zen/tmp/${IPFSNODEID}/

View File

@ -87,21 +87,23 @@ for PLAYER in ${PLAYERONE[@]}; do
## IPFS / HTTP / LOCAL
#~ DISABLED || curl -m 60 -so ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html "$LIBRA/ipns/${ASTRONAUTENS}" \
# || cp ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html
ipfs --timeout 480s get -o ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html /ipns/${ASTRONAUTENS} \
|| cp ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html
rm ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html 2>/dev/null
ipfs --timeout 480s get -o ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html /ipns/${ASTRONAUTENS}
## PLAYER TW IS ONLINE ?
if [ ! -s ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html ]; then
LASTCHAIN=$(cat ~/.zen/game/players/${PLAYER}/ipfs/moa/.chain.* | tail -n 1)
echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
echo "ERROR_PLAYERTW_OFFLINE : /ipns/${ASTRONAUTENS}"
echo "------------------------------------------------"
echo "MANUAL PROCEDURE NEEDED"
echo "------------------------------------------------"
echo "$myIPFS/ipfs/"
echo "/ipfs/"$(cat ~/.zen/game/players/${PLAYER}/ipfs/moa/.chain.* | tail -n 1)
echo "ipfs name publish -t 24h --key=${PLAYER} ..."
echo "${myIPFS}/ipfs/${LASTCHAIN}"
echo ""
echo "ipfs name publish --key=${PLAYER} /ipfs/${LASTCHAIN}"
echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
continue