Skip to content

Commit

Permalink
Merge pull request #29 from IceDynamix/dev
Browse files Browse the repository at this point in the history
release v0.1.7 (game version 2.3)
  • Loading branch information
IceDynamix authored Jun 21, 2024
2 parents 83c939d + 41be996 commit 026048e
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 24 deletions.
7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "reliquary-archiver"
version = "0.1.6"
version = "0.1.7"
edition = "2021"
license = "MIT"
repository = "https://github.com/IceDynamix/reliquary-archiver"
Expand All @@ -23,8 +23,9 @@ ureq = { version = "2.9.7", features = ["json"] }

[dependencies.reliquary]
git = "https://github.com/IceDynamix/reliquary"
tag = "v1.0.1"
tag = "v2.0.0"

[profile.release]
opt-level = "z" # optimize for size
lto = true
lto = true
overflow-checks = false # Disable integer overflow checks.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ made to be used with [fribbels hsr optimizer](https://github.com/fribbels/hsr-op
sudo setcap CAP_NET_RAW=+ep target/release/reliquary-archiver
```
- download latest release from [here](https://github.com/IceDynamix/reliquary-archiver/releases/)
- **make sure you're on the main menu screen before the train hyperdrive in-gmae**
- **Launch the game and get to this screen. Do not go into the game yet**
![main menu start screen](./hsr_hyperdrive.jpg)
- run the archiver executable and wait until it says "listening with a timeout"
- enter train hyperdrive in-gmae
![archiver listening for timeout](./listening_for_timeout.png)
- start the game
- if successful, the archiver should output a file to `archiver_output.json`
![archiver visual guide](./archiver_visual_guide.gif)

### cli usage

Expand Down
Binary file added archiver_visual_guide.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added hsr_hyperdrive.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added listening_for_timeout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 19 additions & 16 deletions src/export/fribbels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl OptimizerExporter {
.filter_map(|b| export_proto_hero(&self.database, &b))
.collect();

self.current_trailblazer_path = trailblazer_id_to_path(hero.cur_basic_type.value() as u32);
self.current_trailblazer_path = avatar_path_lookup(&self.database, hero.cur_basic_type.value() as u32);
if let Some(path) = self.current_trailblazer_path {
info!(path, "found current trailblazer path");
} else {
Expand Down Expand Up @@ -176,7 +176,7 @@ impl Exporter for OptimizerExporter {
let cmd = command.parse_proto::<GetHeroBasicTypeInfoScRsp>();
match cmd {
Ok(cmd) => {
self.add_trailblazer_data(cmd)
self.add_trailblazer_data(cmd);
}
Err(error) => {
warn!(%error, "could not parse trailblazer data command");
Expand Down Expand Up @@ -313,7 +313,8 @@ impl Database {

// trailblazer
if avatar_id >= 8000 {
Some("Trailblazer".to_string())
let path = avatar_path_lookup(self, avatar_id)?;
Some(format!("Trailblazer{}", path))
} else {
let cfg = self.avatar_config.get(&avatar_id)?;
cfg.AvatarName.lookup(&self.text_map).map(|s| s.to_string())
Expand All @@ -339,7 +340,7 @@ fn export_proto_relic(db: &Database, proto: &ProtoRelic) -> Option<Relic> {
let slot = slot_type_to_export(&relic_config.Type);
let rarity = relic_config.MaxLevel / 3;
let mainstat = main_stat_to_export(&main_affix_config.Property).to_string();
let location = db.lookup_avatar_name(proto.base_avatar_id).unwrap_or("".to_string());
let location = db.lookup_avatar_name(proto.equip_avatar_id).unwrap_or("".to_string());

debug!(rarity, set, slot, slot, mainstat, location, "detected");

Expand Down Expand Up @@ -478,7 +479,7 @@ fn export_proto_light_cone(db: &Database, proto: &ProtoLightCone) -> Option<Ligh

debug!(light_cone=key, level, superimposition, "detected");

let location = db.lookup_avatar_name(proto.base_avatar_id)
let location = db.lookup_avatar_name(proto.equip_avatar_id)
.unwrap_or("".to_string());

Some(LightCone {
Expand Down Expand Up @@ -514,7 +515,7 @@ fn export_proto_character(db: &Database, proto: &ProtoCharacter) -> Option<Chara
}

fn export_proto_hero(db: &Database, proto: &HeroBasicTypeInfo) -> Option<Character> {
let path = trailblazer_id_to_path(proto.basic_type.value() as u32)?;
let path = avatar_path_lookup(db, proto.basic_type.value() as u32)?;
let key = format!("Trailblazer{}", path);

let span = info_span!("character", key);
Expand All @@ -535,17 +536,19 @@ fn export_proto_hero(db: &Database, proto: &HeroBasicTypeInfo) -> Option<Charact
})
}

fn trailblazer_id_to_path(id: u32) -> Option<&'static str> {
match id {
8001 | 8002 => Some("Destruction"),
8003 | 8004 => Some("Preservation"),
8005 | 8006 => Some("Hunt"),
8007 | 8008 => Some("Erudition"),
8009 | 8010 => Some("Harmony"),
8011 | 8012 => Some("Nihility"),
8013 | 8014 => Some("Abundance"),
fn avatar_path_lookup(db: &Database, avatar_id: u32) -> Option<&'static str> {
let hero_config = db.avatar_config.get(&avatar_id);
let avatar_base_type = hero_config.unwrap().AvatarBaseType.as_str();
match avatar_base_type {
"Knight" => Some("Preservation"),
"Rogue" => Some("Hunt"),
"Mage" => Some("Erudition"),
"Warlock" => Some("Nihility"),
"Warrior" => Some("Destruction"),
"Shaman" => Some("Harmony"),
"Priest" => Some("Abundance"),
_ => {
debug!(?id, "unknown path");
debug!(?avatar_base_type, "unknown path");
None
}
}
Expand Down
7 changes: 4 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fn main() {
if let Some(export) = export {
let file = File::create(&args.output).unwrap();
serde_json::to_writer_pretty(&file, &export).unwrap();
info!("wrote output to {}", &args.output.display());
info!("wrote output to {}", &args.output.canonicalize().unwrap().display());
} else {
warn!("skipped writing output");
}
Expand Down Expand Up @@ -124,7 +124,8 @@ where
if invalid >= 50 {
error!("received 50 packets that could not be segmented");
warn!("you probably started capturing when you were already in-game");
warn!("the capture needs to start on the main menu screen before hyperdrive");
warn!("the capture needs to start on the main menu screen");
warn!("log out then log back in");
return None;
}
} else {
Expand Down Expand Up @@ -176,7 +177,7 @@ where
let mut invalid = 0;
let mut warning_sent = false;

info!("instructions: go to main menu screen and go into train hyperdrive");
info!("instructions: go to main menu screen and go to the \"Click to Start\" screen");
info!("listening with a timeout of {} seconds...", args.timeout);

'recv: loop {
Expand Down

0 comments on commit 026048e

Please sign in to comment.