Send the owner its outstanding mutation offer over v10
Session protocol v10 adds type 26: the life's earned offer with its unranked candidates in operator order and each successor's capability value, maintenance and total mass. The cellular bridge sends it when the offer or the owner's session changes and clears a consumed offer; the client keeps the latest one for the maintainer's choice UI (ADR-0121, 11.4d server half). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -102,6 +102,23 @@ network::ActionOutcome action_outcome(const FinalCellularMutation& mutation) noe
|
||||
mutation.tick, mutation.commit_sequence};
|
||||
}
|
||||
|
||||
network::CellularMutationOffer offer_view(const CellularOwnedLife& life, std::uint64_t tick) {
|
||||
network::CellularMutationOffer view{tick, life.identity.life, 0, 0, {}};
|
||||
const auto& offer = life.mutation.offer;
|
||||
if (!offer)
|
||||
return view;
|
||||
view.event_index = life.mutation.event_index;
|
||||
view.offer_tick = life.mutation.offer_tick;
|
||||
for (const auto& candidate : offer->candidates)
|
||||
if (view.candidates.size() < network::max_cellular_offered_candidates)
|
||||
view.candidates.push_back(
|
||||
{candidate.operator_id, static_cast<std::uint8_t>(candidate.target),
|
||||
static_cast<std::uint8_t>(candidate.effect), candidate.parameter,
|
||||
candidate.maintenance, candidate.total_mass});
|
||||
std::ranges::sort(view.candidates, {}, &network::CellularOfferedCandidate::operator_id);
|
||||
return view;
|
||||
}
|
||||
|
||||
CellularRegionHost::CellularRegionHost(CellularHostConfig config, CellularConnect connect,
|
||||
std::unique_ptr<persistence::FilesystemObjectStore> objects)
|
||||
: config_{std::move(config)}, connect_{std::move(connect)}, objects_{std::move(objects)},
|
||||
|
||||
Reference in New Issue
Block a user