#[repr(C, packed(1))]pub struct PlayerInfo {Show 36 fields
pub name: PaddedString<MAX_NAME_LENGTH>,
pub race_preference: RacePreference,
pub player_race: PlayerRace,
pub id: u8,
pub team_index: u8,
pub team_color: u8,
pub player_type: PlayerType,
pub handicap: u32,
pub game_result: PlayerGameResult,
pub slot_state: PlayerSlotState,
pub ai_difficulty: AiDifficultyPreference,
pub actions_per_minute: u32,
pub real_time_actions_per_minute: u32,
pub gold: u32,
pub gold_mined: u32,
pub gold_upkeep_lost: u32,
pub gold_diversion_tax: u32,
pub lumber: u32,
pub lumber_mined: u32,
pub lumber_upkeep_lost: u32,
pub lumber_diversion_tax: u32,
pub food_cap: u32,
pub food_used: u32,
pub hero_count: u32,
pub heroes: [HeroInfo; 999],
pub structure_count: u32,
pub structures: [StructureInfo; 999],
pub upgrade_count: u32,
pub upgrades: [UpgradeInfo; 999],
pub unit_count: u32,
pub units: [UnitInfo; 999],
pub units_in_queue_count: u32,
pub units_in_queue: [BuildQueueInfo; 999],
pub item_count: u32,
pub items: [PlayerItemInfo; 999],
pub time_in_upkeep: [u32; 10],
}Expand description
Per-player state — name, race, resources, and arrays of heroes, structures, units, upgrades, items, and build queue entries.
Fields§
§name: PaddedString<MAX_NAME_LENGTH>Display name of the player.
race_preference: RacePreferenceRace the player chose in the lobby (may be Random or
UserSelectable).
player_race: PlayerRaceRace the player is actually playing this game.
id: u8Game-internal player ID (slot number).
team_index: u8Index of the team the player belongs to.
team_color: u8Team color index assigned to the player.
player_type: PlayerTypeWhat kind of participant occupies this slot (human, computer, observer, …).
handicap: u32Handicap percentage (e.g. 100 = no handicap, 50 = 50% max HP).
game_result: PlayerGameResultEnd-of-game result, once the game has ended.
slot_state: PlayerSlotStateLive state of the player’s slot (empty / playing / left).
ai_difficulty: AiDifficultyPreferenceDifficulty selected for this player when Self::player_type
is Computer.
actions_per_minute: u32Some sort of APM measurement, now sure how it differs from
Self::real_time_actions_per_minute.
real_time_actions_per_minute: u32Some sort of APM measurement, now sure how it differs from
Self::actions_per_minute.
gold: u32Current gold on hand.
gold_mined: u32Total gold mined this game.
gold_upkeep_lost: u32Gold lost to upkeep over the course of the game.
gold_diversion_tax: u32Not sure what this is
lumber: u32Current lumber on hand.
lumber_mined: u32Total lumber harvested this game.
lumber_upkeep_lost: u32Lumber lost to upkeep over the course of the game.
lumber_diversion_tax: u32Not sure what this is.
food_cap: u32Current food cap (maximum population).
food_used: u32Current food used (current population).
hero_count: u32Number of valid entries in Self::heroes.
heroes: [HeroInfo; 999]Heroes owned by the player.
structure_count: u32Number of valid entries in Self::structures.
structures: [StructureInfo; 999]Structures owned by the player.
upgrade_count: u32Number of valid entries in Self::upgrades.
upgrades: [UpgradeInfo; 999]Upgrades available to (researched or in progress by) the player.
unit_count: u32Number of valid entries in Self::units.
units: [UnitInfo; 999]Aggregate stats per unit kind owned by the player.
units_in_queue_count: u32Number of valid entries in Self::units_in_queue.
units_in_queue: [BuildQueueInfo; 999]In-progress training, research, and revival entries.
item_count: u32Number of valid entries in Self::items.
items: [PlayerItemInfo; 999]Aggregate stats per item type the player has interacted with.
time_in_upkeep: [u32; 10]Time spent in each upkeep level, indexed by level (in milliseconds). Not reliable for replays because it looks at wall time rather than in-game time i.e. replays can be paused, slow-down, or sped up, but it doesn’t account for that. Unknown if it keeps ticking while the “waiting for players” screen is counting down.