Carry the engulf intent on v10 sessions and the batch trace
Foundation / checks (ecs) (push) Successful in 2m28s
Foundation / checks (deploy) (push) Successful in 4m6s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (postgres) (push) Canceled after 6m47s
Foundation / checks (checks) (push) Canceled after 6m58s
Foundation / checks (client) (push) Canceled after 6m59s
Foundation / checks (tsan) (push) Canceled after 4m28s
Foundation / checks (network) (push) Canceled after 6m58s
Foundation / checks (ecs) (push) Successful in 2m28s
Foundation / checks (deploy) (push) Successful in 4m6s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (postgres) (push) Canceled after 6m47s
Foundation / checks (checks) (push) Canceled after 6m58s
Foundation / checks (client) (push) Canceled after 6m59s
Foundation / checks (tsan) (push) Canceled after 4m28s
Foundation / checks (network) (push) Canceled after 6m58s
ADR-0124: byte 12 of the canonical cellular input, the CellularAction wire message and the batch trace record becomes a target kind (0 none, 1 patch, 2 engulf with zero coordinates). Kind 2 exists only on v10, which no server admitted before; cellular servers now admit v10 with v9 behaviour plus engulf, and still refuse a v10 mutation choice until 11.4c. Admission, the session-batch adapter, trace codec, matcher and action-block validator carry the kind. The client session library accepts v10 and an engulf flag, and its send no longer reports a message its version cannot encode as sent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -88,10 +88,11 @@ struct RegionSessionClient::Impl {
|
||||
protocol_close("datagram unexpected", static_cast<int>(decoded->index()), bytes.size());
|
||||
}
|
||||
|
||||
// An encoding refused for this session's version (empty) is never sent as success.
|
||||
bool send(const network::SessionMessage& m) {
|
||||
return connection != 0 &&
|
||||
endpoint->send_message(connection, network::encode_session(m, protocol_version))
|
||||
.has_value();
|
||||
const auto bytes = network::encode_session(m, protocol_version);
|
||||
return connection != 0 && !bytes.empty() &&
|
||||
endpoint->send_message(connection, bytes).has_value();
|
||||
}
|
||||
// Ends the session locally; `tell` sends a Close first (best effort).
|
||||
void end(SessionCloseReason why, bool tell) {
|
||||
@@ -171,7 +172,8 @@ RegionSessionClient::connect(RegionSessionClientConfig config, Clock::time_point
|
||||
config.protocol_version != network::session_protocol_v6 &&
|
||||
config.protocol_version != network::session_protocol_v7 &&
|
||||
config.protocol_version != network::session_protocol_v8 &&
|
||||
config.protocol_version != network::session_protocol_v9)
|
||||
config.protocol_version != network::session_protocol_v9 &&
|
||||
config.protocol_version != network::session_protocol_v10)
|
||||
return std::unexpected(network::quic::EndpointError::configuration);
|
||||
auto endpoint = network::quic::Endpoint::connect(config.transport);
|
||||
if (!endpoint)
|
||||
@@ -274,16 +276,17 @@ bool RegionSessionClient::send_action(std::uint64_t action_id, network::ActionKi
|
||||
|
||||
bool RegionSessionClient::send_cellular_action(
|
||||
std::uint64_t action_id, std::uint64_t tick, std::int16_t move_x, std::int16_t move_y,
|
||||
std::optional<std::pair<std::uint32_t, std::uint32_t>> intake_target) {
|
||||
std::optional<std::pair<std::uint32_t, std::uint32_t>> intake_target, bool engulf) {
|
||||
auto& m = *impl_;
|
||||
return (m.protocol_version == network::session_protocol_v7 ||
|
||||
m.protocol_version == network::session_protocol_v8 ||
|
||||
m.protocol_version == network::session_protocol_v9) &&
|
||||
m.protocol_version == network::session_protocol_v9 ||
|
||||
m.protocol_version == network::session_protocol_v10) &&
|
||||
m.state == RegionSessionState::established && m.welcome && action_id != 0 && tick != 0 &&
|
||||
m.send(network::CellularAction{m.welcome->session, m.welcome->epoch, action_id, tick,
|
||||
move_x, move_y, intake_target.has_value(),
|
||||
intake_target ? intake_target->first : 0,
|
||||
intake_target ? intake_target->second : 0});
|
||||
intake_target ? intake_target->second : 0, engulf});
|
||||
}
|
||||
|
||||
bool RegionSessionClient::query_action(std::uint64_t action_id) {
|
||||
@@ -291,7 +294,8 @@ bool RegionSessionClient::query_action(std::uint64_t action_id) {
|
||||
return (m.protocol_version == network::session_protocol_version ||
|
||||
m.protocol_version == network::session_protocol_v7 ||
|
||||
m.protocol_version == network::session_protocol_v8 ||
|
||||
m.protocol_version == network::session_protocol_v9) &&
|
||||
m.protocol_version == network::session_protocol_v9 ||
|
||||
m.protocol_version == network::session_protocol_v10) &&
|
||||
m.state == RegionSessionState::established && m.send(network::ActionQuery{action_id});
|
||||
}
|
||||
|
||||
@@ -299,7 +303,8 @@ bool RegionSessionClient::request_primitive_life(std::uint64_t request_id) {
|
||||
auto& m = *impl_;
|
||||
return (m.protocol_version == network::session_protocol_v5 ||
|
||||
m.protocol_version == network::session_protocol_v8 ||
|
||||
m.protocol_version == network::session_protocol_v9) &&
|
||||
m.protocol_version == network::session_protocol_v9 ||
|
||||
m.protocol_version == network::session_protocol_v10) &&
|
||||
m.state == RegionSessionState::established && m.welcome && request_id != 0 &&
|
||||
m.send(network::PrimitiveLifeRequest{m.welcome->session, m.welcome->epoch, request_id});
|
||||
}
|
||||
@@ -308,7 +313,8 @@ bool RegionSessionClient::query_primitive_life(std::uint64_t request_id) {
|
||||
auto& m = *impl_;
|
||||
return (m.protocol_version == network::session_protocol_v5 ||
|
||||
m.protocol_version == network::session_protocol_v8 ||
|
||||
m.protocol_version == network::session_protocol_v9) &&
|
||||
m.protocol_version == network::session_protocol_v9 ||
|
||||
m.protocol_version == network::session_protocol_v10) &&
|
||||
m.state == RegionSessionState::established && request_id != 0 &&
|
||||
m.send(network::PrimitiveLifeQuery{request_id});
|
||||
}
|
||||
@@ -346,7 +352,8 @@ bool RegionSessionClient::set_interest(const network::SessionInterest& interest)
|
||||
return (m.protocol_version == network::session_protocol_version ||
|
||||
m.protocol_version == network::session_protocol_v7 ||
|
||||
m.protocol_version == network::session_protocol_v8 ||
|
||||
m.protocol_version == network::session_protocol_v9) &&
|
||||
m.protocol_version == network::session_protocol_v9 ||
|
||||
m.protocol_version == network::session_protocol_v10) &&
|
||||
m.state == RegionSessionState::established && m.send(interest);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user