diff --git a/API/QRCODE.sh b/API/QRCODE.sh index b26f32e2..62c83559 100755 --- a/API/QRCODE.sh +++ b/API/QRCODE.sh @@ -129,7 +129,7 @@ echo ">>> ${QRCODE} g1_to_ipfs $ASTROTOIPFS" ###########################################"" MYPLAYERKEY=$(grep ${QRCODE} ~/.zen/game/players/*/secret.dunikey | cut -d ':' -f 1) [[ ! $MYPLAYERKEY ]] && MYPLAYERKEY="$HOME/.zen/game/players/.current/secret.dunikey" -echo "SELECTES KEY : $(cat MYPLAYERKEY)" +echo "SELECTED KEY : $(cat MYPLAYERKEY)" echo ## PARRAIN ID EXTRACTION @@ -143,16 +143,17 @@ echo "CURRENT PLAYER : $CURCOINS G1" ## WALLET JAMAIS SERVI ########################################### if [[ $CURCOINS == "null" ]]; then -echo "NULL" +echo "NULL. PLEASE CHARGE. REDIRECT TO WSTATION HOME" sed "s~_TWLINK_~$(cat ~/.zen/WSTATION)~g" ~/.zen/Astroport.ONE/templates/index.302 > ~/.zen/tmp/${MOATS}/index.redirect echo "url='"${myIPFSGW}$(cat ~/.zen/WSTATION)"'" >> ~/.zen/tmp/${MOATS}/index.redirect ( cat ~/.zen/tmp/${MOATS}/index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 + echo "BLURP $PORT" && rm -Rf ~/.zen/tmp/${MOATS} ) & exit 0 fi -# MOA +# DETECT WALLET EVOLUTION ########################################### if [[ ${CURG1} == ${QRCODE} ]]; then @@ -162,7 +163,7 @@ else # PAS MOA ########################################### ## GET VISITOR G1 WANNET AMOUNT : VISITORCOINS - echo "${MY_PATH}/../tools/jaklis/jaklis.py balance -p ${QRCODE}" + echo "COINScheck : ${MY_PATH}/../tools/jaklis/jaklis.py balance -p ${QRCODE}" VISITORCOINS=$(~/.zen/Astroport.ONE/tools/COINScheck.sh ${QRCODE} | tail -f 1) ## PALPE COMBIEN ? @@ -179,13 +180,13 @@ else [[ ! -s ~/.zen/tmp/coucou/${QRCODE}.g1history.json ]] \ && ~/.zen/Astroport.ONE/tools/timeout.sh -t 20 $MY_PATH/../tools/jaklis/jaklis.py history -p ${QRCODE} -j > ~/.zen/tmp/coucou/${QRCODE}.g1history.json & - ## SCAN CCHANGE + + ## SCAN GCHANGE + [[ ! -s ~/.zen/tmp/coucou/${QRCODE}.gchange.json ]] \ && ~/.zen/Astroport.ONE/tools/timeout.sh -t 20 curl -s ${myDATA}/user/profile/${QRCODE} > ~/.zen/tmp/coucou/${QRCODE}.gchange.json & GFOUND=$(cat ~/.zen/tmp/coucou/${QRCODE}.gchange.json | jq -r '.found') [[ $GFOUND == "false" ]] \ - && echo "AUCUN GCHANGE" \ + && echo "G1BILLET. NO GCHANGE YET. REDIRECT" \ && sed "s~_TWLINK_~${myGCHANGE}~g" ~/.zen/Astroport.ONE/templates/index.302 > ~/.zen/tmp/${MOATS}/index.redirect \ && echo "url='"${myGCHANGE}"'" >> ~/.zen/tmp/${MOATS}/index.redirect \ && ( cat ~/.zen/tmp/${MOATS}/index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1) & @@ -240,9 +241,9 @@ else ## MESSAGE CESIUM + $MY_PATH/../tools/jaklis/jaklis.py -n $myCESIUM -k $MYPLAYERKEY send -d "${QRCODE}" -t "CADEAU" \ - -m "ASTRO:${CURPLAYER} VOUS ENVOI ${PALPE} JUNE. - GAGNEZ PLUS DE JUNE... RELIEZ CE PORTEFEUILLE Cesium SUR https://gchange.fr \ - PUIS REVENEZ SCANNER VOTRE QRCODE" + -m "ASTRO:${CURPLAYER} A ENVOYE ${PALPE} JUNE. + GAGNEZ PLUS DE JUNE... INSCRIVEZ VOUS SUR GCHANGE https://gchange.fr \ + PUIS SCANNEZ VOTRE QRCODE SUR UNE STATION ASTROPORT" fi @@ -333,6 +334,7 @@ if [[ $AND == "url" ]]; then ' > ~/.zen/tmp/${WHAT}.${MOATS}.import.json ## TODO ASTROBOT "G1AstroAPI" READS ~/.zen/tmp/${WHAT}.${MOATS}.import.json + ## INSERT IN TW (echo "$HTTPCORS OK - ~/.zen/tmp/${WHAT}.${MOATS}.import.json WORKS IF YOU MAKE THE WISH voeu 'AstroAPI'" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) && exit 0 diff --git a/ASTROBOT/VOEUX.refresh.sh b/ASTROBOT/VOEUX.refresh.sh index c53292fa..72973bd6 100755 --- a/ASTROBOT/VOEUX.refresh.sh +++ b/ASTROBOT/VOEUX.refresh.sh @@ -110,26 +110,68 @@ do ## Search in Local World (NB! G1Voeu TW copied by Connect_PLAYER_To_Gchange.sh) FINDEX=($( ls $HOME/.zen/game/players/${PLAYER}/FRIENDS/*/index.html)) + ## PREPARE Ŋ1 WORLD MAP + echo "var examples = {}; + examples['locations'] = function() { + var locations = {" > ~/.zen/tmp/world.js + floop=1 + for FRIENDTW in ${FINDEX[@]}; do - [[ ! -s $FRIENDTW ]] && echo "$FRIENDTW VIDE (AMI SANS TW)" && continue + [[ ! -s $FRIENDTW ]] && echo "$FRIENDTW VIDE (AMI SANS TW)" && ((floop++)) && continue APLAYER=$(ls $FRIENDTW | cut -d '/' -f 7) - rm -f ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${WISHNAME}/${APLAYER}.tiddlers.json ## CLEANING OLD FORMAT (TODO REMOVE) - rm -f ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${WISHNAME}/_${APLAYER}.tiddlers.json echo "TRY EXPORT [tag[G1${WISHNAME}]] FROM $FRIENDTW" tiddlywiki --load $FRIENDTW \ --output ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${WISHNAME} --render '.' _${APLAYER}'.tiddlers.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[tag[G1'${WISHNAME}']!tag[G1Voeu]]' - [[ ! -s ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${WISHNAME}/_${APLAYER}.tiddlers.json ]] && echo "NO ${WISHNAME} - CONTINUE -" && continue - [[ $(cat ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${WISHNAME}/_${APLAYER}.tiddlers.json) == "[]" ]] && echo "EMPTY ${WISHNAME} - CONTINUE -" && continue + [[ ! -s ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${WISHNAME}/_${APLAYER}.tiddlers.json ]] && echo "NO ${WISHNAME} - CONTINUE -" && ((floop++)) && continue + [[ $(cat ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${WISHNAME}/_${APLAYER}.tiddlers.json) == "[]" ]] && echo "EMPTY ${WISHNAME} - CONTINUE -" && ((floop++)) && continue echo "## TIDDLERS FOUND ;) MIAM >>> (◕‿‿◕) <<<" echo ">>> G1FRIEND § $myIPFS/$VOEUNS/_${APLAYER}.tiddlers.json ${WISHNAME}" + tiddlywiki --load ${FRIENDTW} --output ~/.zen/tmp --render '.' "${APLAYER}.${WISHNAME}.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' "${WISHNAME}" + WISHNS=$(cat ~/.zen/tmp/${APLAYER}.${WISHNAME}.json | jq -r '.[].wishns') + echo ">>> ${myIPFS}${WISHNS}" + + [[ $floop == ${#FINDEX[@]} ]] && virgule="" || virgule="," + echo " + ${APLAYER}: { + alpha: Math.random() * 2 * Math.PI, + delta: Math.random() * 2 * Math.PI, + name: '"${WISNAME} ${APLAYER}"', + link: '"${myIPFS}${WISHNS}"' + }$virgule + " >> ~/.zen/tmp/world.js + + ((floop++)) done ################################## - ## TODO JOIN WITH FRIENDS JSONS + ## FINISH LOCATIONS + echo"}; + $('#sphere').earth3d({ + locationsElement: $('#locations'), + dragElement: $('#locations'), + locations: locations + }); + }; + + $(document).ready(function() { + selectExample('locations'); + + $('#example').change(function() { + selectExample($(this).val()); + }); + }); + " >> ~/.zen/tmp/world.js + + cat ~/.zen/tmp/world.js + IAMAP=$(ipfs add -qw ~/.zen/tmp/world.js | tail -n 1) + echo "CREATING /ipfs/${IAMAP}/world.js" + + ################################## + ## MAKE MY OWN JSON ################################## MOA MAINTENANT echo ">>> EXPORT [tag[G1${WISHNAME}]!tag[G1Voeu]] § $myIPFSGW$VOEUNS/_${PLAYER}.tiddlers.json" tiddlywiki --load $INDEX \ @@ -141,8 +183,11 @@ do echo # echo "DEBUG : s~_LIBRA_~$(myIpfsGw)~g s~_G1VOEU_~${WISHNAME}~g s~_PLAYER_~${PLAYER}~g s~_VOEUNS_~${VOEUNS}~g s~_ASTRONAUTENS_~${ASTRONAUTENS}~g" echo + + ################################## + ## INSERT PLAYER G1 QRCODE : QRG1avatar.png #~ [[ ! -s ~/.zen/game/players/${PLAYER}/QRG1avatar.dir.ipfs ]] # REACTIVATE .? - ipfs add -qrw ~/.zen/game/players/${PLAYER}/QRG1avatar.png | tail -n 1 > ~/.zen/game/players/${PLAYER}/QRG1avatar.dir.ipfs + ipfs add -qw ~/.zen/game/players/${PLAYER}/QRG1avatar.png | tail -n 1 > ~/.zen/game/players/${PLAYER}/QRG1avatar.dir.ipfs QRLINK=$(cat ~/.zen/game/players/${PLAYER}/QRG1avatar.dir.ipfs) ################################## @@ -151,6 +196,7 @@ do -e "s~_G1VOEU_~${WISHNAME}~g" \ -e "s~_PLAYER_~${PLAYER}~g" \ -e "s~_VOEUNS_~${VOEUNS}~g" \ + -e "s~QmYdWBx32dP14XcbXF7hhtDq7Uu6jFmDaRnuL5t7ARPYkW/index_fichiers/world.js~${IAMAP}/world.js~g" \ -e "s~_ASTRONAUTENS_~${ASTRONAUTENS}~g" \ -e "s~QmWUpjGFuF7NhpXgkrCmx8Tbu4xjcFpKhE7Bsvt6HeKYxu/g1ticket_qrcode.png~${QRLINK}/QRG1avatar.png~g" \ -e "s~http://127.0.0.1:8080~${myIPFS}~g" \ @@ -169,7 +215,7 @@ do echo ">>> $VOEUKEY : Ŋ1 FLUX $(myIpfsGw)${VOEUNS}" echo "~/.zen/game/players/${PLAYER}/G1${WISHNAME}/${G1PUB}" - mv -f ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${WISHNAME}/* ~/.zen/game/players/${PLAYER}/G1${WISHNAME}/${G1PUB}/ + cp -f ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${WISHNAME}/* ~/.zen/game/players/${PLAYER}/G1${WISHNAME}/${G1PUB}/ done < ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/g1voeu/${PLAYER}.g1wishes.txt diff --git a/tools/vlc_webcam.sh b/tools/vlc_webcam.sh index e48d8949..2b253228 100755 --- a/tools/vlc_webcam.sh +++ b/tools/vlc_webcam.sh @@ -142,7 +142,7 @@ echo '[ "story": "'/ipfs/${IPFSROOT}'", "size": "'${FILE_BSIZE}'", "ipfs": "'/ipfs/${IPFSID}/output.mp4'", - "gif_ipfs": "'/ipfs/${ANIMH}'", + "gifanime": "'/ipfs/${ANIMH}'", "player": "'${PLAYER}'", "tags": "'${PLAYER} G1Vlog vlog ipfs'", "modified": "'${MOATS}'" diff --git a/www/G1PalPay/index.html b/www/G1PalPay/index.html index 7668ff74..532bd802 100644 --- a/www/G1PalPay/index.html +++ b/www/G1PalPay/index.html @@ -181,7 +181,7 @@ a {
Menu - +
+ - - - + + + - - + + - + + - + @@ -74,13 +75,14 @@ font-size: 40px; } - #glow-shadows.earth { +#glow-shadows.earth { background: url(http://127.0.0.1:8080/ipfs/QmTVspfoaNL1BK2CR1vVNrEnwo4PfUjwdQxEt57mGJjsLX/earth-glow-shadows.png); } #glow-shadows.mars { background: url(http://127.0.0.1:8080/ipfs/QmTVspfoaNL1BK2CR1vVNrEnwo4PfUjwdQxEt57mGJjsLX/mars-glow-shadows.png); } + .flight { position: absolute; width: 24px; @@ -93,25 +95,27 @@ margin-top: -12.5px; cursor: pointer; } + #yellow { background: black; position: absolute; bottom: 2%; left: 2%; width: 60%; - } +} + #ainfo { background: grey; position: absolute; top: 2%; left: 2%; - } +} - BAck in Le Claude + BAck in Le Claude
A Friendly Planet of Friends
@@ -230,11 +234,15 @@ TODO:
Choose example:
@@ -246,7 +254,7 @@ TODO:
- +
diff --git a/www/PasseportTerre/index_fichiers/demo.js b/www/PasseportTerre/index_fichiers/demo.js index a9a34cd3..6301ab46 100644 --- a/www/PasseportTerre/index_fichiers/demo.js +++ b/www/PasseportTerre/index_fichiers/demo.js @@ -1,206 +1,9 @@ -var examples = {}; - -examples['simple'] = function() { - $('#sphere').earth3d({ - dragElement: $('#locations') // where do we catch the mouse drag - }); -}; - -examples['simple_tilted'] = function() { - $('#sphere').earth3d({ - dragElement: $('#locations'), // where do we catch the mouse drag - sphere: { // rotation and size of the planet - tilt: 40, - turn: 20, - r: 10 - } - }); -}; - -examples['locations'] = function() { - /* defining locations to display. - Each position must have a key, an alpha and delta position (or x and y if you want to display a static location). - Any additional key can be reached via callbacks functions. - */ - var locations = { - obj1: { - alpha: Math.PI / 4, - delta: 0, - name: '_usa_', - link: 'https://oasis.astroport.com#usa' - }, - obj2: { - alpha: 1 * Math.PI / 4, - delta: -2 * Math.PI / 4, - name: '_africa_', - link: 'https://oasis.astroport.com#africa' - }, - obj3: { - alpha: 2 * Math.PI / 4, - delta: 0, - name: '_hawai_', - link: 'https://oasis.astroport.com#awai' - }, - obj4: { - alpha: 3 * Math.PI / 4, - delta: 3 * Math.PI / 4, - name: '_australia_', - link: 'https://oasis.astroport.com#australia' - }, - obj5: { - alpha: 2.2 * Math.PI / 4, - delta: -0.9 * Math.PI / 4, - name: '_southamerica_', - link: 'https://oasis.astroport.com#southamerica' - }, - obj6: { - alpha: 1.2 * Math.PI / 4, - delta: -2 * Math.PI / 4, - name: '_europe_', - link: 'https://oasis.astroport.com#europe' - } - }; - - $('#sphere').earth3d({ - locationsElement: $('#locations'), - dragElement: $('#locations'), // where do we catch the mouse drag - locations: locations - }); -}; - -examples['flights'] = function() { - /* defining locations to display. - Each position must have a key, an alpha and delta position (or x and y if you want to display a static location). - Any additional key can be reached via callbacks functions. - */ - var locations = { - obj1: { - alpha: Math.PI / 4, - delta: 0, - name: '_usa_', - link: 'https://oasis.astroport.com#usa' - }, - obj2: { - alpha: 1 * Math.PI / 4, - delta: -2 * Math.PI / 4, - name: '_africa_', - link: 'https://oasis.astroport.com#africa' - }, - obj3: { - alpha: 2 * Math.PI / 4, - delta: 0, - name: '_hawai_', - link: 'https://oasis.astroport.com#awai' - }, - obj4: { - alpha: 3 * Math.PI / 4, - delta: 3 * Math.PI / 4, - name: '_australia_', - link: 'https://oasis.astroport.com#australia' - }, - obj5: { - alpha: 2.2 * Math.PI / 4, - delta: -0.9 * Math.PI / 4, - name: '_southamerica_', - link: 'https://oasis.astroport.com#southamerica' - }, - obj6: { - alpha: 1.2 * Math.PI / 4, - delta: -2 * Math.PI / 4, - name: '_europe_', - link: 'https://oasis.astroport.com#europe' - }, - zero: { - alpha: 0 * Math.PI / 4, - delta: 0 * Math.PI / 4, - name: '_CraftYourWorld_', - link: 'https://ipfs.copylaradio.com/ipfs/QmNcNcYRDUFmR1Ey1MAyhzzZRJEi1Dfq8YXRTXq6XZ9n4A' - }, - pi: { - alpha: -3 * Math.PI / 4, - delta: -3 * Math.PI / 4, - name: '_OpenTW_', - link: 'https://astroport.copylaradio.com' - } - }; - /* defining paths to display. - Each path must have a key, an origin and a destination. The values are the location's key. - You can, if you want to, define flights on these paths. - Each flight has a key, a destination (the location's key) and a position. - The position is the progress a fleet has made on its path. - Any additional key can be reach via callbacks functions. - */ - var paths = { - path: { - origin: 'obj1', - destination: 'obj2', - flights: { - flight: { - position: 0.25, - destination: 'obj2', - name: 'Flight 1' - }, - flight2: { - position: 0.25, - destination: 'obj1', - name: 'Flight 2' - } - } - }, - path2: { - origin: 'obj1', - destination: 'obj3', - flights: { - flight3: { - position: 0.5, - destination: 'obj3', - name: 'Flight 3' - } - } - }, - path3: { - origin: 'obj1', - destination: 'obj4', - flights: { - flight4: { - position: 0.5, - destination: 'obj4', - name: 'Flight 4' - } - } - }, - path4: { - origin: 'obj1', - destination: 'obj5' - }, - path7: { - origin: 'obj1', - destination: 'obj5', - flights: { - flight5: { - position: 0.25, - destination: 'obj7', - name: 'Flight 5' - } - } - } - } - - $('#sphere').earth3d({ - flightsCanvas: $('#flights'), - locationsElement: $('#locations'), - dragElement: $('#locations'), // where do we catch the mouse drag - paths: paths, - locations: locations - }); -}; - function selectExample(example) { $('#sphere').earth3d('destroy'); $('#sphere').replaceWith($('')); $('.location').remove(); - $('.flight').remove(); - $('#flights')[0].getContext('2d').clearRect(0, 0, 400, 400); + //~ $('.flight').remove(); + //~ $('#flights')[0].getContext('2d').clearRect(0, 0, 400, 400); if (example == 'simple_mars') { $('#glow-shadows').removeClass('earth').addClass('mars'); } else { @@ -221,7 +24,7 @@ function selectExample(example) { $(document).ready(function() { - selectExample('flights'); + selectExample('locations'); $('#example').change(function() { selectExample($(this).val());