Integrate opt-in cellular v6 sessions
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m56s
Foundation / checks (client) (push) Failing after 4m30s
Foundation / checks (tsan) (push) Canceled after 0s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (network) (push) Canceled after 3m1s
Foundation / checks (postgres) (push) Canceled after 34s
Foundation / checks (checks) (push) Canceled after 5m8s

This commit is contained in:
dingo
2026-10-10 21:46:33 -04:00
parent 04a50be9cd
commit 747b063c65
9 changed files with 163 additions and 18 deletions
+26 -2
View File
@@ -62,7 +62,8 @@ struct RegionSessionClient::Impl {
return end(SessionCloseReason::protocol, true); // Malformed snapshot.
if (const auto ack = accepted.value_or(std::nullopt); ack && connection != 0)
// A lost ack only means the next delta is against an older baseline.
(void)endpoint->send_datagram(connection, network::encode_session(*ack))
(void)endpoint
->send_datagram(connection, network::encode_session(*ack, protocol_version))
.has_value();
return;
}
@@ -149,7 +150,8 @@ RegionSessionClient::~RegionSessionClient() = default;
std::expected<std::unique_ptr<RegionSessionClient>, network::quic::EndpointError>
RegionSessionClient::connect(RegionSessionClientConfig config, Clock::time_point now) {
if (config.protocol_version != network::session_protocol_version &&
config.protocol_version != network::session_protocol_v5)
config.protocol_version != network::session_protocol_v5 &&
config.protocol_version != network::session_protocol_v6)
return std::unexpected(network::quic::EndpointError::configuration);
auto endpoint = network::quic::Endpoint::connect(config.transport);
if (!endpoint)
@@ -219,6 +221,28 @@ RegionSessionClient::send_intention(std::uint64_t tick, std::int16_t move_x, std
return m.next_sequence++;
}
std::optional<std::uint64_t> RegionSessionClient::send_cellular_intention(
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) {
auto& m = *impl_;
if (m.protocol_version != network::session_protocol_v6 ||
m.state != RegionSessionState::established || m.connection == 0 || !m.welcome)
return std::nullopt;
const network::CellularIntention intention{m.welcome->session,
m.welcome->epoch,
m.next_sequence,
tick,
move_x,
move_y,
intake_target.has_value(),
intake_target ? intake_target->first : 0,
intake_target ? intake_target->second : 0};
if (!m.endpoint->send_datagram(m.connection,
network::encode_session(intention, m.protocol_version)))
return std::nullopt;
return m.next_sequence++;
}
bool RegionSessionClient::send_action(std::uint64_t action_id, network::ActionKind kind,
std::uint64_t tick) {
auto& m = *impl_;