before change GM1

This commit is contained in:
2026-07-05 14:46:24 +00:00
parent a5b39f2303
commit 2ea383aee1
6 changed files with 1926 additions and 46 deletions
+1 -8
View File
@@ -940,6 +940,7 @@
let _mg3SnapAt = 0;
let _mg3LastMismatchKey = '';
function logStackSeatColors(tag, force) {
if (!force) return; /* diagnostic ปิด auto (2026-07-04 · MG3 สี confirmed) — เรียกมือ window.__mg3ColorLog() ยังได้ */
try {
if (!isStack() || !stackTurnOrderReadyPlay()) return;
const now = Date.now();
@@ -12767,14 +12768,6 @@
if (stackServerAuthPlay) {
/* server-auth: ส่งเจตนากดวาง + เฟสที่เราเห็น ณ ตอนนี้ → server วางตรงจุดที่เราเห็นแกว่ง (ไม่เยื้องตาม half-RTT) */
try { socket.emit('stack-drop-req', { phase: stackMini.phase }); } catch (e) { /* ignore */ }
/* [DBG-MG3drop] client ส่งอะไร + เห็น swing model ยังไง (เทียบกับ server log) — ถอดออกหลังวินิจฉัย */
try {
var _m = stackMini;
gamelogPost('MG3', 'mg3-send', 'srvAuth=' + stackServerAuthPlay
+ ' sentPhase=' + Number(_m.phase).toFixed(3) + ' amp=' + Number(_m.swingAmp).toFixed(3)
+ ' topCx=' + Number(_m.topCenterX).toFixed(3) + ' hangCx=' + Number(_m.topCenterX + _m.swingAmp * Math.sin(_m.phase)).toFixed(3)
+ ' hearts=' + _m.teamMissesLeft + ' layers=' + (_m.layers ? _m.layers.length : '?'), 'client');
} catch (e) { /* ignore */ }
stackMini.lastDropAt = Date.now(); /* กัน double-tap (server มี busyUntil อยู่แล้ว) */
/* freeze เฟสที่เห็น ณ ตอนกด ไว้จนดรอปกลับมา → ไม่แกว่งต่อแล้วเด้งกลับช่วงรอ echo */
stackLocalSwingFrozen = true;
+1 -1
View File
@@ -5458,7 +5458,7 @@
<script src="/Game/socket.io/socket.io.js"></script>
<script src="js/version.js?v=0.0306"></script>
<script src="js/sound.js?v=1"></script>
<script src="js/play.js?v=0.006301080"></script>
<script src="js/play.js?v=0.006301081"></script>
<div class="version-tag">v —</div>
<style id="qc-howto-mg2-fix">
/* HOW TO PLAY ของ quiz_carry (Minigame-4) -> ให้เหมือน Minigame-2 (gch-mg2-mock)
-34
View File
@@ -8420,20 +8420,8 @@ function runStackTick(sid, space) {
s.botAimDeadline = now + Math.min(15000, Math.ceil((_gap / _radPerSec) * 1000) + 1500);
}
if (!(s.phase >= s.botAimPhase || now >= s.botAimDeadline)) return;
const _dbgAim = s.botAimPhase; const _dbgDeadline = (now >= s.botAimDeadline) && !(s.phase >= s.botAimPhase);
s.botAimPhase = null;
const hit = stackComputeDropServer(s, md);
/* [DBG-MG3drop] บอทดรอปที่ s.phase → เทียบ aimPhase/จุดลง/รองรับ/overlap/miss (ถอดออกหลังวินิจฉัย) */
try {
const supportCx = hit.placedCx - (hit.delta || 0);
glog(sid, space, 'mg3-drop', 'BOT ' + (entry.botId || '') + ' phase=' + s.phase.toFixed(3)
+ ' aimPhase=' + (Number.isFinite(_dbgAim) ? _dbgAim.toFixed(3) : 'x') + (_dbgDeadline ? '(DEADLINE!)' : '(reached)')
+ ' sinDrop=' + Math.sin(s.phase).toFixed(3)
+ ' amp=' + s.swingAmp.toFixed(3) + ' topCx=' + s.topCenterX.toFixed(3)
+ ' placedCx=' + hit.placedCx.toFixed(3) + ' supportCx=' + supportCx.toFixed(3)
+ ' overlap=' + (hit.overlap != null ? hit.overlap.toFixed(3) : '?') + ' miss=' + hit.miss
+ ' layers=' + s.layers.length + ' hearts=' + s.teamMissesLeft);
} catch (e) { /* ignore */ }
stackApplyHitServer(s, hit, { botId: entry.botId });
io.to(sid).emit('stack-drop', {
placedCx: hit.placedCx, placedW: hit.placedW, miss: hit.miss, perfect: hit.perfect,
@@ -9040,18 +9028,6 @@ function stepSpaceShooterBots(sid, space, dt, now) {
s.lastEmit = now;
if (outBots.length) io.to(sid).emit('space-shooter-bot-move', { bots: outBots });
}
/* [DBG-MG6move] จับสถานะบอททุก ~2.5วิ → STILL=server ไม่ขับ, DEAD=ตาย(client ต้องซ่อน), MOV=ปกติ */
if (!s._dbgMT || now - s._dbgMT > 2500) {
s._dbgMT = now;
const rows = [];
s.bots.forEach((b, id) => {
const mv = (b._ldx == null) ? '?' : ((Math.abs(b.cx - b._ldx) + Math.abs(b.cy - b._ldy) > 2) ? 'MOV' : 'STILL');
b._ldx = b.cx; b._ldy = b.cy;
const tag = (id.indexOf(JS_BOT_PREFIX) === 0 ? 'pv' + id.slice(JS_BOT_PREFIX.length) : 'TK:' + String(id).slice(0, 5));
rows.push(tag + (b.takeover ? 'tk' : '') + '·' + (b.eliminated ? 'DEAD' : mv));
});
glog(sid, space, 'mg6-move', '[' + rows.join(' ') + ']');
}
}
/* ============================================================
@@ -11332,16 +11308,6 @@ io.on('connection', (socket) => {
const cph = data && Number(data.phase);
if (Number.isFinite(cph) && Math.abs(cph - s.phase) <= STACK_DROP_PHASE_TOL) dropPhase = cph;
const hit = stackComputeDropServer(s, md, dropPhase);
/* [DBG-MG3drop] เทียบ client-sent phase vs s.phase + จุดลง/รองรับ/overlap/miss/หัวใจ (ถอดออกหลังวินิจฉัย) */
try {
const supportCx = hit.placedCx - (hit.delta || 0);
glog(sid, space, 'mg3-drop', 'HUMAN cph=' + (Number.isFinite(cph) ? cph.toFixed(3) : 'x')
+ ' sPhase=' + s.phase.toFixed(3) + ' used=' + dropPhase.toFixed(3) + (dropPhase === cph ? '(client)' : '(server)')
+ ' amp=' + s.swingAmp.toFixed(3) + ' topCx=' + s.topCenterX.toFixed(3)
+ ' placedCx=' + hit.placedCx.toFixed(3) + ' supportCx=' + supportCx.toFixed(3)
+ ' overlap=' + (hit.overlap != null ? hit.overlap.toFixed(3) : '?') + ' miss=' + hit.miss + ' perfect=' + hit.perfect
+ ' layers=' + s.layers.length + ' hearts=' + s.teamMissesLeft);
} catch (e) { /* ignore */ }
stackApplyHitServer(s, hit, { id: entry.id });
const peer = space.peers.get(socket.id);
const theme = stackHumanThemeServer(peer) || (entry.theme || null);