fix patch
This commit is contained in:
parent
72b8f39825
commit
cc27f367ea
@ -49,6 +49,10 @@ case $1 in
|
|||||||
source $d/src/ai/syui/game/character.zsh
|
source $d/src/ai/syui/game/character.zsh
|
||||||
create_game_user $2
|
create_game_user $2
|
||||||
;;
|
;;
|
||||||
|
create-item)
|
||||||
|
source $d/src/ai/syui/game/character.zsh
|
||||||
|
create_item
|
||||||
|
;;
|
||||||
get-game-user)
|
get-game-user)
|
||||||
source $d/src/ai/syui/game/character.zsh
|
source $d/src/ai/syui/game/character.zsh
|
||||||
get_game_user $2
|
get_game_user $2
|
||||||
|
@ -209,7 +209,7 @@ delete_game_user() {
|
|||||||
fi
|
fi
|
||||||
req=com.atproto.repo.DeleteRecord
|
req=com.atproto.repo.DeleteRecord
|
||||||
url=https://$pds/xrpc/$req
|
url=https://$pds/xrpc/$req
|
||||||
repo=$did_yui
|
repo=$did
|
||||||
json="{\"collection\":\"$col\", \"rkey\":\"$rkey\", \"repo\":\"$repo\"}"
|
json="{\"collection\":\"$col\", \"rkey\":\"$rkey\", \"repo\":\"$repo\"}"
|
||||||
echo $json
|
echo $json
|
||||||
curl -sL -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $token" -d $json $url
|
curl -sL -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $token" -d $json $url
|
||||||
@ -221,7 +221,7 @@ function create_game_user() {
|
|||||||
did=$did_yui
|
did=$did_yui
|
||||||
handle=$handle_yui
|
handle=$handle_yui
|
||||||
pds=bsky.social
|
pds=bsky.social
|
||||||
version=2
|
version=4
|
||||||
#rkey=syui
|
#rkey=syui
|
||||||
#img=https://cdn.bsky.app/img/feed_thumbnail/plain/did:plc:4hqjfn7m6n5hno3doamuhgef/bafkreie34pjuc6coenzcdwrgrh4fbacq7bkhsz263g5vpbsqxwaz37kkwy@jpeg
|
#img=https://cdn.bsky.app/img/feed_thumbnail/plain/did:plc:4hqjfn7m6n5hno3doamuhgef/bafkreie34pjuc6coenzcdwrgrh4fbacq7bkhsz263g5vpbsqxwaz37kkwy@jpeg
|
||||||
req=com.atproto.repo.putRecord
|
req=com.atproto.repo.putRecord
|
||||||
@ -242,18 +242,26 @@ function create_game_user() {
|
|||||||
cid=bafkreidlealfybajqzwv5eoz4jshnsijc2vnktlhpw4ph47krwj6aigqby
|
cid=bafkreidlealfybajqzwv5eoz4jshnsijc2vnktlhpw4ph47krwj6aigqby
|
||||||
gender=male
|
gender=male
|
||||||
fi
|
fi
|
||||||
|
if [ "$rkey" = "self" ];then
|
||||||
|
cname=manny
|
||||||
|
unset did handle gender
|
||||||
|
fi
|
||||||
imguri=https://cdn.bsky.app/img/feed_thumbnail/plain/$did_yui/${cid}@jpeg
|
imguri=https://cdn.bsky.app/img/feed_thumbnail/plain/$did_yui/${cid}@jpeg
|
||||||
season=1
|
season=1
|
||||||
group=test
|
group=test
|
||||||
lv=1
|
lv=1
|
||||||
hp=1
|
hp=1
|
||||||
exp=0
|
exp=0
|
||||||
rank=0
|
rare=0
|
||||||
mode=0
|
mode=0
|
||||||
attack=0
|
attack=0
|
||||||
attack_post=0
|
attack_post=0
|
||||||
critical=0
|
critical=0
|
||||||
critical_d=0
|
critical_d=0
|
||||||
|
card=0
|
||||||
|
weapon=0
|
||||||
|
coin=0
|
||||||
|
count=0
|
||||||
|
|
||||||
case $cname in
|
case $cname in
|
||||||
ai)
|
ai)
|
||||||
@ -268,7 +276,8 @@ function create_game_user() {
|
|||||||
group=fantasy
|
group=fantasy
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
json="\"$cname\": { \"group\": \"$group\", \"season\": $season, \"lv\": $lv, \"exp\": $exp, \"hp\": $hp, \"rank\": $rank, \"mode\": $mode, \"attack\": $attack, \"critical\": $critical, \"critical_d\": $critical_d }"
|
|
||||||
|
json="\"$cname\": { \"group\": \"$group\", \"season\": $season, \"lv\": $lv, \"exp\": $exp, \"hp\": $hp, \"mode\": $mode, \"attack\": $attack, \"critical\": $critical, \"critical_d\": $critical_d, \"card\": $card, \"coin\": $coin, \"weapon\": $weapon, \"count\": $count, \"rare\": $rare}"
|
||||||
#json="\"$cname\": { \"group\": \"$group\", \"season\": $season, \"img\": \"$imguri\", \"lv\": $lv, \"exp\": $exp, \"hp\": $hp, \"rank\": $rank, \"mode\": $mode, \"attack\": $attack, \"attack_post\": $attack_post, \"critical\": $critical, \"critical_d\": $critical_d }"
|
#json="\"$cname\": { \"group\": \"$group\", \"season\": $season, \"img\": \"$imguri\", \"lv\": $lv, \"exp\": $exp, \"hp\": $hp, \"rank\": $rank, \"mode\": $mode, \"attack\": $attack, \"attack_post\": $attack_post, \"critical\": $critical, \"critical_d\": $critical_d }"
|
||||||
|
|
||||||
v1_json="
|
v1_json="
|
||||||
@ -293,9 +302,9 @@ function create_game_user() {
|
|||||||
}"
|
}"
|
||||||
|
|
||||||
json_item="
|
json_item="
|
||||||
\"coin\": { \"id\": 0, \"count\": 0 },
|
\"coin\": [{\"id\": 0, \"cp\": 0, \"rare\": 0, \"count\": 0}],
|
||||||
\"card\": { \"id\": 0, \"count\": 0, \"cp\": 0, \"rare\": 0 },
|
\"card\": [{\"id\": 0, \"cp\": 0, \"rare\": 0, \"count\": 0}],
|
||||||
\"weapon\": { \"id\": 0, \"count\": 0, \"attack\": 0, \"type\": 0, \"tp\": 0 }
|
\"weapon\": [{\"id\": 0, \"cp\": 0, \"rare\": 0, \"count\": 0}]
|
||||||
"
|
"
|
||||||
|
|
||||||
json="
|
json="
|
||||||
@ -313,7 +322,7 @@ json_item="
|
|||||||
\"player\": {
|
\"player\": {
|
||||||
\"limit\": false,
|
\"limit\": false,
|
||||||
\"login\": false,
|
\"login\": false,
|
||||||
\"aiten\": 0,
|
\"ten\": 0,
|
||||||
\"gender\": \"$gender\"
|
\"gender\": \"$gender\"
|
||||||
},
|
},
|
||||||
\"character\": {
|
\"character\": {
|
||||||
@ -332,12 +341,52 @@ if echo $json|jq . ;then
|
|||||||
read y
|
read y
|
||||||
if [ "y" = "$y" ];then
|
if [ "y" = "$y" ];then
|
||||||
t=`curl -sL -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $token" -d $json $url`
|
t=`curl -sL -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $token" -d $json $url`
|
||||||
echo $t|jq .
|
#echo $t|jq .
|
||||||
f=~/ai/ue/json/v${version}_${rkey}.json
|
#f=~/ai/ue/json/v${version}_${rkey}.json
|
||||||
if [ -f $f ];then
|
#if [ -f $f ];then
|
||||||
get_game_user $rkey >! $f
|
# get_game_user $rkey >! $f
|
||||||
fi
|
#fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function create_item() {
|
||||||
|
col=ai.syui.item
|
||||||
|
rkey=self
|
||||||
|
did=$did_yui
|
||||||
|
handle=$handle_yui
|
||||||
|
pds=bsky.social
|
||||||
|
version=1
|
||||||
|
#rkey=syui
|
||||||
|
#img=https://cdn.bsky.app/img/feed_thumbnail/plain/did:plc:4hqjfn7m6n5hno3doamuhgef/bafkreie34pjuc6coenzcdwrgrh4fbacq7bkhsz263g5vpbsqxwaz37kkwy@jpeg
|
||||||
|
req=com.atproto.repo.putRecord
|
||||||
|
url=https://$pds/xrpc/$req
|
||||||
|
cid=bafkreia3huw2gdenqatoobx3hcft74chced46bw4znfgepo5aenegobkri
|
||||||
|
imguri=https://cdn.bsky.app/img/feed_thumbnail/plain/$did_yui/${cid}@jpeg
|
||||||
|
imgurl=https://git.syui.ai/ai/ai/raw/branch/main/item/
|
||||||
|
json_card=" \"id\": $id, \"name\": \"$name\", \"img\": \"${imgurl}/${id}.webp\""
|
||||||
|
json_card=`curl -sL https://git.syui.ai/ai/ai/raw/branch/main/item/card.json|jq .`
|
||||||
|
json_weapon=`curl -sL https://git.syui.ai/ai/ai/raw/branch/main/item/weapon.json|jq .`
|
||||||
|
json="
|
||||||
|
{
|
||||||
|
\"repo\": \"$handle_yui\",
|
||||||
|
\"did\": \"$did_yui\",
|
||||||
|
\"collection\": \"$col\",
|
||||||
|
\"rkey\": \"$rkey\",
|
||||||
|
\"record\": {
|
||||||
|
\"card\": ${json_card},
|
||||||
|
\"weapon\": ${json_weapon},
|
||||||
|
\"createdAt\": \"${created}\",
|
||||||
|
\"updatedAt\": \"${created}\"
|
||||||
|
}
|
||||||
|
}"
|
||||||
|
|
||||||
|
if echo $json|jq . ;then
|
||||||
|
echo y
|
||||||
|
read y
|
||||||
|
if [ "y" = "$y" ];then
|
||||||
|
t=`curl -sL -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $token" -d $json $url`
|
||||||
|
echo $t|jq .
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
@ -15,7 +15,7 @@ function at-env() {
|
|||||||
collection=`echo $at_uri|cut -d / -f 4`
|
collection=`echo $at_uri|cut -d / -f 4`
|
||||||
rkey=`echo $at_uri|cut -d / -f 5`
|
rkey=`echo $at_uri|cut -d / -f 5`
|
||||||
d=${0:a:h}
|
d=${0:a:h}
|
||||||
f=~/.config/.at-zsh.json
|
f=~/.config/ai/token.json
|
||||||
if [ -f $f ];then
|
if [ -f $f ];then
|
||||||
host=`cat $f|jq -r ".didDoc.service.[].serviceEndpoint"`
|
host=`cat $f|jq -r ".didDoc.service.[].serviceEndpoint"`
|
||||||
token=`cat $f|jq -r .accessJwt`
|
token=`cat $f|jq -r .accessJwt`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user