pub struct GameState {Show 74 fields
pub session_id: SessionId,
pub entity_id: EntityId,
pub character_id: Option<Uuid>,
pub tick: Tick,
pub chunk_rev: u64,
pub content_rev: u64,
pub entities: Vec<EntityState>,
pub player: Option<EntityState>,
pub resource_nodes: Vec<ResourceNodeView>,
pub ground_drops: Vec<GroundDropView>,
pub placed_containers: Vec<PlacedContainerView>,
pub buildings: Vec<BuildingView>,
pub doors: Vec<DoorView>,
pub npcs: Vec<NpcView>,
pub blueprints: Vec<BlueprintView>,
pub world_width_m: f32,
pub world_height_m: f32,
pub terrain_zones: Vec<TerrainZoneView>,
pub world_clock: WorldClock,
pub inventory: HashMap<String, u32>,
pub inventory_hints: HashMap<String, InventoryHint>,
pub logs: VecDeque<String>,
pub intents_sent: u64,
pub ticks_received: u64,
pub connected: bool,
pub disconnect_reason: Option<String>,
pub show_stats: bool,
pub show_craft_menu: bool,
pub craft_menu_index: usize,
pub craft_batch_quantity: u32,
pub show_shop_menu: bool,
pub shop_catalog: Option<ShopCatalog>,
pub shop_tab: ShopTab,
pub shop_menu_index: usize,
pub shop_quantity: u32,
pub show_inventory_menu: bool,
pub inventory_menu_index: usize,
pub show_move_picker: bool,
pub move_picker_index: usize,
pub move_picker: Option<MovePicker>,
pub show_destroy_picker: bool,
pub destroy_confirm_pending: bool,
pub destroy_picker: Option<DestroyPicker>,
pub show_rename_prompt: bool,
pub rename_buffer: String,
pub combat_target: Option<EntityId>,
pub combat_target_label: Option<String>,
pub in_combat: bool,
pub auto_attack: bool,
pub combat_has_los: bool,
pub attack_cd_ticks: u64,
pub gcd_ticks: u64,
pub weapon_ability_id: String,
pub mainhand_template_id: Option<String>,
pub mainhand_label: Option<String>,
pub worn: BTreeMap<BodySlot, ItemStack>,
pub carry_mass: f32,
pub carry_mass_max: f32,
pub encumbrance: EncumbranceState,
pub inventory_stacks: Vec<ItemStack>,
pub combat_target_detail: Option<CombatTargetHud>,
pub cast_progress: Option<CastProgressHud>,
pub ability_cooldowns: Vec<AbilityCooldownHud>,
pub blocking_active: bool,
pub max_target_slots: u8,
pub combat_slots: Vec<CombatSlotHud>,
pub rotation_presets: Vec<RotationPreset>,
pub show_loadout_menu: bool,
pub show_rotation_editor: bool,
pub loadout_menu_index: usize,
pub rotation_editor: RotationEditorState,
pub harvest_in_progress: bool,
pub harvest_started_at: Option<Instant>,
pub pending_craft_ack: Option<(u32, String, u32)>,
}Fields§
§session_id: SessionId§entity_id: EntityId§character_id: Option<Uuid>Logged-in character — used to show owner-only container labels.
tick: Tick§chunk_rev: u64§content_rev: u64§entities: Vec<EntityState>§player: Option<EntityState>§resource_nodes: Vec<ResourceNodeView>§ground_drops: Vec<GroundDropView>§placed_containers: Vec<PlacedContainerView>§buildings: Vec<BuildingView>§doors: Vec<DoorView>§npcs: Vec<NpcView>§blueprints: Vec<BlueprintView>§world_width_m: f32§world_height_m: f32§terrain_zones: Vec<TerrainZoneView>§world_clock: WorldClock§inventory: HashMap<String, u32>§inventory_hints: HashMap<String, InventoryHint>§logs: VecDeque<String>§intents_sent: u64§ticks_received: u64§connected: bool§disconnect_reason: Option<String>§show_stats: bool§craft_batch_quantity: u32How many timed crafts to queue when confirming the craft menu.
shop_catalog: Option<ShopCatalog>§shop_tab: ShopTab§shop_quantity: u32§show_move_picker: bool§move_picker_index: usize§move_picker: Option<MovePicker>§show_destroy_picker: bool§destroy_confirm_pending: bool§destroy_picker: Option<DestroyPicker>§show_rename_prompt: boolRename prompt for a selected container (n in inventory).
rename_buffer: String§combat_target: Option<EntityId>Slot-1 combat target (mirrors server after SetTarget).
combat_target_label: Option<String>§in_combat: bool§auto_attack: bool§combat_has_los: bool§attack_cd_ticks: u64§gcd_ticks: u64§weapon_ability_id: String§mainhand_template_id: Option<String>§mainhand_label: Option<String>§worn: BTreeMap<BodySlot, ItemStack>Worn body-slot items — backpack (Back), belt w/ clipped pouches (Waist), and
future armor. At most one item per slot (plans/08 §4.1).
carry_mass: f32§carry_mass_max: f32§encumbrance: EncumbranceState§inventory_stacks: Vec<ItemStack>Full nested inventory stacks from the server (root only; worn are separate).
combat_target_detail: Option<CombatTargetHud>§cast_progress: Option<CastProgressHud>§ability_cooldowns: Vec<AbilityCooldownHud>§blocking_active: bool§max_target_slots: u8§combat_slots: Vec<CombatSlotHud>§rotation_presets: Vec<RotationPreset>§show_rotation_editor: bool§rotation_editor: RotationEditorState§harvest_in_progress: boolTrue after a harvest intent is accepted until result/reject/disconnect.
harvest_started_at: Option<Instant>Wall-clock start of the current harvest; clears stale client state on timeout.
pending_craft_ack: Option<(u32, String, u32)>Craft log deferred until the server acks the craft intent.
Implementations§
Source§impl GameState
impl GameState
pub fn push_log(&mut self, line: impl Into<String>)
pub fn is_alive(&self) -> bool
pub fn clear_harvest_state(&mut self)
pub fn vitals(&self) -> Option<PlayerVitals>
pub fn can_craft_blueprint(&self, blueprint: &BlueprintView) -> bool
pub fn max_craft_batches(&self, blueprint: &BlueprintView) -> u32
pub fn clamp_craft_batch_quantity(&mut self)
pub fn craft_batch_adjust_quantity(&mut self, delta: i32)
pub fn craft_batch_set_max(&mut self)
pub fn apply_shop_catalog(&mut self, catalog: ShopCatalog)
pub fn shop_list_len(&self) -> usize
pub fn shop_quantity_adjust(&mut self, delta: i32)
pub fn shop_quantity_set_max(&mut self)
pub fn player_at_station_tag(&self, tag: &str) -> bool
Sourcepub fn craft_missing_hint(&self, blueprint: &BlueprintView) -> Option<String>
pub fn craft_missing_hint(&self, blueprint: &BlueprintView) -> Option<String>
Short hint for UI when a recipe cannot be started.
pub fn player_entity(&self) -> Option<&EntityState>
pub fn player_position(&self) -> (f32, f32)
pub fn sorted_inventory(&self) -> Vec<(String, u32, String)>
pub fn inventory_item_category(&self, template_id: &str) -> Option<&str>
pub fn item_base_mass(&self, template_id: &str) -> f32
pub fn item_base_volume(&self, template_id: &str) -> f32
pub fn stack_mass(&self, stack: &ItemStack) -> f32
Sourcepub fn container_volume_label(&self, row: &InventoryRow) -> String
pub fn container_volume_label(&self, row: &InventoryRow) -> String
Volume used / capacity / free space label for storage containers in the inventory UI.
pub fn row_is_renameable_container(&self, row: &InventoryRow) -> bool
Sourcepub fn max_movable_to(
&self,
template_id: &str,
stack_qty: u32,
from: &InventoryLocation,
to: &InventoryLocation,
parent_instance_id: Option<Uuid>,
) -> u32
pub fn max_movable_to( &self, template_id: &str, stack_qty: u32, from: &InventoryLocation, to: &InventoryLocation, parent_instance_id: Option<Uuid>, ) -> u32
Client-side estimate of how many units can move to to (server clamps authoritatively).
pub fn move_picker_max_at_selection(&self) -> u32
pub fn clamp_move_picker_quantity(&mut self)
pub fn move_picker_adjust_quantity(&mut self, delta: i32)
pub fn move_picker_set_quantity_max(&mut self)
pub fn destroy_picker_adjust_quantity(&mut self, delta: i32)
pub fn destroy_picker_set_quantity_max(&mut self)
pub fn ingredient_status(&self, template_id: &str, need: u32) -> (u32, bool)
pub fn currency_display(&self) -> String
Sourcepub fn in_shallow_water(&self) -> bool
pub fn in_shallow_water(&self) -> bool
True when standing in a shallow-water terrain zone from the segment snapshot.
pub fn terrain_at(&self, x: f32, y: f32) -> Option<TerrainKindView>
Sourcepub fn building_interior_at(&self, px: f32, py: f32) -> Option<&BuildingView>
pub fn building_interior_at(&self, px: f32, py: f32) -> Option<&BuildingView>
Building interior the player is standing in, if any (position-based).
Sourcepub fn effective_inside_building(&self) -> Option<String>
pub fn effective_inside_building(&self) -> Option<String>
Interior instance map to render (ignores stale inside_building when outdoors).
pub fn sync_inventory_from_stacks(&mut self, stacks: &[ItemStack])
Sourcepub fn worn_rows(&self) -> Vec<InventoryRow>
pub fn worn_rows(&self) -> Vec<InventoryRow>
Worn body-slot items — each shown as a shell row (unequip via Enter) followed by
its nested contents (e.g. pouches clipped onto a worn belt). BodySlot derives
Ord in display order (Head/Body/Arms/Legs/Feet/Back/Waist), so BTreeMap
iteration alone gives a stable row order.
Sourcepub fn person_rows(&self) -> Vec<InventoryRow>
pub fn person_rows(&self) -> Vec<InventoryRow>
Loose on-person inventory (not worn, not inside a placed chest).
Sourcepub fn inventory_tree_rows(&self) -> Vec<(usize, ItemStack)>
pub fn inventory_tree_rows(&self) -> Vec<(usize, ItemStack)>
Legacy alias used by the HUD sidebar summary (worn + on-person, unchanged).
Sourcepub fn nearby_containers(&self) -> Vec<NearbyContainer>
pub fn nearby_containers(&self) -> Vec<NearbyContainer>
Placed chests within CONTAINER_RANGE_M, nearest first. Contents are only
populated when accessible — this is what makes a chest’s contents
disappear the moment you walk away or it’s locked without your key.
Sourcepub fn nearest_placed_container(
&self,
max_dist: f32,
) -> Option<PlacedContainerView>
pub fn nearest_placed_container( &self, max_dist: f32, ) -> Option<PlacedContainerView>
Nearest placed chest within max_dist, regardless of accessibility.
Sourcepub fn inventory_selectable_rows(&self) -> Vec<InventoryRow>
pub fn inventory_selectable_rows(&self) -> Vec<InventoryRow>
Full ordered list of selectable rows: worn ++ on-person ++ each nearby
accessible chest’s contents (nearest chest first). This single order drives
inventory_menu_index; the renderer must build its grouped headers by
walking worn_rows() / person_rows() / nearby_containers() in the same
sequence so the highlighted row always matches.
pub fn inventory_selected_row(&self) -> Option<InventoryRow>
Sourcepub fn move_destinations_for(
&self,
from: &InventoryLocation,
from_parent_instance_id: Option<Uuid>,
moving_instance_id: Option<Uuid>,
moving_template_id: &str,
) -> Vec<MoveOption>
pub fn move_destinations_for( &self, from: &InventoryLocation, from_parent_instance_id: Option<Uuid>, moving_instance_id: Option<Uuid>, moving_template_id: &str, ) -> Vec<MoveOption>
Build the “move to…” destination list for an item currently at from.
Sourcepub fn target_for_slot(&self, slot: u8) -> Option<EntityId>
pub fn target_for_slot(&self, slot: u8) -> Option<EntityId>
Entity id assigned to a combat slot (from server HUD).
Sourcepub fn t1_candidates(&self) -> Vec<(EntityId, String)>
pub fn t1_candidates(&self) -> Vec<(EntityId, String)>
Hostile wildlife / monsters for T1 (Tab).
Sourcepub fn t2_candidates(&self) -> Vec<(EntityId, String)>
pub fn t2_candidates(&self) -> Vec<(EntityId, String)>
Allies first, then monsters, for T2 (Shift+Tab). Includes self for heals.
Sourcepub fn combat_candidates(&self) -> Vec<(EntityId, String)>
pub fn combat_candidates(&self) -> Vec<(EntityId, String)>
Wildlife and other combat targets visible in AOI (NpcView.entity_id).
pub fn refresh_combat_target_label(&mut self)
Sourcepub fn nearest_interact_target(&self) -> Option<String>
pub fn nearest_interact_target(&self) -> Option<String>
Nearest interactable target for f (doors, NPCs, well, shallow water).
Sourcepub fn template_display_name(&self, template_id: &str) -> String
pub fn template_display_name(&self, template_id: &str) -> String
Human-readable template name from synced catalog hints.
Sourcepub fn placed_container_public_label(&self, c: &PlacedContainerView) -> String
pub fn placed_container_public_label(&self, c: &PlacedContainerView) -> String
Chest label for the location panel — generic type unless this player owns it.
Sourcepub fn key_pair_chest_label(&self, stack: &ItemStack) -> Option<String>
pub fn key_pair_chest_label(&self, stack: &ItemStack) -> Option<String>
Display name of the chest a container_key opens, when known on the client.
Sourcepub fn key_inventory_label(&self, stack: &ItemStack) -> String
pub fn key_inventory_label(&self, stack: &ItemStack) -> String
Keys always show the catalog name — never a chest rename or stray custom_name.
Sourcepub fn key_inventory_hint(&self, stack: &ItemStack) -> String
pub fn key_inventory_hint(&self, stack: &ItemStack) -> String
Hint suffix for a key row ([key for …] or [key — unpaired]).
Sourcepub fn container_name_for_lock_id(&self, lock: &str) -> Option<String>
pub fn container_name_for_lock_id(&self, lock: &str) -> Option<String>
Resolve a lock id to a container label (placed chest or one still on your person).
Sourcepub fn key_drop_blocked(&self, stack: &ItemStack) -> bool
pub fn key_drop_blocked(&self, stack: &ItemStack) -> bool
Keys cannot be dropped while their paired chest is locked.
Sourcepub fn location_context_lines(&self) -> Vec<ContextLine>
pub fn location_context_lines(&self) -> Vec<ContextLine>
Terrain, interactables, and map objects near the player for the HUD location panel.