Add TeamSync canonical team state apply scaffold

This commit is contained in:
2026-06-12 00:57:17 -04:00
parent 6995e5b7f4
commit 4d893607c2
5 changed files with 141 additions and 0 deletions
+12
View File
@@ -1648,6 +1648,18 @@ void ServerState::load_accounts() {
void ServerState::load_teams() {
config_log.info_f("Indexing teams");
this->team_index = std::make_shared<TeamIndex>("system/teams", this->team_reward_defs_json);
TeamSync::set_canonical_team_state_callback([this](const phosg::JSON& canonical_team_state) -> void {
if (!this->team_index) {
return;
}
try {
this->team_index->replace_all_from_authority(canonical_team_state);
config_log.info_f("Applied canonical TeamSync team state");
} catch (const std::exception& e) {
config_log.warning_f("Failed to apply canonical TeamSync team state: {}", e.what());
}
});
}
void ServerState::load_patch_indexes() {