reconexion establecida

This commit is contained in:
2025-08-11 18:36:24 -06:00
parent e5e5ad452a
commit 9a44afc81a
6 changed files with 100 additions and 79 deletions

View File

@@ -111,6 +111,12 @@ const previewPlayer = computed(() => ({
onMounted(async () => {
try {
// Try reconnect to an ongoing game first
const reconnected = await colyseusService.tryReconnectToOngoingGame();
if (reconnected) {
router.push('/demo');
return;
}
const room = await colyseusService.joinLobby();
colorInput.value = colyseusService.playerColor.value || '#667eea';
@@ -228,7 +234,7 @@ async function joinRoom(roomId: string) {
colyseusService.lobbyRoom.value.leave();
colyseusService.lobbyRoom.value = null;
}
router.push('/game');
router.push('/demo');
} catch (error) {
console.error('Failed to join room:', error);
isJoining.value = false;