From 7c3c4c9d71650631cf24966375da54fcc81b3dab Mon Sep 17 00:00:00 2001 From: giteaadmin Date: Thu, 18 Jun 2026 16:09:43 +0000 Subject: [PATCH] =?UTF-8?q?update=20game=20=E0=B9=80=E0=B8=81=E0=B8=A1?= =?UTF-8?q?=E0=B8=88=E0=B8=A3=E0=B8=B4=E0=B8=87=E0=B8=AB=E0=B8=A3=E0=B8=B7?= =?UTF-8?q?=E0=B8=AD=E0=B9=84=E0=B8=A1=E0=B9=88=20=E0=B8=96=E0=B9=89?= =?UTF-8?q?=E0=B8=B2=E0=B8=95=E0=B8=B2=E0=B8=A2=E0=B8=AB=E0=B8=A1=E0=B8=94?= =?UTF-8?q?=E0=B9=83=E0=B8=AB=E0=B9=89=E0=B9=80=E0=B8=81=E0=B8=A1=20Over?= =?UTF-8?q?=E0=B9=81=E0=B8=A5=E0=B8=B0=E0=B8=AD=E0=B8=B7=E0=B9=88=E0=B8=99?= =?UTF-8?q?=E0=B9=86=E0=B8=A1=E0=B8=B2=E0=B8=81=E0=B8=A1=E0=B8=B2=E0=B8=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- www/html/Admin/admin.js | 42 ++- www/html/Admin/index.html | 18 +- www/html/Admin/private/store.json | 16 +- www/html/Game/data/game-timing.json | 6 +- www/html/Game/data/maps/mnorwqx1.json | 2 +- .../Game/data/quiz-battle-leaderboard.json | 2 +- .../special-quiz/mock/special-quiz-tall.png | Bin 0 -> 90746 bytes .../special-quiz/reward/btn-continue-play.png | Bin 0 -> 21356 bytes .../img/special-quiz/reward/card--7txt.png | Bin 0 -> 51123 bytes .../img/special-quiz/reward/card-1-txt.png | Bin 0 -> 42213 bytes .../public/img/special-quiz/reward/card-1.png | Bin 0 -> 150042 bytes .../img/special-quiz/reward/card-2-txt.png | Bin 0 -> 64554 bytes .../public/img/special-quiz/reward/card-2.png | Bin 0 -> 139961 bytes .../img/special-quiz/reward/card-3-txt.png | Bin 0 -> 51357 bytes .../public/img/special-quiz/reward/card-3.png | Bin 0 -> 143374 bytes .../img/special-quiz/reward/card-4-txt.png | Bin 0 -> 46921 bytes .../public/img/special-quiz/reward/card-4.png | Bin 0 -> 144243 bytes .../img/special-quiz/reward/card-5-txt.png | Bin 0 -> 49740 bytes .../public/img/special-quiz/reward/card-5.png | Bin 0 -> 141788 bytes .../img/special-quiz/reward/card-6-txt.png | Bin 0 -> 47369 bytes .../public/img/special-quiz/reward/card-6.png | Bin 0 -> 143652 bytes .../public/img/special-quiz/reward/card-7.png | Bin 0 -> 132971 bytes .../img/special-quiz/reward/card-effect.png | Bin 0 -> 121380 bytes .../public/img/vote-ban/ban-card-broken.png | Bin 0 -> 62824 bytes .../Game/public/img/vote-ban/ban-card.png | Bin 0 -> 64548 bytes .../Game/public/img/vote-ban/ban-txt-2.png | Bin 0 -> 11786 bytes .../Game/public/img/vote-ban/ban-txt-3.png | Bin 0 -> 23366 bytes www/html/Game/public/img/vote-ban/ban-txt.png | Bin 0 -> 32718 bytes .../public/img/vote-ban/btn-confirm_1.png | Bin 0 -> 20806 bytes .../public/img/vote-ban/btn-start-game.png | Bin 0 -> 22436 bytes .../Game/public/img/vote-ban/frame-red.png | Bin 0 -> 8138 bytes .../Game/public/img/vote-ban/item-6-txt.png | Bin 0 -> 7680 bytes www/html/Game/public/img/vote-ban/item-6.png | Bin 0 -> 47063 bytes .../public/img/vote-ban/player-icon-bg.png | Bin 0 -> 8143 bytes .../img/vote-ban/player-icon-frame-select.png | Bin 0 -> 8423 bytes .../public/img/vote-ban/player-icon-frame.png | Bin 0 -> 3414 bytes .../Game/public/img/vote-ban/time-frame.png | Bin 0 -> 3419 bytes .../public/img/vote-ban/time-progress.png | Bin 0 -> 409 bytes .../Game/public/img/vote-ban/txt-result.png | Bin 0 -> 13464 bytes .../public/img/vote-silence/btn-confirm_1.png | Bin 0 -> 20806 bytes .../public/img/vote-silence/btn-gotovote.png | Bin 0 -> 27366 bytes .../img/vote-silence/card-silence-broken.png | Bin 0 -> 69144 bytes .../public/img/vote-silence/card-silence.png | Bin 0 -> 64914 bytes .../public/img/vote-silence/effect-card.png | Bin 0 -> 75093 bytes .../public/img/vote-silence/frame-red.png | Bin 0 -> 8138 bytes .../public/img/vote-silence/item-1-txt.png | Bin 0 -> 6786 bytes .../Game/public/img/vote-silence/item-1.png | Bin 0 -> 46098 bytes .../public/img/vote-silence/item-2-txt.png | Bin 0 -> 7145 bytes .../Game/public/img/vote-silence/item-2.png | Bin 0 -> 47760 bytes .../public/img/vote-silence/item-3-txt.png | Bin 0 -> 9633 bytes .../Game/public/img/vote-silence/item-3.png | Bin 0 -> 39012 bytes .../public/img/vote-silence/item-4-txt.png | Bin 0 -> 9069 bytes .../Game/public/img/vote-silence/item-4.png | Bin 0 -> 50282 bytes .../public/img/vote-silence/item-5-txt.png | Bin 0 -> 8964 bytes .../Game/public/img/vote-silence/item-5.png | Bin 0 -> 47123 bytes .../public/img/vote-silence/item-6-txt.png | Bin 0 -> 7680 bytes .../Game/public/img/vote-silence/item-6.png | Bin 0 -> 47063 bytes .../public/img/vote-silence/item-7-txt.png | Bin 0 -> 6294 bytes .../Game/public/img/vote-silence/item-7.png | Bin 0 -> 46367 bytes .../img/vote-silence/player-icon-bg.png | Bin 0 -> 8143 bytes .../vote-silence/player-icon-frame-select.png | Bin 0 -> 8423 bytes .../img/vote-silence/player-icon-frame.png | Bin 0 -> 3414 bytes .../public/img/vote-silence/result-txt-1.png | Bin 0 -> 21709 bytes .../public/img/vote-silence/result-txt-2.png | Bin 0 -> 23235 bytes .../public/img/vote-silence/time-frame.png | Bin 0 -> 3419 bytes .../public/img/vote-silence/time-progress.png | Bin 0 -> 409 bytes .../public/img/vote-silence/txt-header.png | Bin 0 -> 53599 bytes .../public/img/vote-silence/txt-result.png | Bin 0 -> 13464 bytes www/html/Game/public/js/play.js | 109 +++++- www/html/Game/public/js/room-lobby.js | 328 ++++++++++++++---- www/html/Game/public/play.html | 52 +-- www/html/Game/public/room-lobby.html | 2 +- www/html/Game/server.js | 125 +++++-- www/html/dev-summary-2026-06-17.html | 129 +++++++ .../cut/09-Quiz/special-quiz-tall.png | Bin 0 -> 90746 bytes .../silence-vote-mockup.html | 168 +++++++++ .../special-quiz-mockup.html | 126 +++++++ 77 files changed, 968 insertions(+), 157 deletions(-) create mode 100644 www/html/Game/public/img/special-quiz/mock/special-quiz-tall.png create mode 100644 www/html/Game/public/img/special-quiz/reward/btn-continue-play.png create mode 100644 www/html/Game/public/img/special-quiz/reward/card--7txt.png create mode 100644 www/html/Game/public/img/special-quiz/reward/card-1-txt.png create mode 100644 www/html/Game/public/img/special-quiz/reward/card-1.png create mode 100644 www/html/Game/public/img/special-quiz/reward/card-2-txt.png create mode 100644 www/html/Game/public/img/special-quiz/reward/card-2.png create mode 100644 www/html/Game/public/img/special-quiz/reward/card-3-txt.png create mode 100644 www/html/Game/public/img/special-quiz/reward/card-3.png create mode 100644 www/html/Game/public/img/special-quiz/reward/card-4-txt.png create mode 100644 www/html/Game/public/img/special-quiz/reward/card-4.png create mode 100644 www/html/Game/public/img/special-quiz/reward/card-5-txt.png create mode 100644 www/html/Game/public/img/special-quiz/reward/card-5.png create mode 100644 www/html/Game/public/img/special-quiz/reward/card-6-txt.png create mode 100644 www/html/Game/public/img/special-quiz/reward/card-6.png create mode 100644 www/html/Game/public/img/special-quiz/reward/card-7.png create mode 100644 www/html/Game/public/img/special-quiz/reward/card-effect.png create mode 100644 www/html/Game/public/img/vote-ban/ban-card-broken.png create mode 100644 www/html/Game/public/img/vote-ban/ban-card.png create mode 100644 www/html/Game/public/img/vote-ban/ban-txt-2.png create mode 100644 www/html/Game/public/img/vote-ban/ban-txt-3.png create mode 100644 www/html/Game/public/img/vote-ban/ban-txt.png create mode 100644 www/html/Game/public/img/vote-ban/btn-confirm_1.png create mode 100644 www/html/Game/public/img/vote-ban/btn-start-game.png create mode 100644 www/html/Game/public/img/vote-ban/frame-red.png create mode 100644 www/html/Game/public/img/vote-ban/item-6-txt.png create mode 100644 www/html/Game/public/img/vote-ban/item-6.png create mode 100644 www/html/Game/public/img/vote-ban/player-icon-bg.png create mode 100644 www/html/Game/public/img/vote-ban/player-icon-frame-select.png create mode 100644 www/html/Game/public/img/vote-ban/player-icon-frame.png create mode 100644 www/html/Game/public/img/vote-ban/time-frame.png create mode 100644 www/html/Game/public/img/vote-ban/time-progress.png create mode 100644 www/html/Game/public/img/vote-ban/txt-result.png create mode 100644 www/html/Game/public/img/vote-silence/btn-confirm_1.png create mode 100644 www/html/Game/public/img/vote-silence/btn-gotovote.png create mode 100644 www/html/Game/public/img/vote-silence/card-silence-broken.png create mode 100644 www/html/Game/public/img/vote-silence/card-silence.png create mode 100644 www/html/Game/public/img/vote-silence/effect-card.png create mode 100644 www/html/Game/public/img/vote-silence/frame-red.png create mode 100644 www/html/Game/public/img/vote-silence/item-1-txt.png create mode 100644 www/html/Game/public/img/vote-silence/item-1.png create mode 100644 www/html/Game/public/img/vote-silence/item-2-txt.png create mode 100644 www/html/Game/public/img/vote-silence/item-2.png create mode 100644 www/html/Game/public/img/vote-silence/item-3-txt.png create mode 100644 www/html/Game/public/img/vote-silence/item-3.png create mode 100644 www/html/Game/public/img/vote-silence/item-4-txt.png create mode 100644 www/html/Game/public/img/vote-silence/item-4.png create mode 100644 www/html/Game/public/img/vote-silence/item-5-txt.png create mode 100644 www/html/Game/public/img/vote-silence/item-5.png create mode 100644 www/html/Game/public/img/vote-silence/item-6-txt.png create mode 100644 www/html/Game/public/img/vote-silence/item-6.png create mode 100644 www/html/Game/public/img/vote-silence/item-7-txt.png create mode 100644 www/html/Game/public/img/vote-silence/item-7.png create mode 100644 www/html/Game/public/img/vote-silence/player-icon-bg.png create mode 100644 www/html/Game/public/img/vote-silence/player-icon-frame-select.png create mode 100644 www/html/Game/public/img/vote-silence/player-icon-frame.png create mode 100644 www/html/Game/public/img/vote-silence/result-txt-1.png create mode 100644 www/html/Game/public/img/vote-silence/result-txt-2.png create mode 100644 www/html/Game/public/img/vote-silence/time-frame.png create mode 100644 www/html/Game/public/img/vote-silence/time-progress.png create mode 100644 www/html/Game/public/img/vote-silence/txt-header.png create mode 100644 www/html/Game/public/img/vote-silence/txt-result.png create mode 100644 www/html/dev-summary-2026-06-17.html create mode 100644 www/html/onlydesign/Cut [Justice Game]_full1.1/cut/09-Quiz/special-quiz-tall.png create mode 100644 www/html/onlydesign/Cut [Justice Game]_full1.1/silence-vote-mockup.html create mode 100644 www/html/onlydesign/Cut [Justice Game]_full1.1/special-quiz-mockup.html diff --git a/www/html/Admin/admin.js b/www/html/Admin/admin.js index 9a2b49b..1867d8a 100644 --- a/www/html/Admin/admin.js +++ b/www/html/Admin/admin.js @@ -4689,6 +4689,7 @@ if (name === 'stack-game') loadStackGamePanel(); if (name === 'highscore') loadHighscore(); if (name === 'achievements') loadAchievementsPanel(); + if (name === 'vote-timing') loadVoteTimingPanel(); if (name === 'test-mode') { loadForcedMinigamePanel(); loadSpecialCardByMapPanel(); loadTroublesomeForcePanel(); } } @@ -5188,6 +5189,45 @@ }); })(); + /* ===== เวลาโหวต (vote timing) ===== */ + function loadVoteTimingPanel() { + gameTimingFetch('GET') + .then(function (data) { + var pk = (data && data.pickVoteSec != null) ? Number(data.pickVoteSec) : 25; + var tr = (data && data.trialVoteSec != null) ? Number(data.trialVoteSec) : 30; + if (el('vote-timing-pick')) el('vote-timing-pick').value = String(Number.isFinite(pk) ? pk : 25); + if (el('vote-timing-trial')) el('vote-timing-trial').value = String(Number.isFinite(tr) ? tr : 30); + setMsg('vote-timing-msg', '', ''); + }) + .catch(function (e) { setMsg('vote-timing-msg', (e.message || 'โหลดไม่ได้') + ' — เช็ค /Game/api/game-timing', 'error'); }); + } + + (function bindVoteTiming() { + var btn = el('btn-vote-timing-save'); + if (!btn) return; + btn.addEventListener('click', function () { + var pk = Math.max(5, Math.min(120, parseInt((el('vote-timing-pick') || {}).value, 10) || 25)); + var tr = Math.max(5, Math.min(180, parseInt((el('vote-timing-trial') || {}).value, 10) || 30)); + btn.disabled = true; + gameTimingFetch('GET') + .then(function (data) { + data.pickVoteSec = pk; + data.trialVoteSec = tr; + return gameTimingFetch('PUT', data); + }) + .then(function () { return gameTimingFetch('GET'); }) + .then(function (fresh) { + var p = (fresh && fresh.pickVoteSec != null) ? fresh.pickVoteSec : pk; + var t = (fresh && fresh.trialVoteSec != null) ? fresh.trialVoteSec : tr; + if (el('vote-timing-pick')) el('vote-timing-pick').value = String(p); + if (el('vote-timing-trial')) el('vote-timing-trial').value = String(t); + setMsg('vote-timing-msg', 'บันทึกแล้ว — โหวตเลือกผู้เล่น ' + p + 's · ชี้ตัวคนร้าย ' + t + 's · ผู้เล่นต้องรีเฟรช/เข้าห้องใหม่', 'ok'); + }) + .catch(function (e) { setMsg('vote-timing-msg', (e.message || 'บันทึกไม่ได้') + ' — เช็ค Node + /Game/api/game-timing', 'error'); }) + .then(function () { btn.disabled = false; }); + }); + })(); + /* ===== Achievements admin ===== */ var achvCatalog = []; var achvCatalogById = {}; @@ -5549,7 +5589,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, 'special-quiz': true, 'quiz-carry': true, 'quiz-battle': true, 'jump-survive': true, 'space-shooter': true, 'mega-virus': 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, 'special-quiz': true, 'vote-timing': true, 'quiz-carry': true, 'quiz-battle': true, 'jump-survive': true, 'space-shooter': true, 'mega-virus': 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 b575259..c9959a9 100644 --- a/www/html/Admin/index.html +++ b/www/html/Admin/index.html @@ -112,6 +112,7 @@ + @@ -1131,6 +1132,21 @@ + +