Open malted opened 1 week ago
To address the issue of init
generating an incomplete config, follow these steps:
Update init.rs
:
create_config_unreal
function to include matchmaking configuration prompts and defaults.matchmaker
configuration in the generated rivet.yaml
file.Update config.yaml
and config-prod.yaml
:
Example Code Changes:
// In `init.rs`, inside `create_config_unreal` function
let matchmaker_config = rivet_term::prompt::PromptBuilder::default()
.message("Configure matchmaker? (yes/no)")
.default_value("yes")
.build()?
.bool(term)
.await?;
if matchmaker_config {
// Add default matchmaker configuration
let matchmaker_yaml = r#"
matchmaker:
max_players: 32
tier: basic-1d1
game_modes:
default: {}
docker:
dockerfile: server.debug.Dockerfile
ports:
default:
port: 7777
protocol: udp
"#;
fs::write(&config_path, matchmaker_yaml).await?;
rivet_term::status::success("Added matchmaker configuration", "");
}
Ensure Validation:
read_config
function in config.rs
can handle the new fields and validate them properly.These changes will guide users through matchmaking configuration during rivet init
and ensure the generated config passes validation.
/cli/src/commands/init.rs /cli/src/commands/config.rs /cli/tpl/unreal_config/config.yaml /cli/tpl/unreal_config/config-prod.yaml /cli/src/commands/sidekick/generate_config.rs /cli/src/commands/sidekick/mod.rs /sdks/rust/src/models/cloud_version_matchmaker_game_mode_find_config.rs /sdks/rust/src/models/cloud_version_matchmaker_game_mode_create_config.rs /sdks/rust/src/models/cloud_version_matchmaker_game_mode_join_config.rs
Validation should ideally pass after init is complete.
This means
rivet init
should help you through matchmaking configuration too