Add JoinMenu and join error handling

Add a new JoinMenu.vue component to provide a UI for joining existing games (emits a "join" event and offers Cancel/Join buttons). Improve UX by adding spacing to GameCreationMenu.vue header. Update OnlineMode.vue to import GameCreationMenu. In the API, send a client-side error message when adding a player fails (GameManager.cs now notifies the player's connection with "Spiel Existiert nicht!" before returning null) so users receive immediate feedback when a join attempt is invalid.
This commit is contained in:
2026-03-08 20:12:23 +01:00
committed by Jonas
parent 357449025a
commit a5019fc27a
4 changed files with 28 additions and 2 deletions
+5 -1
View File
@@ -21,7 +21,11 @@ public class GameManager(IGameRepository gameRepository, IHubContext<GameHubSock
var success = game != null && game.State == GameState.Lobby && game.AddPlayer(player);
if (!success) return null;
if (!success)
{
await hubContext.Clients.Client(player.ConnectionId).SendAsync("Error", "Spiel Existiert nicht!");
return null;
}
if (game.Players.Count == 2)
{