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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user