feat(core): added a workaround to fix login error 400 in the game

This commit is contained in:
Observer KRypt0n_ 2023-07-19 16:38:08 +02:00
parent 4a317fcc82
commit 1dfbf118a5
No known key found for this signature in database
GPG key ID: 844DA47BA25FE1E2
3 changed files with 24 additions and 4 deletions

View file

@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
### Fixed
- Added a workaround to remove outdated `Telemetry.dll` file which fixes login error 400 in game login screen
## [1.2.4] - 17.07.2023 ## [1.2.4] - 17.07.2023
### Fixed ### Fixed

View file

@ -93,9 +93,7 @@ impl SimpleComponent for AboutDialog {
"<p>Fixed</p>", "<p>Fixed</p>",
"<ul>", "<ul>",
"<li>Fixed jadeite patch state handling from the metadata file</li>", "<li>Added a workaround to remove outdated `Telemetry.dll` file which fixes login error 400 in game login screen</li>",
"<li>Fixed game pre-downloading button sensitivity when the update was partially downloaded, but then interrupted</li>",
"<li>Fixed game pre-downloading button visibility when jadeite patch state is not \"verified\"</li>",
"</ul>", "</ul>",
].join("\n"), ].join("\n"),

View file

@ -2,13 +2,31 @@ use relm4::prelude::*;
use crate::i18n::*; use crate::i18n::*;
use anime_launcher_sdk::config::ConfigExt;
use anime_launcher_sdk::star_rail::config::Config;
use super::{App, AppMsg}; use super::{App, AppMsg};
pub fn launch(sender: ComponentSender<App>) { pub fn launch(sender: ComponentSender<App>) {
sender.input(AppMsg::HideWindow); sender.input(AppMsg::HideWindow);
std::thread::spawn(move || { std::thread::spawn(move || {
if let Err(err) = anime_launcher_sdk::star_rail::game::run() { // Workaround of an issue appeared in 1.2 game update with lowercased telemetry.dll file
// This block will eventually be removed
let result = Config::get().and_then(|config| {
let telemetry = config.game.path
.for_edition(config.launcher.edition)
.join("StarRail_Data/Plugins/x86_64/Telemetry.dll");
if telemetry.exists() {
std::fs::remove_file(telemetry)?;
}
Ok(())
}).and_then(|_| anime_launcher_sdk::star_rail::game::run());
// if let Err(err) = anime_launcher_sdk::star_rail::game::run() {
if let Err(err) = result {
tracing::error!("Failed to launch game: {err}"); tracing::error!("Failed to launch game: {err}");
sender.input(AppMsg::Toast { sender.input(AppMsg::Toast {