Skip to main content

ed_journals/modules/logs/content/log_event_content/
backpack_event.rs

1//! Fired when the backpack.json file is updated.
2
3use serde::{Deserialize, Serialize};
4
5use crate::modules::odyssey::Item;
6
7/// Fired when the backpack.json file is updated.
8#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
9#[serde(rename_all = "PascalCase")]
10pub struct BackpackEvent {
11    /// The items the player currently has in their backpack.
12    pub items: Vec<BackpackEventObject>,
13
14    /// The components the player currently has in their backpack.
15    pub components: Vec<BackpackEventObject>,
16
17    /// The consumables the player currently has in their backpack.
18    pub consumables: Vec<BackpackEventObject>,
19
20    /// The data the player currently has in their backpack.
21    pub data: Vec<BackpackEventObject>,
22}
23
24/// An item in the player's backpack.
25// TODO this is the same as ship_locker_event
26#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
27#[serde(rename_all = "PascalCase")]
28pub struct BackpackEventObject {
29    /// The item that is stormed.
30    pub name: Item,
31
32    /// The localized name of the item.
33    #[serde(rename = "Name_Localised")]
34    pub name_localized: Option<String>,
35
36    /// The ID of the owner of the item.
37    #[serde(rename = "OwnerID")]
38    pub owner_id: u64,
39
40    /// ID for the mission the item is related to, if any.
41    #[serde(rename = "MissionID")]
42    pub mission_id: Option<u64>,
43
44    /// The number of this kind of item.
45    pub count: u16,
46}