before change GM1
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user