bbf26826c6ffd1fa8d12fa5e9b21913852ba8f8e
Previously leaveLobby was called after game.black/white.connected was set
to true. Because every logged-in socket is in a personal user:{id} room,
this.rooms.size was always >=2, so leaveLobby fired on every join and
immediately found the *new* game via the connected-flag check, resetting
connected=false. This prevented the bot-trigger and clock-start checks from
passing, so bot-as-white tournament games never made their first move.
Fix: move leaveLobby call to before the connection-state assignment so it
can only find a genuinely *previous* game (where connected was already true
from an earlier join).
Closes #4
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
MiChess
Eine selbst-gehostete Schachplattform, inspiriert von Lichess.org. Läuft als Docker-Container auf einer NAS — lokal, privat, ohne Cloud!
Basiert auf chessu (MIT) von dotnize — vielen Dank für die solide Basis.
Features
- Echtzeit-Multiplayer (Spieler vs. Spieler)
- Stockfish KI in 6 Schwierigkeitsgraden (Anfänger bis Meister)
- Nutzeraccounts mit E-Mail & Passwort
- Freundessystem mit Anfragen und Freundesliste
- Admin-Panel: Nutzerverwaltung, Sperren/Entsperren, Git-Update per Knopfdruck
- Spielarchiv & Statistiken
- Zuschauer & Chat
- Mobil-optimiert
Tech Stack
Next.js 14 · Tailwind CSS · daisyUI · react-chessboard · chess.js · Express.js · Socket.io · PostgreSQL · TypeScript · Docker
Deployment (NAS / Docker)
# 1. Repository klonen
git clone https://git.mischlabs.de/MrDiderot/MiChess.git michess
cd michess
# 2. Konfiguration anpassen
cp .env.example .env
nano .env # Passwörter, ADMIN_EMAIL etc. setzen
# 3. Starten
docker compose up -d --build
Frontend: http://deine-nas-ip:3000
Backend API: http://deine-nas-ip:3001
Update
# Manuell via Script
./scripts/update.sh
# Oder im Admin-Panel → "Jetzt aktualisieren"
Entwicklung (lokal)
pnpm install
pnpm dev
Lizenz
MIT · Copyright © 2024-present Tom Misch
Languages
TypeScript
98.4%
JavaScript
0.9%
Dockerfile
0.4%
Shell
0.2%