use common::database::DatabaseCredentials;
use data::AssetsConfig;
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize)]
pub struct NapGSConfig {
    pub tcp_listen_addr: String,
    pub player_save_period_seconds: u64,
    #[serde(rename = "database")]
    pub database_credentials: DatabaseCredentials,
    pub assets: AssetsConfig,
}

impl Default for NapGSConfig {
    fn default() -> Self {
        Self {
            tcp_listen_addr: String::from("0.0.0.0:20501"),
            player_save_period_seconds: 30,
            database_credentials: DatabaseCredentials::default(),
            assets: AssetsConfig {
                filecfg_path: String::from("assets/FileCfg"),
                event_config_path: String::from("assets/EventConfig"),
                usm_keys_path: String::from("assets/VideoUSMEncKeys.json"),
                gacha_config_path: String::from("assets/GachaConfig"),
            },
        }
    }
}
