From 42f6fdc39feca7f62b93124a29a70b9f11e9d028 Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 26 Mar 2024 01:19:52 +0100 Subject: [PATCH] donot unplug CURRENT --- API/ZONE.sh | 20 +++++++------------- RUNTIME/PLAYER.refresh.sh | 6 +++--- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/API/ZONE.sh b/API/ZONE.sh index 620f5405..bd001ebf 100755 --- a/API/ZONE.sh +++ b/API/ZONE.sh @@ -63,22 +63,16 @@ LAT=$(makecoord ${LAT}) LON=$(makecoord ${LON}) JSON="ZONE_${LAT}_${LON}_${DEG}.json" -[[ $(date +"%H%M") -gt 2012 ]] \ - && THEDATE=${TODATE} \ - || THEDATE=${YESTERDATE} -echo "${THEDATE}" - - ## SECTOR LEVEL if [[ ${DEG} == "0.01" ]]; then SECLAT="${LAT::-1}" SECLON="${LON::-1}" SECTOR="_${SECLAT}_${SECLON}" echo "SECTOR = ${SECTOR}" - ZONEINDEX="/ipns/"$(cat ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/_${LAT}*_${LON}*/SECTORNS | tail -n 1) - [[ ! $ZONEINDEX ]] && ZONEINDEX="/ipns/"$(cat ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_${LAT}*_${LON}*/SECTORNS | tail -n 1) - ZONEG1PUB=$(cat ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/_${LAT}*_${LON}*/SECTORG1PUB | tail -n 1) - [[ ! $ZONEG1PUB ]] && ZONEG1PUB=$(cat ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_${LAT}*_${LON}*/SECTORG1PUB | tail -n 1) + ZONEINDEX="/ipns/"$(cat ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/_${SECLAT}*_${SECLON}*/SECTORNS | tail -n 1) + [[ ! $ZONEINDEX ]] && ZONEINDEX="/ipns/"$(cat ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_${SECLAT}*_${SECLON}*/SECTORNS | tail -n 1) + ZONEG1PUB=$(cat ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/_${SECLAT}*_${SECLON}*/SECTORG1PUB | tail -n 1) + [[ ! $ZONEG1PUB ]] && ZONEG1PUB=$(cat ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_${SECLAT}*_${SECLON}*/SECTORG1PUB | tail -n 1) JSON="ZONE${SECTOR}_${DEG}.json" fi @@ -89,8 +83,8 @@ echo "${THEDATE}" LON=$(echo ${LON} | cut -d '.' -f 1) ZONE="_${LAT}_${LON}" echo "ZONE = ${ZONE}" - ZONEINDEX=$(cat ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/_${LAT}*_${LON}*/REGIONNS | tail -n 1) - [[ ! $ZONEINDEX ]] && ZONEINDEX=$(cat ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_${LAT}*_${LON}*/REGIONNS | tail -n 1) + ZONEINDEX="/ipns/"$(cat ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/_${LAT}*_${LON}*/REGIONNS | tail -n 1) + [[ ! $ZONEINDEX ]] && ZONEINDEX="/ipns/"$(cat ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_${LAT}*_${LON}*/REGIONNS | tail -n 1) ZONEG1PUB=$(cat ~/.zen/tmp/swarm/*/UPLANET/__/_*_*/_*.?_*.?/_${LAT}*_${LON}*/REGIONG1PUB | tail -n 1) [[ ! $ZONEG1PUB ]] && ZONEG1PUB=$(cat ~/.zen/tmp/${IPFSNODEID}/UPLANET/__/_*_*/_*.?_*.?/_${LAT}*_${LON}*/REGIONG1PUB | tail -n 1) JSON="ZONE${ZONE}_${DEG}.json" @@ -124,7 +118,7 @@ if [[ ! -s ~/.zen/tmp/${JSON} ]]; then rm -Rf ~/.zen/tmp/${MOATS}/ end=`date +%s` - echo "(UMAP)_${LAT}_${LON} ${THEDATE} $UMAPNS Operation time was "`expr $end - $start` seconds. + echo "(UMAP)_${LAT}_${LON} $UMAPNS Operation time was "`expr $end - $start` seconds. exit 0 fi diff --git a/RUNTIME/PLAYER.refresh.sh b/RUNTIME/PLAYER.refresh.sh index bfb25504..9809b86c 100755 --- a/RUNTIME/PLAYER.refresh.sh +++ b/RUNTIME/PLAYER.refresh.sh @@ -131,7 +131,7 @@ for PLAYER in ${PLAYERONE[@]}; do echo "" >> ~/.zen/tmp/result - [[ $try == 0 ]] \ + [[ $try == 0 && "${CURRENT}" != "${PLAYER}" ]] \ && echo "PLAYER ${PLAYER} UNPLUG" \ && ${MY_PATH}/PLAYER.unplug.sh ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html ${PLAYER} "ALL" \ && continue @@ -206,7 +206,7 @@ for PLAYER in ${PLAYERONE[@]}; do ################################################## +7 DAYS AstroID !! ## REMOVE TW OLDER THAN 7 DAYS WITH AstroID - [[ -s ~/.zen/tmp/${MOATS}/AstroID.json && $days -gt 7 ]] \ + [[ -s ~/.zen/tmp/${MOATS}/AstroID.json && $days -gt 7 && "${CURRENT}" != "${PLAYER}" ]] \ && ${MY_PATH}/PLAYER.unplug.sh "${HOME}/.zen/game/players/${PLAYER}/ipfs/moa/index.html" "${PLAYER}" "ALL" \ && echo "(#__#) AstroID +7 DAYS = SECURITY ERROR (#__#)" && continue @@ -533,7 +533,7 @@ for PLAYER in ${PLAYERONE[@]}; do ######################################################## #### PLAYER ACCOUNT HAVE NEW TIDDLER or NOT ######### - if [[ $(cat ~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json) == "[]" ]]; then + if [[ $(cat ~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json) == "[]" && "${CURRENT}" != "${PLAYER}" ]]; then echo "ALERT -- RSS IS EMPTY -- COINS=$COINS / ZEN=$ZEN --" ## DEAD PLAYER ?? if [[ ${DIFF_SECONDS} -eq $(( 27 * 24 * 60 * 60 )) ]]; then