This commit is contained in:
fred 2023-03-15 20:11:22 +01:00
parent 42801f6525
commit 54f767c116
5 changed files with 9 additions and 58 deletions

View File

@ -31,44 +31,6 @@ PORT=$1 PLAYER=$2 APPNAME=$3 WHAT=$4 OBJ=$5 VAL=$6
[[ ! $ASTRONAUTENS ]] && (echo "$HTTPCORS UNKNOWN PLAYER $PLAYER - EXIT" | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &) && exit 1
##############################################
# PAY : /?player=PLAYER&pay=1&dest=G1PUB
##############################################
if [[ $APPNAME == "pay" ]]; then
echo "$HTTPCORS" > ~/.zen/tmp/$PLAYER.pay.$WHAT.http
if [[ $WHAT =~ ^[0-9]+$ ]]; then
echo "${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey pay -a ${WHAT} -p ${VAL} -c 'Bro' -m"
~/.zen/Astroport.ONE/tools/timeout.sh -t 20 \
${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey pay -a ${WHAT} -p ${VAL} -c 'Bro' -m 2>&1 >> ~/.zen/tmp/$PLAYER.pay.$WHAT.http
fi
if [[ "$WHAT" == "history" ]]; then
sed -i "s~text/html~application/json~g" ~/.zen/tmp/$PLAYER.pay.$WHAT.http
~/.zen/Astroport.ONE/tools/timeout.sh -t 20 \
${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey history -j >> ~/.zen/tmp/$PLAYER.pay.$WHAT.http
fi
if [[ "$WHAT" == "get" ]]; then
sed -i "s~text/html~application/json~g" ~/.zen/tmp/$PLAYER.pay.$WHAT.http
~/.zen/Astroport.ONE/tools/timeout.sh -t 20 \
${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey get >> ~/.zen/tmp/$PLAYER.pay.$WHAT.http
fi
if [[ "$WHAT" == "balance" ]]; then
~/.zen/Astroport.ONE/tools/timeout.sh -t 20 \
${MY_PATH}/../tools/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey balance >> ~/.zen/tmp/$PLAYER.pay.$WHAT.http
fi
cat ~/.zen/tmp/$PLAYER.pay.$WHAT.http
cat ~/.zen/tmp/$PLAYER.pay.$WHAT.http | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
end=`date +%s`
echo "(G_G ) G1BANK Operation time was "`expr $end - $start` seconds.
exit 0
fi
##############################################
# MOATUBE : /?player=PLAYER&moa=json&tag=FILTER
##############################################
if [[ $APPNAME == "moa" ]]; then

View File

@ -116,7 +116,7 @@ PEPPER=$THIS
cat ~/.zen/tmp/coucou/${MOATS}.messaging.json >> ~/.zen/tmp/coucou/${MOATS}.index.redirect
## SEND REPONSE PROCESS IN BACKGROUD
cat ~/.zen/tmp/coucou/${MOATS}.index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
(cat ~/.zen/tmp/coucou/${MOATS}.index.redirect | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 && rm ~/.zen/tmp/coucou/${MOATS}.index.redirect ) &
#~ ( ## USING IPNS SESSION KEY
#~ REPONSE=$(cat ~/.zen/tmp/coucou/${MOATS}.messaging.json | ipfs add -q)
#~ ipfs name publish --allow-offline --key=${PORT} /ipfs/$REPONSE
@ -385,7 +385,7 @@ echo "" > ~/.zen/tmp/.ipfsgw.bad.twt # TODO move in 20h12.sh
fi
cat ~/.zen/tmp/$PLAYER.pay.$WHAT.http
cat ~/.zen/tmp/$PLAYER.pay.$WHAT.http | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
(cat ~/.zen/tmp/$PLAYER.pay.$WHAT.http | nc -l -p ${PORT} -q 1 > /dev/null 2>&1 && rm ~/.zen/tmp/$PLAYER.pay.$WHAT.http ) &
end=`date +%s`
echo "(G_G ) G1BANK Operation time was "`expr $end - $start` seconds.
exit 0

View File

@ -230,18 +230,6 @@ GET /?salt=${SALT}&pepper=${PEPPER}&pay=1&g1pub=DsEx1pS33vzYZg4MroyBV9hCw98j1gtH
## ➤ PLAYER ZONE (API Station qui héberge ${PLAYER})
### ```/?player=${PLAYER}&${APPNAME}=${WHAT}&${OBJ}=${VAL}...```
### Déclencher un Payement de 99 Ğ1 à Fred
```http
GET /?player=${PLAYER}&pay=99&g1pub=DsEx1pS33vzYZg4MroyBV9hCw98j1gtHEhwiZ5tK7ech
```
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `player` | `string` | **Required**. Your EMAIL token |
| `pay` | `integer` | **Required** G1 AMOUNT |
| `g1pub` | `G1PUB` | **Required** destination "wallet key" |
### Exporter Tiddlers.json depuis son TW selon valeur des "tags" ( ici TAG=G1CopierYoutube)
```http
GET /?player=${PLAYER}&moa=json&tag=G1CopierYoutube

View File

@ -34,7 +34,7 @@ echo 'PRESS ENTER... '; read
## CREATE AND OR CONNECT USER
PS3='Astronaute connectez votre PLAYER ___ '
players=("NOUVEAU VISA" "IMPORT PLAYER" $(ls ~/.zen/game/players | grep -Ev "localhost" 2>/dev/null))
players=("NOUVEAU VISA" "IMPORT PLAYER" $(ls ~/.zen/game/players | grep "@" 2>/dev/null))
## MULTIPLAYER
select fav in "${players[@]}"; do
@ -134,11 +134,11 @@ select fav in "${choices[@]}"; do
## REMOVE PLAYER DOCKER
[[ $USER == "zen" ]] && make player MAIL=$PLAYER DELETE=true
echo "REMOVING GCHANGE+ PROFILE"
$MY_PATH/tools/jaklis/jaklis.py -k $HOME/.zen/game/players/$PLAYER/secret.dunikey -n "$myDATA" erase
#~ echo "REMOVING GCHANGE+ PROFILE"
#~ $MY_PATH/tools/jaklis/jaklis.py -k $HOME/.zen/game/players/$PLAYER/secret.dunikey -n "$myDATA" erase
#~ echo "REMOVE CESIUM+"
$MY_PATH/tools/jaklis/jaklis.py -k $HOME/.zen/game/players/$PLAYER/secret.dunikey -n "$myCESIUM" erase
echo "REMOVE CESIUM+"
#~ $MY_PATH/tools/jaklis/jaklis.py -k $HOME/.zen/game/players/$PLAYER/secret.dunikey -n "$myCESIUM" erase
echo "rm -Rf ~/.zen/game/players/$PLAYER"
rm -Rf ~/.zen/game/players/$PLAYER

View File

@ -43,6 +43,7 @@ if [[ ! -d $img_dir ]]; then
convert -font 'Liberation-Sans' \
-pointsize 80 -fill purple -draw 'text 50,120 "'"$COINS Ğ1"'"' \
-pointsize 30 -fill purple -draw 'text 40, 180 "'"$PLAYER"'"' \
-pointsize 14 -fill white -draw 'text 40, 200 "'"$(date)"'"' \
"${HOME}/.zen/tmp/one.png" "${HOME}/.zen/tmp/carousel/${pub}.png" \
&& rm ${HOME}/.zen/tmp/carousel/${pub}.one.png
@ -85,7 +86,7 @@ echo "<link rel=\"stylesheet\" href=\"/ipfs/QmX9QyopkTw9TdeC6yZpFzutfjNFWP36nzfP
}
</style>
<h3 id=\"countdown\"> $myHOST : $(date)</h3>
<h3 id=\"countdown\"> $myHOST :: ${#PLAYERONE[@]}</h3>
<div class=\"container\">