mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-06 08:32:51 +08:00
🚨 修复部分异常
This commit is contained in:
@@ -75,7 +75,7 @@ pub async fn get_dir_size(path: String) -> u64 {
|
||||
pub fn is_in_admin() -> bool {
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
{
|
||||
Err("This function is only supported on Windows.".into())
|
||||
return Err("This function is only supported on Windows.".into());
|
||||
}
|
||||
|
||||
use windows_sys::Win32::Foundation::HANDLE;
|
||||
@@ -121,7 +121,7 @@ pub fn is_in_admin() -> bool {
|
||||
pub fn run_with_admin() -> Result<(), String> {
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
{
|
||||
Err("This function is only supported on Windows.".into())
|
||||
return Err("This function is only supported on Windows.".into());
|
||||
}
|
||||
|
||||
use std::ffi::OsStr;
|
||||
|
||||
@@ -5,13 +5,10 @@ pub mod inject;
|
||||
pub mod proto;
|
||||
|
||||
use inject::{call_yaemain, create_named_pipe, find_module_base, inject_dll, spawn_process};
|
||||
use prost::encoding::{decode_key, WireType};
|
||||
use proto::parse_achi_list;
|
||||
use serde_json::Value;
|
||||
use std::collections::HashMap;
|
||||
use std::fs::File;
|
||||
use std::io;
|
||||
use std::io::{Read, Write};
|
||||
use std::io::{self, Read, Write};
|
||||
use std::os::windows::io::{FromRawHandle, RawHandle};
|
||||
use std::sync::Arc;
|
||||
use tauri::{AppHandle, Emitter, Manager};
|
||||
@@ -69,8 +66,9 @@ fn read_exact_vec<R: Read>(r: &mut R, len: usize) -> io::Result<Vec<u8>> {
|
||||
pub fn call_yae_dll(app_handle: AppHandle, game_path: String) -> () {
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
{
|
||||
Err("This function is only supported on Windows.".into())
|
||||
return Err("This function is only supported on Windows.".into());
|
||||
}
|
||||
|
||||
let dll_path = app_handle.path().resource_dir().unwrap().join("resources/YaeAchievementLib.dll");
|
||||
dbg!(&dll_path);
|
||||
// 0. 创建 YaeAchievementPipe 的 命名管道,获取句柄
|
||||
|
||||
@@ -141,7 +141,6 @@ pub fn parse_achi_list(bytes: &[u8]) -> Result<Vec<UiafAchiItem>, DecodeError> {
|
||||
}
|
||||
|
||||
if !dict.is_empty() {
|
||||
println!("Raw dict: {:?}", dict);
|
||||
dicts.push(dict);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user