thermite/
lib.rs

1//! # Basic Usage:
2//! ```no_run
3//! use thermite::prelude::*;
4//! use std::io::Cursor;
5//!
6//! fn example() {
7//!     let index = get_package_index().unwrap();
8//!     if let Some(md) = index.iter().find(|e| e.name == "server_utilities") {
9//!         let latest = md.get_latest().unwrap();
10//!         let mut zipped = vec![];
11//!         download(&mut zipped, &latest.url).unwrap();
12//!         install_mod(&latest.full_name, Cursor::new(zipped), "packages").unwrap();
13//!     }    
14//! }
15//! ```
16
17pub mod api;
18pub mod core;
19pub mod error;
20pub mod model;
21
22/// The names of the Northstar core mods as found in their `mod.json` files, all lowercase
23pub const CORE_MODS: [&str; 3] = [
24    "northstar.custom",
25    "northstar.customservers",
26    "northstar.client",
27];
28
29/// Titanfall 2's Steam appid
30pub const TITANFALL2_STEAM_ID: u32 = 1237970;
31/// Titanfall 2's Origin/EA App ids
32pub const TITANFALL2_ORIGIN_IDS: [&str; 2] = ["Origin.OFR.50.0001452", "Origin.OFR.50.0001456"];
33
34// Important functions and structs
35pub mod prelude {
36    pub use crate::api::get_package_index;
37    pub use crate::core::manage::{
38        download, download_with_progress, install_mod, install_northstar, install_with_sanity,
39    };
40
41    pub use crate::core::utils::{find_mods, get_enabled_mods, resolve_deps};
42    #[cfg(all(target_os = "linux", feature = "proton"))]
43    pub use crate::core::{download_ns_proton, install_ns_proton, latest_release};
44    #[cfg(feature = "steam")]
45    pub use crate::core::{steam_dir, steam_libraries, titanfall2_dir};
46    pub use crate::error::ThermiteError;
47    pub use crate::CORE_MODS;
48    pub use crate::TITANFALL2_STEAM_ID;
49}