fixes(tournament): tournament now no long blocks you and you get removed from queue when joining a tournament

This commit is contained in:
Maieul BOYER 2026-01-13 17:13:12 +01:00 committed by Nigel
parent 6fa846f1e2
commit 06fa768c84
2 changed files with 4 additions and 2 deletions

View file

@ -367,6 +367,7 @@ function pongClient(
});
socket.on("tourEnding", (ending) => {
inTournament = false;
showInfo(ending);
});
// ---
@ -557,12 +558,12 @@ function pongClient(
tournamentBtn.innerText = TourBtnState.AbleToCreate;
break;
case "playing":
inTournament = true;
inTournament = weIn;
tournamentBtn.innerText = TourBtnState.Started;
tour_infos.innerText = `${TourInfoState.Running} ${s.players.length}👤 ${s.remainingMatches ?? "?"}▮•▮`;
break;
case "prestart":
inTournament = true;
inTournament = weIn;
tour_infos.innerText = `${imOwner ? TourInfoState.Owner : weIn ? TourInfoState.Registered : TourInfoState.NotRegisted} ${s.players.length}👤 ?▮•▮`;
if (imOwner) {
tournamentBtn.innerText = TourBtnState.AbleToStart;

View file

@ -157,6 +157,7 @@ class StateI {
return;
}
this.queue.delete(user.id);
this.tournament.addUser(user.id, name ?? udb.name);
sock.emit('tournamentRegister', {
kind: 'success',