mirror of
https://github.com/tiennm99/noitu.git
synced 2026-10-06 02:16:12 +00:00
Create a room and share a six-character code or an invite link; join by either. The waiting room shows the code until an opponent arrives. During a game the opponent's disconnection raises a banner with the grace countdown, and their return clears it. When the game ends, the rematch prompt appears only while an offer is actually open, so there is never a button that can only produce an error. The board is now one component both modes render, which is what makes online play the same screen as the bot game rather than a second implementation of it. Room codes are normalized by stripping separators and reading the code out of a pasted invite link, and nothing else. Filtering out every character outside the alphabet would turn any sentence into six plausible letters and send the player to a room that was never theirs. The socket now opens when the player asks for a room, not on arrival: the handshake carries the nickname once, and a socket opened before they typed it introduced them under whatever was stored beforehand. A tab that already holds a session reconnects immediately instead, so refreshing mid-game returns to the game. A resume the server cannot honour is dropped quietly rather than opening the lobby with an error the player did nothing to cause. The client also notices a socket that fails without closing. Nothing did before, so the page kept showing a live connection and a running countdown over a socket nothing could reach. A tick that fired late is ignored, because a backgrounded tab has its timers throttled and would otherwise close a healthy connection every time the player switched away.
32 lines
826 B
JSON
32 lines
826 B
JSON
{
|
|
"name": "noitu-web",
|
|
"version": "0.0.0",
|
|
"private": true,
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "vite dev",
|
|
"build": "vite build",
|
|
"preview": "vite preview",
|
|
"prepare": "svelte-kit sync",
|
|
"check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
|
|
"test": "vite build && vitest run",
|
|
"test:e2e": "vite build && playwright test"
|
|
},
|
|
"dependencies": {
|
|
"@bufbuild/protobuf": "^2.14.1"
|
|
},
|
|
"devDependencies": {
|
|
"@bufbuild/protoc-gen-es": "^2.14.1",
|
|
"@playwright/test": "^1.63.0",
|
|
"@sveltejs/adapter-static": "^3.0.10",
|
|
"@sveltejs/kit": "^2.70.3",
|
|
"@sveltejs/vite-plugin-svelte": "^6.2.4",
|
|
"@types/node": "^26.4.1",
|
|
"jsdom": "^27.4.0",
|
|
"svelte": "^5.57.0",
|
|
"svelte-check": "^4.7.6",
|
|
"vite": "^7.3.6",
|
|
"vitest": "^3.2.4"
|
|
}
|
|
}
|