From 06a16bb837b36758d984bea8ac5c45c9a44b238c Mon Sep 17 00:00:00 2001 From: giteaadmin Date: Fri, 1 May 2026 08:04:36 +0000 Subject: [PATCH] minigame 5 jumper 1.3 --- scripts/deploy-www.sh | 5 + www/html/Admin/admin.js | 41 +- www/html/Admin/index.html | 19 +- www/html/Game/data/game-timing.json | 3 +- www/html/Game/data/maps/mnpz6rkp.json | 2 +- www/html/Game/public/game-timing-admin.html | 17 + www/html/Game/public/img/ViolentCrime/1.png | Bin 0 -> 7503 bytes www/html/Game/public/img/ViolentCrime/2.png | Bin 0 -> 13153 bytes www/html/Game/public/img/ViolentCrime/3.png | Bin 0 -> 15691 bytes .../Game/public/img/ViolentCrime/Avartar.png | Bin 0 -> 19775 bytes .../Game/public/img/ViolentCrime/BG-1.png | Bin 0 -> 5586717 bytes .../public/img/ViolentCrime/BG-2_Loop.png | Bin 0 -> 3048631 bytes .../Game/public/img/ViolentCrime/Meteo-1.png | Bin 0 -> 47700 bytes .../Game/public/img/ViolentCrime/Meteo-2.png | Bin 0 -> 86835 bytes .../Game/public/img/ViolentCrime/Meteo-3.png | Bin 0 -> 120164 bytes .../public/img/ViolentCrime/Meteo-bomb.png | Bin 0 -> 37957 bytes .../Game/public/img/ViolentCrime/README.txt | 19 + .../Game/public/img/ViolentCrime/Rocket-1.png | Bin 0 -> 56275 bytes .../Game/public/img/ViolentCrime/Rocket-2.png | Bin 0 -> 56866 bytes .../Game/public/img/ViolentCrime/Rocket-3.png | Bin 0 -> 57466 bytes .../Game/public/img/ViolentCrime/Rocket-4.png | Bin 0 -> 62526 bytes .../Game/public/img/ViolentCrime/Rocket-5.png | Bin 0 -> 57567 bytes .../Game/public/img/ViolentCrime/Rocket-6.png | Bin 0 -> 64225 bytes .../Game/public/img/ViolentCrime/Rocket-7.png | Bin 0 -> 56543 bytes .../Game/public/img/ViolentCrime/Rocket-8.png | Bin 0 -> 58786 bytes .../img/ViolentCrime/Rocket-broke-1.png | Bin 0 -> 1266 bytes .../img/ViolentCrime/Rocket-broke-2.png | Bin 0 -> 2364 bytes .../img/ViolentCrime/Rocket-broke-3.png | Bin 0 -> 5554 bytes .../Game/public/img/ViolentCrime/btn-done.png | Bin 0 -> 22871 bytes .../img/ViolentCrime/btn-joystick-1.png | Bin 0 -> 4129 bytes .../img/ViolentCrime/btn-joystick-2.png | Bin 0 -> 6930 bytes .../public/img/ViolentCrime/btn-mic_off.png | Bin 0 -> 11586 bytes .../public/img/ViolentCrime/btn-mic_on.png | Bin 0 -> 12187 bytes .../public/img/ViolentCrime/btn-ready.png | Bin 0 -> 21502 bytes .../public/img/ViolentCrime/btn-start.png | Bin 0 -> 21167 bytes .../Game/public/img/ViolentCrime/life-bar.png | Bin 0 -> 13085 bytes .../public/img/ViolentCrime/life-full.png | Bin 0 -> 2731 bytes .../Game/public/img/ViolentCrime/life-hit.png | Bin 0 -> 3323 bytes .../public/img/ViolentCrime/popup-Howto.png | Bin 0 -> 520565 bytes .../img/ViolentCrime/popup-result-Line1.png | Bin 0 -> 203 bytes .../img/ViolentCrime/popup-result-Line2.png | Bin 0 -> 236 bytes .../public/img/ViolentCrime/popup-result.png | Bin 0 -> 80365 bytes .../img/ViolentCrime/result-Lose_stamp.png | Bin 0 -> 3084 bytes .../img/ViolentCrime/result-complete.png | Bin 0 -> 77943 bytes .../img/ViolentCrime/result-gameover.png | Bin 0 -> 51882 bytes .../public/img/ViolentCrime/result-timeup.png | Bin 0 -> 41471 bytes .../public/img/ViolentCrime/score-Topic.png | Bin 0 -> 5076 bytes .../img/ViolentCrime/score-avartar-mark.png | Bin 0 -> 256 bytes .../public/img/ViolentCrime/score-avartar.png | Bin 0 -> 2810 bytes .../public/img/ViolentCrime/score-bar.png | Bin 0 -> 1405 bytes .../Game/public/img/ViolentCrime/time.png | Bin 0 -> 4033 bytes www/html/Game/public/js/play.js | 441 +++++++++++++++++- www/html/Game/public/js/version.js | 2 +- www/html/Game/public/play.html | 19 +- www/html/Game/public/play.js | 12 + www/html/Game/server.js | 18 + 56 files changed, 558 insertions(+), 40 deletions(-) create mode 100644 www/html/Game/public/img/ViolentCrime/1.png create mode 100644 www/html/Game/public/img/ViolentCrime/2.png create mode 100644 www/html/Game/public/img/ViolentCrime/3.png create mode 100644 www/html/Game/public/img/ViolentCrime/Avartar.png create mode 100644 www/html/Game/public/img/ViolentCrime/BG-1.png create mode 100644 www/html/Game/public/img/ViolentCrime/BG-2_Loop.png create mode 100644 www/html/Game/public/img/ViolentCrime/Meteo-1.png create mode 100644 www/html/Game/public/img/ViolentCrime/Meteo-2.png create mode 100644 www/html/Game/public/img/ViolentCrime/Meteo-3.png create mode 100644 www/html/Game/public/img/ViolentCrime/Meteo-bomb.png create mode 100644 www/html/Game/public/img/ViolentCrime/README.txt create mode 100644 www/html/Game/public/img/ViolentCrime/Rocket-1.png create mode 100644 www/html/Game/public/img/ViolentCrime/Rocket-2.png create mode 100644 www/html/Game/public/img/ViolentCrime/Rocket-3.png create mode 100644 www/html/Game/public/img/ViolentCrime/Rocket-4.png create mode 100644 www/html/Game/public/img/ViolentCrime/Rocket-5.png create mode 100644 www/html/Game/public/img/ViolentCrime/Rocket-6.png create mode 100644 www/html/Game/public/img/ViolentCrime/Rocket-7.png create mode 100644 www/html/Game/public/img/ViolentCrime/Rocket-8.png create mode 100644 www/html/Game/public/img/ViolentCrime/Rocket-broke-1.png create mode 100644 www/html/Game/public/img/ViolentCrime/Rocket-broke-2.png create mode 100644 www/html/Game/public/img/ViolentCrime/Rocket-broke-3.png create mode 100644 www/html/Game/public/img/ViolentCrime/btn-done.png create mode 100644 www/html/Game/public/img/ViolentCrime/btn-joystick-1.png create mode 100644 www/html/Game/public/img/ViolentCrime/btn-joystick-2.png create mode 100644 www/html/Game/public/img/ViolentCrime/btn-mic_off.png create mode 100644 www/html/Game/public/img/ViolentCrime/btn-mic_on.png create mode 100644 www/html/Game/public/img/ViolentCrime/btn-ready.png create mode 100644 www/html/Game/public/img/ViolentCrime/btn-start.png create mode 100644 www/html/Game/public/img/ViolentCrime/life-bar.png create mode 100644 www/html/Game/public/img/ViolentCrime/life-full.png create mode 100644 www/html/Game/public/img/ViolentCrime/life-hit.png create mode 100644 www/html/Game/public/img/ViolentCrime/popup-Howto.png create mode 100644 www/html/Game/public/img/ViolentCrime/popup-result-Line1.png create mode 100644 www/html/Game/public/img/ViolentCrime/popup-result-Line2.png create mode 100644 www/html/Game/public/img/ViolentCrime/popup-result.png create mode 100644 www/html/Game/public/img/ViolentCrime/result-Lose_stamp.png create mode 100644 www/html/Game/public/img/ViolentCrime/result-complete.png create mode 100644 www/html/Game/public/img/ViolentCrime/result-gameover.png create mode 100644 www/html/Game/public/img/ViolentCrime/result-timeup.png create mode 100644 www/html/Game/public/img/ViolentCrime/score-Topic.png create mode 100644 www/html/Game/public/img/ViolentCrime/score-avartar-mark.png create mode 100644 www/html/Game/public/img/ViolentCrime/score-avartar.png create mode 100644 www/html/Game/public/img/ViolentCrime/score-bar.png create mode 100644 www/html/Game/public/img/ViolentCrime/time.png diff --git a/scripts/deploy-www.sh b/scripts/deploy-www.sh index 0a8859d..8eb73bd 100755 --- a/scripts/deploy-www.sh +++ b/scripts/deploy-www.sh @@ -38,6 +38,11 @@ JUMPER="$DST/Game/public/img/Jumper" mkdir -p "$JUMPER" chown www-data:www-data "$JUMPER" chmod 2775 "$JUMPER" +# Space shooter / Violent Crime — ชื่อโฟลเดอร์ไม่มีช่องว่าง (FTP MKD "Violent Crime" มัก 550) +VIOLENT_CRIME="$DST/Game/public/img/ViolentCrime" +mkdir -p "$VIOLENT_CRIME" +chown www-data:www-data "$VIOLENT_CRIME" +chmod 2775 "$VIOLENT_CRIME" GAME_SRV_HASH_AFTER="$(hash_game_server_js "$GAME_SERVER_JS")" if [[ -n "$GAME_SRV_HASH_AFTER" && "$GAME_SRV_HASH_BEFORE" != "$GAME_SRV_HASH_AFTER" ]]; then diff --git a/www/html/Admin/admin.js b/www/html/Admin/admin.js index b40ae61..115dd5e 100644 --- a/www/html/Admin/admin.js +++ b/www/html/Admin/admin.js @@ -2630,6 +2630,38 @@ }); } + function loadSpaceShooterTimingPanel() { + gameTimingFetch('GET') + .then(function (data) { + var inpT = el('space-shooter-mission-sec'); + if (inpT) { + var ss = Number(data.spaceShooterMissionTimeSec); + inpT.value = String(Number.isFinite(ss) && ss > 0 ? Math.floor(ss) : 0); + } + setMsg('space-shooter-timing-msg', '', ''); + }) + .catch(function (e) { + setMsg('space-shooter-timing-msg', e.message || 'โหลดไม่ได้', 'error'); + }); + } + + function saveSpaceShooterTimingPanel() { + var limSs = el('space-shooter-mission-sec') ? parseInt(String(el('space-shooter-mission-sec').value), 10) : 0; + if (Number.isNaN(limSs) || limSs < 0) limSs = 0; + limSs = limSs <= 0 ? 0 : Math.max(10, Math.min(7200, limSs)); + gameTimingFetch('GET') + .then(function (data) { + data.spaceShooterMissionTimeSec = limSs; + return gameTimingFetch('PUT', data); + }) + .then(function () { + setMsg('space-shooter-timing-msg', 'บันทึกแล้ว — ผู้เล่นยิงยานอวกาศได้ค่าใหม่เมื่อรีเฟรชหน้าเล่นหรือโหลด /api/game-timing', 'ok'); + }) + .catch(function (e) { + setMsg('space-shooter-timing-msg', e.message || 'บันทึกไม่ได้', 'error'); + }); + } + function saveJumpSurviveTimingPanel() { var inp = el('jump-survive-height-mult'); var jumpSurvMult = inp ? parseFloat(String(inp.value)) : 1.5; @@ -2681,7 +2713,7 @@ return gameTimingFetch('PUT', data); }) .then(function () { - setMsg('game-timing-msg', 'บันทึกแล้ว — พรมแดง tick·กระโดด / รูปอุปสรรค์ · มินิเกมกระโดดขึ้นแท่นตั้งที่แท็บ Minigame-5 · ค่า Stack แก้ที่แท็บ Stack เท่านั้น · จำกัดเวลาพรมแดงใช้กับรอบถัดไปที่โฮสต์เริ่มเกม', 'ok'); + setMsg('game-timing-msg', 'บันทึกแล้ว — พรมแดง tick·กระโดด / รูปอุปสรรค์ · Minigame-5 / Minigame-6 ตั้งแท็บของแต่ละเกม · ค่า Stack แก้ที่แท็บ Stack เท่านั้น · จำกัดเวลาพรมแดงใช้กับรอบถัดไปที่โฮสต์เริ่มเกม', 'ok'); }) .catch(function (e) { setMsg('game-timing-msg', e.message || 'บันทึกไม่ได้', 'error'); @@ -2725,6 +2757,7 @@ if (name === 'quiz-carry') loadQuizCarryPanel(); if (name === 'quiz-battle') loadQbBattlePanel(); if (name === 'jump-survive') loadJumpSurviveTimingPanel(); + if (name === 'space-shooter') loadSpaceShooterTimingPanel(); if (name === 'game-timing') loadGameTimingPanel(); if (name === 'stack-game') loadStackGamePanel(); } @@ -2850,6 +2883,10 @@ if (btnJumpSurviveSave) { btnJumpSurviveSave.addEventListener('click', saveJumpSurviveTimingPanel); } + var btnSpaceShooterSave = el('btn-space-shooter-save'); + if (btnSpaceShooterSave) { + btnSpaceShooterSave.addEventListener('click', saveSpaceShooterTimingPanel); + } var btnStackGameSave = el('btn-stack-game-save'); if (btnStackGameSave) { btnStackGameSave.addEventListener('click', saveStackGamePanel); @@ -3160,7 +3197,7 @@ try { want = new URL(window.location.href).searchParams.get('tab'); } catch (e) { /* ignore */ } - var allowed = { 'change-password': true, oauth: true, 'map-editor': true, quiz: true, 'quiz-carry': true, 'quiz-battle': true, 'jump-survive': true, 'game-timing': true, 'stack-game': true, characters: true, accounts: true, admins: true }; + var allowed = { 'change-password': true, oauth: true, 'map-editor': true, quiz: true, 'quiz-carry': true, 'quiz-battle': true, 'jump-survive': true, 'space-shooter': true, 'game-timing': true, 'stack-game': true, characters: true, accounts: true, admins: true }; if (!want || !allowed[want]) return 'oauth'; if (want === 'admins' && (!admin || admin.role !== 'super')) return 'oauth'; return want; diff --git a/www/html/Admin/index.html b/www/html/Admin/index.html index 810f512..f935c15 100644 --- a/www/html/Admin/index.html +++ b/www/html/Admin/index.html @@ -72,6 +72,7 @@ + @@ -464,9 +465,25 @@

+ +