minigame 1 question 1.4

This commit is contained in:
2026-05-02 16:07:50 +00:00
parent 0f50ea58b8
commit c1b4086f30
8 changed files with 136 additions and 12 deletions
+20
View File
@@ -19,11 +19,31 @@ hash_game_server_js() {
}
GAME_SRV_HASH_BEFORE="$(hash_game_server_js "$GAME_SERVER_JS")"
# ไม่ rsync ทับ Game/data/maps — ฉากที่สร้าง/บันทึกบนเซิร์ฟ (Node saveMap) มักใหม่กว่าใน repo
# หลัง deploy คัดลอกเฉพาะ *.json ที่มีใน repo แต่ยังไม่มีบนเซิร์ฟ (seed รหัสใหม่) ไม่แตะไฟล์ที่มีอยู่แล้ว
MAPS_SRC="$SRC/Game/data/maps"
MAPS_DST="$DST/Game/data/maps"
rsync -a \
--checksum \
--exclude 'node_modules' \
--exclude 'Game/data/maps/' \
"$SRC" "$DST"
chown -R www-data:www-data "$DST"
if [[ -d "$MAPS_SRC" ]]; then
mkdir -p "$MAPS_DST"
shopt -s nullglob
for f in "$MAPS_SRC"/*.json; do
base=$(basename "$f")
if [[ ! -f "$MAPS_DST/$base" ]]; then
cp -a "$f" "$MAPS_DST/$base"
echo "OK: seeded map (missing on server) $base"
fi
done
shopt -u nullglob
chown -R www-data:www-data "$MAPS_DST"
fi
# รูปป้าย quiz_carry — ให้เขียน/ลบได้ชัดเจน (FTP/Node); setgid ให้ไฟล์ใหม่ได้กลุ่ม www-data
PLAQUE="$DST/Game/public/img/quiz-carry-plaque-assets"
mkdir -p "$PLAQUE"