From 8344a12dd1f8d4c021b733dbf1cadb53e2d6a00f Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 12 Sep 2023 18:10:42 +0200 Subject: [PATCH] UPLANET release candidate is coming. --- API/UPLANET.sh | 2 +- RUNTIME/PLAYER.refresh.sh | 2 ++ RUNTIME/UPLANET.refresh.sh | 21 ++++++++++++++++----- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/API/UPLANET.sh b/API/UPLANET.sh index 61345b3b..f5e573af 100755 --- a/API/UPLANET.sh +++ b/API/UPLANET.sh @@ -182,7 +182,7 @@ echo "UMAPNS : ${myIPFS}/ipns/${UMAPNS}" ####################################### Umap.png ## CREATING Umap_${LAT}_${LON}.png -echo "# OSM2IPFS ~/.zen/tmp/${MOATS}/Umap_${LAT}_${LON}.png" +echo "# OSM2IPFS ~/.zen/tmp/${MOATS}/Umap.png & Umap.jpg & Usat.png & Usat.jpg" ## TODO MAYBE KEEP JPG ONLY FOR LOWERING UMAP SIZE UMAPGEN="/ipfs/QmRG3ZAiXWvKBccPFbv4eUTZFPMsfXG25PiZQD6N8M8MMM/Umap.html?southWestLat=$LAT&southWestLon=$LON°=0.01" USATGEN="/ipfs/QmRG3ZAiXWvKBccPFbv4eUTZFPMsfXG25PiZQD6N8M8MMM/Usat.html?southWestLat=$LAT&southWestLon=$LON°=0.01" diff --git a/RUNTIME/PLAYER.refresh.sh b/RUNTIME/PLAYER.refresh.sh index 02166f6c..8a9f0034 100755 --- a/RUNTIME/PLAYER.refresh.sh +++ b/RUNTIME/PLAYER.refresh.sh @@ -138,6 +138,8 @@ for PLAYER in ${PLAYERONE[@]}; do LAT=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].lat) LON=$(cat ~/.zen/tmp/${MOATS}/GPS.json | jq -r .[].lon) echo "LAT=${LAT}; LON=${LON}; UMAPNS=${UMAPNS}" + ## STORE IN PLAYER CACHE + echo "_${LAT_${LON}" > ~/.zen/game/players/${PLAYER}/.umap ########### ASTROPORT is not IPFSNODEID => EJECT TW ## MOVED PLAYER (KEY IS KEPT ON LAST CONNECTED ASTROPORT) diff --git a/RUNTIME/UPLANET.refresh.sh b/RUNTIME/UPLANET.refresh.sh index 482a76f2..568a06a8 100755 --- a/RUNTIME/UPLANET.refresh.sh +++ b/RUNTIME/UPLANET.refresh.sh @@ -50,12 +50,11 @@ mkdir ~/.zen/tmp/${MOATS} ipfs get -o ~/.zen/tmp/${MOATS}/${UMAP}/ /ipns/${UMAPNS}/ # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - ## FORMAT CONTROL + ## FORMAT CONTROL WARNING [[ ! -d ~/.zen/tmp/${MOATS}/${UMAP}/${WALLET} || ! -d ~/.zen/tmp/${MOATS}/${UMAP}/${LAT}_${LON} ]] \ - && echo ">>> ERROR - UMAP BAD FORMAT - PLEASE RESET -" && continue - #~ && rm -Rf ~/.zen/tmp/${MOATS}/${UMAP}/*.* \ - #~ && mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/${LAT}_${LON} \ - #~ && mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/${WALLET} + && echo ">>> WARNING - UMAP IS BAD FORMAT - PLEASE MONITOR KEY -" \ + && mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/${LAT}_${LON} \ + && mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/${WALLET} ## UMAP.refresh CORRECTION [[ ! -s ~/.zen/tmp/${MOATS}/${UMAP}/${LAT}_${LON}/UMAP.refresh ]] \ @@ -206,6 +205,18 @@ mkdir ~/.zen/tmp/${MOATS} cp ${MY_PATH}/../templates/umap.html ~/.zen/tmp/${MOATS}/${UMAP}/navigator_Umap.html cat ~/.zen/tmp/${MOATS}/${UMAP}/navigator_map.html | sed "s~Umap~Usat~g" > ~/.zen/tmp/${MOATS}/${UMAP}/navigator_Usat.html + ### REFRESH PLAYERS DATA (SHOULD BE THERE, but Station rebuilds it ) + # FIND WHICH PLAYERS MATCH SAME "_LAT_LON" IN ~/.zen/game/players/*/.umap + find ~/.zen/game/players -type f -name ".umap" -exec grep -l "${UMAP}" {} \; | while read umap_file; do + player_dir=$(dirname "$umap_file") + player_name=$(basename "$player_dir") + echo "MATCHING $player_name" + playertw=$(cat ${player_dir}/.playerns) + mkdir -p ~/.zen/tmp/${MOATS}/${UMAP}/TW/${player_name} + echo "" > ~/.zen/tmp/${MOATS}/${UMAP}/TW/${player_name}/index.html + done + ## COMPLETE WITH SEARCH IN ~/.zen/tmp/swarm/*/UPLANET/${UMAP} ???? + ############################################################## ############################ PUBLISHING UMAP ##############################################################