Skip to main content

Crate flatland_client_lib

Crate flatland_client_lib 

Source
Expand description

Shared gameplay session state for TUI, bots, and third-party clients.

Re-exports§

pub use content_pack::build_sim_pack_index;
pub use content_pack::download_sim_pack;
pub use content_pack::ensure_sim_pack_cached;
pub use content_pack::resolve_sim_pack_file;
pub use content_pack::sim_pack_cache_dir;
pub use content_pack::upload_sim_pack;
pub use content_pack::SIM_PACK_ASSET_DIRS;
pub use harvest_debug::verbose as harvest_debug_verbose;
pub use harvest_debug::TARGET as HARVEST_LOG_TARGET;
pub use navigation::AutoNavigator;

Modules§

content_pack
Sim content packs — versioned assets/ trees published beside client gfx.
currency
Client-side currency display from inventory stacks.
harvest_debug
Harvest / play-loop diagnostics.
navigation
Client-side pathfinding and auto-navigation toward a map target.

Macros§

harvest_trace
Log at info when verbose(), else debug — always uses TARGET.

Structs§

AppliedUpdate
Artifact
AssetBackendConfig
AssetBundleIndex
AssetFileEntry
AssetSyncOptions
AssetSyncResult
AttributeRow
BotClient
BotConfig
BotStats
CharacterSheet
ChatLogEntry
One line in the always-visible chat log / active thread.
ClaimModeState
Local claim-mode footprint editor (plan 40) — SW corner + size in meters.
ClientBundleSources
Roots assembled into one installed-client Firebase bundle.
ClientConfig
ClientKeyBindings
ClientSettings
ConnectOptions
ContainerCandidate
One owned container row for the withdraw/deposit container pickers.
ContextLine
HUD line for the location / nearby panel.
FloatingChatPrefs
Map-mode floating CHAT panel position + collapse (flatland3-gfx).
GameClient
GameState
GcsAssetStore
GfxWindowPrefs
GrantTargetOption
GrantTargetPicker
Active “apply grant onto…” picker (fortify oil, frost edge scroll, …).
InventoryRow
One row in the inventory browser tree.
InventoryRowView
Formatted inventory row text shared by TUI and gfx browsers.
LoadoutHotbarChoice
One row in the loadout hotbar picker (ability or inventory consumable).
LocalAssetState
LocalAssetStore
MoveOption
A destination the currently-picked item could be moved to.
MovePicker
Active “move to…” destination picker state for the selected inventory item.
NearbyContainer
A placed chest within CONTAINER_RANGE_M, with its contents pre-flattened for the browser (empty when locked without the matching key).
NodeCandidate
One resource-node row for the harvest picker.
PendingTradeRequest
Inbound trade request waiting for Y/N in the chat column.
PlayerVerbState
PoolRow
PublishPacksResult
RelocateModeState
Local relocate ghost for a placed chest/lodging (1×1 cell cursor).
RemoteSession
RotationEditorState
Local rotation editor UI state (not persisted).
S3AssetStore
SkillRow
SocialChatState
SpeakingBubble
Comic “…” bubble above a speaking player (Nearby / Direct only).
StoragePickOption
One selectable stack in a storage store/take/ship picker.
TradeNpcCandidate
One merchant row for the sell picker.
TradeUiState
UpdateAvailable
UpdateManifest
UseWorldCandidate
UseWorldProbe
WhisperContact
WhisperPouchUi
WithdrawLineDraft
One editable withdraw line inside the WithdrawItems sheet.
WorkerGiveOption
One giveable stack in the workers-menu give picker.
WorkerGivePicker
Give an on-person inventory stack to the selected hired worker.
WorkerGiveTargetOption
Nearby hired worker choice when giving a selected inventory stack (g).
WorkerGiveTargetPicker
Pick which nearby worker receives the selected inventory item.
WorkerRouteEditorState
Draft route for a hired worker. stops is the ordered, editable list; lodging_container_id is the bed used for RestIfNeeded.
WorkerRouteWaypoint
One outbound travel waypoint for a harvest loop route.
WorkerRouteWithdrawItem
One withdraw line for a WithdrawFrom editor stop.
WorkerTakePicker
Take an item from a hired worker back into the employer’s inventory.
WorkerTeachOption
One teachable blueprint in the workers-menu teach picker.
WorkerTeachPicker
Teach a known blueprint to the selected hired worker.
WorldZoneChip

Enums§

AssetBackendKind
How published client/sim packs are stored and fetched.
AssetSyncKind
Outcome of sync_assets for logging / HUD toasts.
AudioCue
Soft UI tones (synthesized; .wav hooks come later).
AuthCredential
How the client authenticates to the game gateway. Uses default serde enum encoding (postcard-compatible; not internally tagged).
BankUiMode
Bank teller panel focus (action list vs amount / transfer prompts).
CharacterSheetTab
ChatThreadKind
Where chat input will send.
EquipPaperdollRow
FarmAccessRow
One navigable row in the deed farm-access panel.
FarmPlotAction
Farm plot action for the route-editor plot picker.
InventoryBrowserLine
One line in the sectioned inventory browser (headers are non-selectable).
InventorySection
Broad section of the inventory browser a row belongs to (drives the grouped “Worn” / “On you” / “Nearby chest” headers in the UI).
InventoryTab
Top-level inventory browser tab (b menu).
LedgerPeriod
MarketListSourceKind
Where market list goods are taken from (GoodsLocation on submit).
MarketUiMode
Market hall clerk focus (browse vs list wizard).
MoveOptionKind
RotationEditorMode
Rotation editor overlay mode (plans/26 §C2.5).
RouteEditorClick
Mouse actions produced by the gfx overlay and applied on the net thread.
RouteEditorSheet
Which sheet (sub-screen) the route editor is showing.
SessionEvent
SheetSync
ShopTab
StorageUiMode
Town storage manager focus (action list vs item pickers vs quantity).
UseWorldKind
What kind of world-use target this is (drives tint + verb).
WithdrawLineMode
Tri-state of one withdraw line draft: not included, take all, take qty.
WorkerRouteStop
One typed stop in an ordered worker route. Mirrors the sim WorkerRouteStop.
WorldZoneLayer
Display order for status-line chips (lower sorts first).

Constants§

ADD_MENU
Add-menu entries in display order.
ASSETS_INDEX_OBJECT
CONTAINER_RANGE_M
Max distance (m) a placed chest can be browsed/moved-into from the inventory UI. Mirrors flatland_sim::interaction::CONTAINER_INTERACTION_RADIUS_M so the client only ever shows chests the server will actually let you use — this is what makes a chest disappear from the menu as soon as you walk away.
DEFAULT_API_PORT
DEFAULT_FIREBASE_BUCKET
DEFAULT_GAME_PORT
DEFAULT_TICK_HZ
Default sim tick rate when the client has no settings (matches server-settings).
LIST_PAGE_SIZE
Rows jumped by PageUp / PageDown in list UIs.
ROUTE_PICKER_DONE_ROW
First row in multi-select harvest / sell sheets — always Done.
SELL_ITEM_TOGGLE_ROW
Sell sheet: row 1 is the sell-all toggle (row 0 = Done).
USE_WORLD_NEARBY_SCAN_M
Candidates beyond this are omitted from the probe list.
WAYPOINT_MENU
Waypoint submenu entries in display order.
WORKER_GIVE_RANGE_M
Max distance (m) to hand an item to a hired worker.

Traits§

AssetStore
Put/get published bytes (admin upload + worker/client download).
PlayConnection
Gameplay session handle (remote TCP or in-process worker).

Functions§

api_base_url_for_host
Control-plane base URL for a DNS/IP host (optional :port is ignored for API; API always uses DEFAULT_API_PORT unless the host is already an http(s):// URL).
apply_host_override
Apply a one-shot host for this process only (no client.json write).
apply_update
Download, verify SHA-256, extract, and atomically swap both client binaries.
assets_index_url
body_slot_label
Short display label for a body slot (plans/08 §4.1) — shared by the inventory browser section headers and the move-destination picker.
build_bundle_index
Walk assets/gfx/sprites and build a publish manifest (relative paths → hash).
build_character_sheet
build_client_bundle_index
Build the installed-client asset index: sprites at the rev root plus optional paperdoll / player presentation / player art / client config trees.
category_default_listable
Whether a template category is listable when the wire/hint omits an explicit flag.
check_for_update
check_updates_enabled
Whether automatic update checks are enabled (default true).
cleanup_old_binaries
Remove *.old backups left by a previous successful apply (call on launch).
connect
connect_tcp
contacts_from_stacks
default_api_base_url
default_game_server_addr
default_latest_url
Public HTTPS URL for latest.json (same construction as install.sh).
default_server_addr
equip_paperdoll_rows
fetch_latest_manifest
find_repo_paperdoll_dir
Checkout assets/paperdoll (poses, animations, skins).
firebase_download_url
firebase_object_path
format_binding_mode
format_binding_ttl
Human-readable remaining time for an item status binding.
format_pool_xp
format_progress_pct
format_status_bindings_suffix
Compact suffix for inventory / paperdoll rows, e.g. · fortify (while equipped, 58m left).
format_xp_band
format_xp_band_compact
format_xp_delta
Signed delta from baseline — always enough decimals to see harvest ticks.
format_xp_value
Adaptive precision so tiny harvest gains (0.08 XP) don’t display as 0.0.
harvest_picker_row_count
harvest_picker_row_matches
Filter helper for harvest picker rows (row 0 = Done, rows 1.. = nodes[row - 1]).
host_override_active
True when this process applied (or inherited) a one-shot --host override.
inventory_category_group
Category group for On-person loose items (stable order).
is_newer
list_filter_row_matches
Whitespace-separated AND tokens for long picker lists.
list_label_matches
Case-insensitive substring match for list filters (name / template / label).
load_client_settings
local_version
mime_for_path
needs_asset_sync
node_candidates
Harvestable resource nodes sorted by distance to anchor_x / anchor_y (rest bed).
node_candidates_stable
When no rest bed is set, keep a stable order (label, id) so the picker does not jump.
normalize_host_input
Strip scheme/path and reject empty hosts. Allows DNS names and host:port.
owned_container_candidates
Owned containers (any with storage capacity, lodging flagged) sorted by distance to the player then name — the withdraw/deposit picker rows.
owned_container_candidates_with_occupants
Like owned_container_candidates, but lodging rows include occupant names in summary.
owned_container_candidates_with_occupants_and_buildings
Deposit/withdraw picker: owned chests/lodging plus town storage halls.
owned_lodging_container_ids
Owned placed lodging containers (camp beds) — used as the rest/bed target.
owned_lodging_container_ids_with_occupants
Lodging beds with display names that include occupant labels (Camp bed — Elda).
owned_storage_template_ids
Distinct item templates present in the employer’s owned placed containers — candidate sell templates for TradeWith stops.
page_list_index
Clamp a list selection after a page jump (pages is typically ±1).
paperdoll_has_keyframe_animations
True when root/animations has at least one YAML clip (walk cycles, etc.).
pick_lodging_container_at
pick_resource_node_at
Nearest harvestable resource node within click range.
pick_storage_container_at
Pick any owned storage container at a click position (lodging or regular chest).
pick_trade_npc_at
Nearest trade-capable NPC within click range.
platform_tag
Mirror detect_platform() from scripts/client-release/install.sh.
publish_content_packs
Shared Publish path for content-admin and flatland-admin content publish.
publish_content_packs_opts
Like publish_content_packs, with control over sim pack upload (smoke tests skip sim).
read_local_state
read_repo_publish_rev
Publish rev from assets/.content-publish.json when running from a dev checkout.
resolve_bundle_file_path
Resolve on-disk path for a relative key in the client asset bundle.
resolve_game_host_addr
Resolve a DNS name or IP (optional :port) to the gateway TCP address.
resolve_paperdoll_dir
Paperdoll root for installed / synced clients (rev-N/paperdoll) or repo checkout.
resolve_sprites_dir
Prefer the repo checkout when it is at least as new as the synced cache.
resource_node_near_action_suffix
Action / state suffix for a resource node line (growth_progress wins for farm crops).
resource_node_near_display_label
Display name for a resource node in location/nearby HUD (strips redundant growing tag).
route_editor_lodging_anchor
Rest-bed world position for the open route editor (if a bed is chosen).
route_item_template_candidates
Item templates for deposit filters / sell stops — not limited to what is already in a chest. Includes storage, inventory, craft outputs/inputs, harvest node products, and any extra seeds (existing filter selections, route craft outputs) so factory lines can be authored before the first batch is made.
self_chat_rgb
Local player’s chat color (mint) — distinct from hashed peer colors.
sell_item_picker_row_count
should_prefer_repo_assets
True when this process should use the git checkout sprites instead of Firebase.
speaker_chat_rgb
Stable pastel from entity id (same color in CHAT log and world bubble).
store_from_config
summarize_contents
Summarize container contents as oak_log ×12 · lumber ×4 (or (empty)).
sync_assets
synced_rev_dir
Active synced rev directory (~/.flatland3/assets/rev-N or current).
trade_npc_candidates
Trade-capable NPCs sorted by distance to the player.
update_dir
Directory containing the running client binaries (current_exe parent).
urlencoding_encode_path
worker_attention_line
First non-transient worker issue for the status bar (strike, route error, etc.). Routine recovery noise (path failures → lodging) stays in the game log only.
worker_craft_blueprint_ids
Blueprint ids the route editor may assign to a craft_at hand stop.
worker_error_is_hud_noise
True for routine worker recoveries that should not paint the status bar. Still logged when they change (see GameState::apply_hired_workers).
worker_error_is_transient
True when a worker last_error is transient noise (soft-skip chatter).
zone_friendly_label