(update) allow /player and /track to be used in playground.

This commit is contained in:
iceBear67 committed 2024-09-21 20:18:46 +08:00
1 parent 8620625c6f
commit 7750aefc0e
2 files changed
+6 -1

No files matched your search

+2
View File
@@ -45,6 +45,8 @@ jobs:
SERVER_ID: ${{ secrets.SERVER_ID }}
TOKEN: ${{ secrets.TOKEN }}
UPLOAD_DIR: "../build/libs"
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
COMMIT_AUTHOR: ${{ github.event.head_commit.author.name }}
run: |
cd scripts
chmod +x ./special_curl
+4 -1
View File
@@ -27,7 +27,10 @@ fi
special_curl "$SIGNED_URL&directory=/mods" -X POST -F "files=@$UPLOAD"
echo "Uploaded!"
BROADCAST="[ SFCRAFT UPDATE ] Server is shutting down in 10s, please be ready."
BROADCAST="Server is shutting down in 10s, please be ready."
UPDATE_CONTENT="[ SFCRAFT UPDATE ] $COMMIT_MESSAGE by $COMMIT_AUTHOR"
special_curl "$API_ENDPOINT/api/client/servers/$SERVER_ID/command" -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer $TOKEN" -X POST -d "{\"command\":\"say $UPDATE_CONTENT\"}"
sleep 1s
special_curl "$API_ENDPOINT/api/client/servers/$SERVER_ID/command" -H "Content-Type: application/json" -H "Accept: application/json" -H "Authorization: Bearer $TOKEN" -X POST -d "{\"command\":\"say $BROADCAST\"}"
echo "Broadcast is sent!"
sleep 10s