#[repr(C, packed(1))]pub struct ObserverData {
pub version: u32,
pub refresh_rate: u32,
pub game: ObserverGame,
pub players: [PlayerInfo; 28],
pub shop_count: u32,
pub shops: [ShopInfo; 999],
}Expand description
Top-level layout of the Warcraft III Stats Observer shared memory map.
This is the type ObserverHandle dereferences to. Because the underlying
memory is updated by Warcraft III, all numeric fields can change between
reads. The struct is #[repr(C, packed)], so borrow individual fields by
copying them with { ... }:
println!("version: {}", { observer.version });Fields§
§version: u32Not quite sure what this version number is supposed to represent.
refresh_rate: u32Current refresh rate of the API in milliseconds. A value of 0 disables updates.
game: ObserverGameGame-wide state (clock, map name, in-game flag, …).
players: [PlayerInfo; 28]Per-player state. Only the first
ObserverGame::active_player_count
entries are meaningful.
shop_count: u32Number of valid entries in Self::shops.
shops: [ShopInfo; 999]Per-shop state. Only the first Self::shop_count
entries are meaningful.
Implementations§
Source§impl ObserverData
impl ObserverData
Sourcepub fn set_refresh_rate(&mut self, duration: Duration)
pub fn set_refresh_rate(&mut self, duration: Duration)
Sets the observer’s refresh rate. Sub-millisecond precision is truncated. A duration of zero disables updates.