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

@@ -14,9 +14,9 @@ import (
"github.com/tolelom/catacombs/ui"
)
func Start(host string, port int, lobby *game.Lobby, db *store.DB) error {
func Start(addr string, lobby *game.Lobby, db *store.DB) error {
s, err := wish.NewServer(
wish.WithAddress(fmt.Sprintf("%s:%d", host, port)),
wish.WithAddress(addr),
wish.WithHostKeyPath(".ssh/catacombs_host_key"),
wish.WithPublicKeyAuth(func(_ ssh.Context, _ ssh.PublicKey) bool {
return true // accept all keys
@@ -40,6 +40,6 @@ func Start(host string, port int, lobby *game.Lobby, db *store.DB) error {
return fmt.Errorf("could not create server: %w", err)
}
log.Printf("Starting SSH server on %s:%d", host, port)
log.Printf("Starting SSH server on %s", addr)
return s.ListenAndServe()
}