Admit and schedule cellular intentions
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m58s
Foundation / checks (client) (push) Failing after 4m25s
Foundation / checks (network) (push) Failing after 3m5s
Foundation / checks (tsan) (push) Failing after 32s
Foundation / checks (postgres) (push) Failing after 2m29s
Foundation / checks (checks) (push) Failing after 9m23s
Foundation / postgres-tools (push) Skipped
Foundation / server-image (push) Skipped
Foundation / image (push) Skipped
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m58s
Foundation / checks (client) (push) Failing after 4m25s
Foundation / checks (network) (push) Failing after 3m5s
Foundation / checks (tsan) (push) Failing after 32s
Foundation / checks (postgres) (push) Failing after 2m29s
Foundation / checks (checks) (push) Failing after 9m23s
Foundation / postgres-tools (push) Skipped
Foundation / server-image (push) Skipped
Foundation / image (push) Skipped
This commit is contained in:
@@ -103,11 +103,47 @@ IntentionReceipt IntentAdmission::intention(std::uint64_t session, const Session
|
||||
r.status = AdmitStatus::too_many_unresolved;
|
||||
if (r.status == AdmitStatus::admitted) {
|
||||
s->last_sequence = m.sequence;
|
||||
s->pending.push_back({m.sequence, m.tick});
|
||||
s->pending.push_back({m.sequence, m.tick, m.epoch, m.move_x, m.move_y, false, 0, 0});
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
IntentionReceipt IntentAdmission::intention(std::uint64_t session, const CellularIntention& m,
|
||||
const AdmissionFacts& facts) {
|
||||
const SessionIntention movement{m.session, m.epoch, m.sequence, m.tick, m.move_x, m.move_y};
|
||||
auto receipt = intention(session, movement, facts);
|
||||
if (receipt.status == AdmitStatus::admitted) {
|
||||
auto* admitted = find(session);
|
||||
auto& pending = admitted->pending.back();
|
||||
pending.has_intake_target = m.has_intake_target;
|
||||
pending.intake_x_um = m.intake_x_um;
|
||||
pending.intake_y_um = m.intake_y_um;
|
||||
}
|
||||
return receipt;
|
||||
}
|
||||
|
||||
std::vector<ScheduledCellularIntention>
|
||||
IntentAdmission::scheduled_cellular_intentions(std::uint64_t tick) const {
|
||||
std::vector<ScheduledCellularIntention> out;
|
||||
for (const auto& session : sessions_)
|
||||
for (const auto& pending : session.pending)
|
||||
if (pending.tick <= tick)
|
||||
out.push_back({session.account,
|
||||
{session.id, pending.epoch, pending.sequence, pending.tick,
|
||||
pending.move_x, pending.move_y, pending.has_intake_target,
|
||||
pending.intake_x_um, pending.intake_y_um}});
|
||||
std::ranges::sort(out, [](const auto& left, const auto& right) {
|
||||
if (left.intention.tick != right.intention.tick)
|
||||
return left.intention.tick < right.intention.tick;
|
||||
if (left.account != right.account)
|
||||
return left.account < right.account;
|
||||
if (left.intention.session != right.intention.session)
|
||||
return left.intention.session < right.intention.session;
|
||||
return left.intention.sequence < right.intention.sequence;
|
||||
});
|
||||
return out;
|
||||
}
|
||||
|
||||
ActionReceipt IntentAdmission::screen(Session& s, const SessionAction& m,
|
||||
const AdmissionFacts& facts, bool& check) {
|
||||
ActionReceipt r{m.action_id, AdmitStatus::admitted, facts.server_tick, m.tick};
|
||||
|
||||
Reference in New Issue
Block a user