도끼자루 게임 로비

접속자: 0명 | 대기실: 0개
개설된 방이 없습니다. 방을 만들어보세요!
다른 선수들을 기다리는 중...

카드 선택

버릴 카드를 선택하세요 (빨강)

승부 방식을 선택하세요
// [New] Toggle Sit Function function toggleSit() { if (!currentState || !currentState.players) return; const me = currentState.players.find(p => p.id === myId); if (!me) return; if (me.isSittingOut) { socket.emit('sit_in'); } else { if (confirm("정말로 휴식하시겠습니까? (다음 게임부터 제외됩니다)")) { socket.emit('sit_out'); } } } // [New] Scale-to-Fit Logic function resizeTable() { const table = document.getElementById('table'); if (!table || table.style.display === 'none') return; const baseWidth = 1500; // Increased from 1000 to fit wider player circle const baseHeight = 1000; // Increased from 600 const padding = 20; const availableWidth = window.innerWidth - padding; const availableHeight = window.innerHeight - padding; const scaleX = availableWidth / baseWidth; const scaleY = availableHeight / baseHeight; const scale = Math.min(scaleX, scaleY, 1.2); // Cap zoom at 1.2x table.style.transform = `translate(-50%, -50%) scale(${scale})`; } window.addEventListener('resize', resizeTable); // Call on load and periodically in case of layout shifts setInterval(resizeTable, 500); // [New] Omaha Auto Declaration Handler socket.on('omaha_eval_result', (data) => { const decUi = document.getElementById('declaration-ui'); decUi.dataset.omahaChecked = 'true'; decUi.dataset.canLow = data.canLow; // [Fix] Store result if (data.canLow) { // Restore UI Buttons renderDecButtons(decUi); } else { // Auto High const reason = (data.reason === 'quad') ? "Quad Auto Sweep!" : "No Low - Auto High"; decUi.innerHTML = `

${reason}

`; setTimeout(() => { // Auto-Select and Emit if (typeof selectDeclaration === 'function') selectDeclaration('high'); if (typeof confirmDeclaration === 'function') confirmDeclaration(); else { // Fallback if functions not found (safeguard) socket.emit('declare', 'high'); decUi.style.display = 'none'; } }, 1000); } }); function renderDecButtons(decUi) { decUi.innerHTML = `
승부 방식을 선택하세요
`; } // [Fix] Clear check flag on reset socket.on('system_message', (msg) => { if (msg === 'Next Game!' || msg === 'Game Start!') { const decUi = document.getElementById('declaration-ui'); if (decUi) decUi.dataset.omahaChecked = ''; } }); // [New] Dynamic Rules Window function openRules() { let url = 'rules.html'; if (currentState && currentState.config && currentState.config.gameType === 'omaha') { url = 'rules_omaha.html'; } // If config.gameType is 'choice', maybe check currentState.currentGameType? if (currentState && currentState.currentGameType === 'omaha') { url = 'rules_omaha.html'; } const width = 900; const height = 800; const left = (window.screen.width - width) / 2; const top = (window.screen.height - height) / 2; window.open(url, 'GameRules', `width=${width},height=${height},top=${top},left=${left}`); }