Path of Exile 2 initial commit

poe_2/main
Oggje 2 months ago
parent d3ef66e498
commit 5e5d0723ef

File diff suppressed because it is too large Load Diff

63
src-tauri/Cargo.lock generated

@ -1,6 +1,6 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
version = 4
[[package]]
name = "Inflector"
@ -592,10 +592,11 @@ dependencies = [
[[package]]
name = "deranged"
version = "0.3.7"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7684a49fb1af197853ef7b2ee694bc1f5b4179556f1e5710e1760c5db6f5e929"
checksum = "28cfac68e08048ae1883171632c2aef3ebc555621ae56fbccce1cbf22dd7f058"
dependencies = [
"powerfmt",
"serde",
]
@ -1852,12 +1853,6 @@ version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
[[package]]
name = "minisign-verify"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "933dca44d65cdd53b355d0b73d380a2ff5da71f87f036053188bf1eab6a19881"
[[package]]
name = "miniz_oxide"
version = "0.7.1"
@ -2011,6 +2006,12 @@ dependencies = [
"winapi",
]
[[package]]
name = "num-conv"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"
[[package]]
name = "num-integer"
version = "0.1.45"
@ -2449,6 +2450,12 @@ dependencies = [
"serde_json",
]
[[package]]
name = "powerfmt"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
[[package]]
name = "ppv-lite86"
version = "0.2.17"
@ -2881,18 +2888,18 @@ dependencies = [
[[package]]
name = "serde"
version = "1.0.183"
version = "1.0.193"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32ac8da02677876d532745a130fc9d8e6edfa81a269b107c5b00829b91d8eb3c"
checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.183"
version = "1.0.193"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aafe972d60b0b9bee71a91b92fee2d4fb3c9d7e8f6b179aa99f27203d99a4816"
checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3"
dependencies = [
"proc-macro2",
"quote",
@ -3340,7 +3347,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fbe522898e35407a8e60dc3870f7579fea2fc262a6a6072eccdd37ae1e1d91e"
dependencies = [
"anyhow",
"base64 0.21.2",
"bytes",
"cocoa",
"dirs-next",
@ -3354,7 +3360,6 @@ dependencies = [
"heck 0.4.1",
"http",
"ignore",
"minisign-verify",
"objc",
"once_cell",
"percent-encoding",
@ -3375,14 +3380,12 @@ dependencies = [
"tauri-utils",
"tempfile",
"thiserror",
"time",
"tokio",
"url",
"uuid",
"webkit2gtk",
"webview2-com",
"windows 0.39.0",
"zip",
]
[[package]]
@ -3592,14 +3595,16 @@ dependencies = [
[[package]]
name = "time"
version = "0.3.25"
version = "0.3.41"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b0fdd63d58b18d663fbdf70e049f00a22c8e42be082203be7f26589213cd75ea"
checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40"
dependencies = [
"deranged",
"itoa 1.0.9",
"libc",
"num-conv",
"num_threads",
"powerfmt",
"serde",
"time-core",
"time-macros",
@ -3607,16 +3612,17 @@ dependencies = [
[[package]]
name = "time-core"
version = "0.1.1"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb"
checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c"
[[package]]
name = "time-macros"
version = "0.2.11"
version = "0.2.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eb71511c991639bb078fd5bf97757e03914361c48100d52878b8e52b46fb92cd"
checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49"
dependencies = [
"num-conv",
"time-core",
]
@ -4578,14 +4584,3 @@ checksum = "f4686009f71ff3e5c4dbcf1a282d0a44db3f021ba69350cd42086b3e5f1c6985"
dependencies = [
"libc",
]
[[package]]
name = "zip"
version = "0.6.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261"
dependencies = [
"byteorder",
"crc32fast",
"crossbeam-utils",
]

@ -20,7 +20,7 @@ ts-rs = "6.2.1"
[dependencies]
steamlocate = "1.2.1"
tauri = { version = "1.2", features = [ "dialog-message", "http-request", "dialog-open", "global-shortcut-all", "dialog-save", "updater", "system-tray"] }
tauri = { version = "1.2", features = [ "dialog-message", "http-request", "dialog-open", "global-shortcut-all", "dialog-save", "system-tray"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
Underlayer = { git = "https://git.isark.me/isark/Underlay.git" }

@ -0,0 +1 @@
{"plan":[{"area_key":"G1_1","notes":"","uuid":"b8a715a4-ae5b-4cc7-b73e-7860c545ee2d","edited":false,"anchor_act":null},{"area_key":"G1_2","notes":"","uuid":"6bb8f684-0d52-43cc-9bdb-19949a7e43b7","edited":false,"anchor_act":null},{"area_key":"G1_3","notes":"","uuid":"06793c19-a9bb-411c-9d01-e7a8ad636801","edited":false,"anchor_act":null}],"current":0,"update_url":null,"stored_path":null,"latest_server_etag":null,"identifier":null,"last_stored_time":null}

@ -9,36 +9,32 @@ use serde_derive::Serialize;
#[allow(dead_code)]
type UnprocessedAreas = Vec<UnprocessedArea>;
type StepOneUnprocessedAreas = HashMap<String, UnprocessedArea>;
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
struct UnprocessedArea {
#[serde(rename = "Id")]
pub named_id: String,
#[serde(rename = "_rid")]
pub key_id: usize,
#[serde(rename = "Name")]
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "Act")]
#[serde(rename = "id")]
pub named_id: String,
#[serde(rename = "area_level")]
pub area_level: i64,
#[serde(rename = "act")]
pub act: i64,
#[serde(rename = "IsTown")]
#[serde(rename = "is_town")]
pub is_town: bool,
#[serde(rename = "HasWaypoint")]
#[serde(rename = "has_waypoint")]
pub has_waypoint: bool,
#[serde(rename = "Connections_WorldAreasKeys")]
pub connections_world_areas_keys: Vec<i64>,
#[serde(rename = "IsVaalArea")]
pub is_vaal_area: bool,
#[serde(rename = "Unknown9")]
pub unknown9: i64,
#[serde(rename = "connections")]
pub connections_world_areas_keys: Vec<String>,
}
pub type AreaName = String;
@ -47,11 +43,11 @@ pub type AreaName = String;
pub struct WorldArea {
pub name: String,
pub named_id: String,
pub area_level: i64,
pub act: i64,
pub key_id: usize,
pub is_town: bool,
pub has_waypoint: bool,
pub connections_world_areas_keys: Vec<i64>,
pub connections_world_areas_keys: Vec<String>,
}
pub type AreaId = usize;
@ -105,7 +101,7 @@ impl WorldAreas {
.score
.cmp(&entry2.score)
.reverse()
.then(entry1.area.key_id.cmp(&entry2.area.key_id))
.then(entry1.area.area_level.cmp(&entry2.area.area_level))
});
let matches_areas = matches
@ -193,30 +189,27 @@ impl Matcher {
#[allow(dead_code)]
pub fn repack(content: &str, out_path: &str) {
let areas_json = serde_json::from_str::<UnprocessedAreas>(content);
let areas_json = serde_json::from_str::<StepOneUnprocessedAreas>(content).unwrap().into_iter().map(|(k,v)| v).collect::<Vec<UnprocessedArea>>();
let area_map = areas_json
.expect("Could not read world areas")
.into_iter()
.filter_map(|w_a| {
if w_a.act < 11
&& !w_a.is_vaal_area
&& !w_a.connections_world_areas_keys.is_empty()
&& !w_a.named_id.starts_with("Map")
&& !w_a.named_id.starts_with("Descent")
&& !w_a.named_id.starts_with("EndlessLedge")
&& w_a.unknown9 != 20
{
Some((
w_a.named_id.clone(),
WorldArea {
name: w_a.name,
named_id: w_a.named_id,
area_level: w_a.area_level,
act: w_a.act,
is_town: w_a.is_town,
has_waypoint: w_a.has_waypoint,
connections_world_areas_keys: w_a.connections_world_areas_keys,
key_id: w_a.key_id,
},
))
} else {
@ -232,10 +225,9 @@ pub fn repack(content: &str, out_path: &str) {
#[allow(dead_code)]
pub fn repack_full(content: &str, out_path: &str) {
let areas_json = serde_json::from_str::<UnprocessedAreas>(content);
let areas_json = serde_json::from_str::<StepOneUnprocessedAreas>(content).unwrap().into_iter().map(|(k,v)| v).collect::<Vec<UnprocessedArea>>();
let area_map = areas_json
.expect("Could not read world areas")
.into_iter()
.map(|w_a| {
(
@ -243,11 +235,11 @@ pub fn repack_full(content: &str, out_path: &str) {
WorldArea {
name: w_a.name,
named_id: w_a.named_id,
area_level: w_a.area_level,
act: w_a.act,
is_town: w_a.is_town,
has_waypoint: w_a.has_waypoint,
connections_world_areas_keys: w_a.connections_world_areas_keys,
key_id: w_a.key_id,
},
)
})

@ -170,7 +170,7 @@ fn main() {
let tx = Overlay::initialize(
app.get_window("Overlay")
.expect("Could not get main overlay window"),
"Path of Exile",
"Path of Exile 2",
);
app.manage(tx);
app.manage(Mutex::new(Storage::default()));

@ -77,9 +77,13 @@ impl Overlay {
recv(underlay_rx) -> msg => {
match msg {
Ok(event) => {
Self::handle_underlay_event(&mut fsm, event);
log::trace!("underlay_rx: {:?}", event);
Self::handle_underlay_event(&mut fsm, event);
},
Err(err) => {
log::trace!("Error: underlay_rx: {:?}", err);
break;
},
Err(_) => break,
}
},
recv(ee_rx) -> msg => {

@ -125,7 +125,7 @@ struct OldPlan {
struct OldArea {
_rid: usize,
}
/*
#[allow(dead_code)]
pub fn convert_old(path: PathBuf) -> Option<Plan> {
let plan: OldPlan =
@ -137,7 +137,7 @@ pub fn convert_old(path: PathBuf) -> Option<Plan> {
));
let map = map
.iter()
.map(|(k, v)| (v.key_id, k))
.map(|(k, v)| (v.area_level, k))
.collect::<HashMap<usize, &String>>();
Some(Plan {
@ -163,3 +163,4 @@ pub fn convert_old(path: PathBuf) -> Option<Plan> {
},
})
}
*/

@ -92,7 +92,7 @@ pub fn poe_client_log_receiver(path: PathBuf) -> (Receiver<String>, PollWatcher)
}
const POE_STEAM_APP_ID: u32 = 238960;
const POE_STEAM_APP_ID: u32 = 2694490;
pub fn get_poe_path() -> Option<PathBuf> {
if let Some(mut steam_dir) = steamlocate::SteamDir::locate() {
if let Some(app) = steam_dir.app(&POE_STEAM_APP_ID) {

@ -7,7 +7,7 @@ use directories::ProjectDirs;
use serde::{Deserialize, Serialize};
use crate::config::Config;
use crate::plan::{convert_old, Plan, PlanMetadata};
use crate::plan::{Plan, PlanMetadata};
use crate::time::{RunHistory, RunHistoryMetadata};
#[derive(Serialize, Deserialize, Debug)]
@ -18,7 +18,7 @@ pub struct Storage {
const QUALIFIER: &'static str = "me";
const ORGANIZATION: &'static str = "isark.poe";
const APPLICATION: &'static str = "Nothing";
const APPLICATION: &'static str = "Nothing_2";
const CONFIG_FILE: &'static str = "configuration.json";
const HISTORY_CACHE_FILE: &'static str = "history_cache.json";
const SAVED_PLANS: &'static str = "plans";
@ -105,7 +105,7 @@ impl Storage {
pub fn load_plan_at_path(path: PathBuf, save_local: bool) -> Option<Plan> {
let mut plan: Plan = match serde_json::from_str(&std::fs::read_to_string(&path).ok()?).ok() {
Some(plan) => plan,
None => convert_old(path.clone())?,
None => panic!("Could not read plan"),
};
if save_local {

@ -55,7 +55,7 @@
"csp": null
},
"updater": {
"active": true,
"active": false,
"endpoints": [
"https://isark.me/releases/nothing/version.json?target={{target}}"
],

@ -1,9 +1,9 @@
export interface WorldArea {
name: string
named_id: string
area_level: number
act: number
key_id: number
is_town: boolean
has_waypoint: boolean
connections_world_areas_keys: number[]
connections_world_areas_keys: string[]
}

@ -17,7 +17,7 @@ export class WorldAreaService {
constructor(private zone: NgZone) {
from(invoke<Map<string, WorldArea>>('load_world_areas')).subscribe((data) => {
const entries = Object.entries(data).sort((a, b) => a[1].key_id - b[1].key_id);
const entries = Object.entries(data).sort((a, b) => a[1].area_level - b[1].area_level);
this.worldAreas = new Map(entries);
this.zone.run(() => this.worldAreasSubject.next(this.worldAreas!));
this.matcher = new Fuzzr(this.worldAreas, {
@ -26,7 +26,7 @@ export class WorldAreaService {
});
from(invoke<Map<string, WorldArea>>('load_full_world_areas')).subscribe((data) => {
const entries = Object.entries(data).sort((a, b) => a[1].key_id - b[1].key_id);
const entries = Object.entries(data).sort((a, b) => a[1].area_level - b[1].area_level);
this.worldAreas = new Map(entries);
this.zone.run(() => this.fullWorldAreasSubject.next(this.worldAreas!));
});

Loading…
Cancel
Save