From dc7df561c35895e9bc8026bdaa1457fb62d51173 Mon Sep 17 00:00:00 2001 From: syui Date: Wed, 19 Mar 2025 12:04:31 +0900 Subject: [PATCH] fix --- scpt/src/ai/syui/game/character.zsh | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/scpt/src/ai/syui/game/character.zsh b/scpt/src/ai/syui/game/character.zsh index acceff6..1190c51 100755 --- a/scpt/src/ai/syui/game/character.zsh +++ b/scpt/src/ai/syui/game/character.zsh @@ -195,6 +195,7 @@ function ai_create_user() { did=$did_yui handle=$handle_yui pds=bsky.social + version=2 #rkey=syui #img=https://cdn.bsky.app/img/feed_thumbnail/plain/did:plc:4hqjfn7m6n5hno3doamuhgef/bafkreie34pjuc6coenzcdwrgrh4fbacq7bkhsz263g5vpbsqxwaz37kkwy@jpeg req=com.atproto.repo.putRecord @@ -264,6 +265,12 @@ function ai_create_user() { } }" +json_item=" +\"coin\": { \"id\": 0, \"count\": 0 }, +\"card\": { \"id\": 0, \"count\": 0 }, +\"weapon\": { \"id\": 0, \"count\": 0 } +" + json=" { \"repo\": \"$handle_yui\", @@ -271,7 +278,7 @@ function ai_create_user() { \"collection\": \"$col\", \"rkey\": \"$rkey\", \"record\": { - \"version\": 2, + \"version\": $version, \"did\": \"$did\", \"handle\": \"$handle\", \"player\": { @@ -281,18 +288,26 @@ function ai_create_user() { \"gender\": \"$gender\" }, \"character\": { - $json + $json }, - \"createdAt\": \"${created}\", - \"updatedAt\": \"${created}\" -} + \"item\": { + $json_item + }, + \"createdAt\": \"${created}\", + \"updatedAt\": \"${created}\" + } }" if echo $json|jq . ;then echo y read y if [ "y" = "$y" ];then - 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 . + f=~/ai/ue/json/v${version}_${rkey}.json + if [ -f $f ];then + echo $t|jq . >! $f + fi fi fi