feat: wire config into main, server, and lobby

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-25 13:02:54 +09:00
parent 0f524779c0
commit ad1482ae03
5 changed files with 49 additions and 20 deletions

View File

@@ -4,6 +4,8 @@ import (
"fmt"
"math/rand"
"sync"
"github.com/tolelom/catacombs/config"
)
type RoomStatus int
@@ -36,13 +38,15 @@ type OnlinePlayer struct {
type Lobby struct {
mu sync.RWMutex
cfg *config.Config
rooms map[string]*LobbyRoom
online map[string]*OnlinePlayer // fingerprint -> player
activeSessions map[string]string // fingerprint -> room code (for reconnect)
}
func NewLobby() *Lobby {
func NewLobby(cfg *config.Config) *Lobby {
return &Lobby{
cfg: cfg,
rooms: make(map[string]*LobbyRoom),
online: make(map[string]*OnlinePlayer),
activeSessions: make(map[string]string),