from pydantic_settings import BaseSettings, SettingsConfigDict


class Settings(BaseSettings):
    model_config = SettingsConfigDict(env_file=".env", extra="ignore")

    database_url: str
    casual_team_size: int = 7
    dev_seed_server_ip: str = "127.0.0.1"
    dev_seed_server_port: int = 7777
    # Real/demo servers are considered offline once their last heartbeat is
    # older than this. Godot's NetworkManager heartbeats every 8s (see
    # spacewar/autoload/network_manager.gd's HEARTBEAT_INTERVAL), so this
    # needs enough slack for one missed beat without flapping a live server
    # to "offline" and back.
    server_stale_seconds: int = 20


settings = Settings()
