Foundation / checks (ecs) (push) Successful in 2m21s
Foundation / checks (deploy) (push) Successful in 4m1s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (tsan) (push) Canceled after 7m21s
Foundation / checks (network) (push) Canceled after 9m43s
Foundation / checks (checks) (push) Canceled after 9m49s
Foundation / checks (postgres) (push) Canceled after 9m43s
Foundation / checks (client) (push) Canceled after 9m48s
Sign In / Register opens the system browser (PKCE S256, loopback 127.0.0.1:47600) and keeps the refresh token in Windows Credential Manager. The client then fetches a 10-minute grant from grants.aeternalisgames.com and connects to the cellular DEV region. It renews the grant about a minute before expiry through SessionRefresh, and again after a lost connection. Sign Out closes the session and revokes the login at the broker and at Keycloak. Grant replies are cross-checked against the grant record before use. The manual grant-bundle path stays for developers. The bounded JSON reader moves to evo_json (evo::serialization), shared by the broker and the client. Adds the client-auth tests. Completes work started in another session: main.cpp wiring, refresh expiry tracking, no requests for a superseded session, and clang-tidy and Windows header-order fixes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
80 lines
3.5 KiB
C++
80 lines
3.5 KiB
C++
#pragma once
|
|
// M9.8c engineering panels (ADR-0084). Drawn inside Application's overlay callback;
|
|
// they read presentation copies and report what the user asked for. Only this file
|
|
// pair and the platform adapter use the toolkit.
|
|
#include "evo/client/auth.hpp"
|
|
#include "evo/client/bindings.hpp"
|
|
#include "evo/client/environment_view.hpp"
|
|
#include "evo/client/launcher.hpp"
|
|
#include "evo/client/organism_view.hpp"
|
|
#include "evo/client/outcome_log.hpp"
|
|
#include "evo/client/selection.hpp"
|
|
#include "evo/client/ui_state.hpp"
|
|
#include "evo/render/environment.hpp"
|
|
#include "remote_session.hpp"
|
|
#include <array>
|
|
#include <cstdint>
|
|
#include <optional>
|
|
#include <utility>
|
|
|
|
namespace evo::client_app {
|
|
enum class Mode : std::uint8_t { launcher, fixture, remote };
|
|
// Notice layout (logical pixels); the window name is the prefix plus the notice id.
|
|
inline constexpr float notice_width = 320, notice_close_width = 22;
|
|
inline constexpr const char* notice_window_prefix = "##notice";
|
|
// Text-field storage for the connect form (bounded; never persisted).
|
|
struct FormBuffers {
|
|
bool engineering{};
|
|
CellularControls cellular_controls;
|
|
std::array<char, client::max_field_bytes> endpoint{}, server_name{}, authority{}, grants{};
|
|
void load(const client::ConnectForm& form);
|
|
[[nodiscard]] client::ConnectForm form() const;
|
|
};
|
|
// One key slot of one action in the controls panel.
|
|
struct ControlSlot {
|
|
client::Action action{};
|
|
bool secondary{};
|
|
friend bool operator==(const ControlSlot&, const ControlSlot&) = default;
|
|
};
|
|
struct PanelView {
|
|
Mode mode{Mode::launcher};
|
|
const client::Launcher* launcher{};
|
|
std::optional<client::LaunchError> form_error;
|
|
bool remote_available{};
|
|
bool cellular_trial{};
|
|
client::AuthStatus auth;
|
|
const client::EnvironmentLayer* environment{};
|
|
const client::OrganismLayer* organisms{};
|
|
const client::Selection* selection{};
|
|
const client::UiState* ui{};
|
|
std::optional<RemoteStatus> remote;
|
|
const network::CellularPerception* cellular_perception{};
|
|
const CellularPlay* cellular_play{};
|
|
std::optional<std::pair<std::uint32_t, std::uint32_t>> cellular_feed_target;
|
|
const client::OutcomeLog* outcomes{};
|
|
int visible_organisms{-1}; // -1 when unknown.
|
|
const client::Bindings* bindings{}; // In force (hints).
|
|
// Controls panel, drawn while `controls` is set. Edits stay in the draft until Apply.
|
|
const client::BindingEditor* controls{};
|
|
std::optional<ControlSlot> capturing; // Waiting for the next key press.
|
|
std::optional<client::BindingProblem> controls_problem;
|
|
};
|
|
struct PanelActions {
|
|
bool fixture{}, connect{}, cancel{}, retry{}, back{}, ask_disconnect{};
|
|
bool sign_in{}, sign_out{}, auth_connect{}, cancel_sign_in{};
|
|
std::optional<std::uint64_t> dismiss_notice, confirm_dialog, cancel_dialog;
|
|
bool open_controls{}, apply_controls{}, reset_controls{}, close_controls{}, cancel_capture{};
|
|
std::optional<ControlSlot> capture_key;
|
|
std::optional<client::Action> clear_secondary;
|
|
std::optional<bool> cellular_trial;
|
|
std::optional<std::pair<std::uint32_t, std::uint32_t>> feed_patch;
|
|
bool stop_feeding{};
|
|
std::optional<CellAction> cell_action;
|
|
std::optional<MutationChoice> mutation;
|
|
bool restart_life{}, keep_unknown{};
|
|
};
|
|
// Draws every panel for this frame. `display` may be changed by the layer selector.
|
|
[[nodiscard]] PanelActions draw_panels(const PanelView& view, FormBuffers& form,
|
|
render::EnvironmentDisplay& display);
|
|
} // namespace evo::client_app
|