feat(authentication): authed lobby-joining method

Players can now join by their authenticatied account to lobbies. Only one account can join to a specific lobby.
This commit is contained in:
2026-05-28 18:01:57 +03:30
parent 0b4cb868e7
commit 4d6ae9efc3
7 changed files with 114 additions and 73 deletions
+2 -1
View File
@@ -3,6 +3,7 @@ package state
import (
"testing"
"github.com/gofrs/uuid/v5"
"github.com/stretchr/testify/require"
"medad.fun/internal/config"
"medad.fun/internal/game"
@@ -13,7 +14,7 @@ func TestAddAndRemove(t *testing.T) {
require.Empty(t, lobbies, "Lobbies should be empty when test starts")
createLobby := func() *game.Lobby {
player, lobby, err := game.CreateLobby("", "player", "dutch", true, 100, 10, 10, 3, 3, 1, nil, game.ChillScoring)
player, lobby, err := game.CreateLobby("", "player", uuid.Must(uuid.NewV4()), "dutch", true, 100, 10, 10, 3, 3, 1, nil, game.ChillScoring)
require.NoError(t, err)
lobby.OnPlayerDisconnect(player)
return lobby