mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-12 23:24:35 +01:00
quick fmt
This commit is contained in:
@@ -214,11 +214,11 @@ fn restart_grasscutter(window: tauri::Window) -> bool {
|
|||||||
// Kill it
|
// Kill it
|
||||||
if process.kill() {
|
if process.kill() {
|
||||||
// Also kill the cmd it was open in
|
// Also kill the cmd it was open in
|
||||||
if let Some(parent) = system.process(Pid::from(process.parent().unwrap())) {
|
if let Some(parent) = system.process(process.parent().unwrap()) {
|
||||||
parent.kill();
|
parent.kill();
|
||||||
}
|
}
|
||||||
for process_gc in system.processes_by_name("java") {
|
for process_gc in system.processes_by_name("java") {
|
||||||
if process_gc.cmd().last().unwrap().contains(&"grasscutter") {
|
if process_gc.cmd().last().unwrap().contains("grasscutter") {
|
||||||
process_gc.kill();
|
process_gc.kill();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ struct ProxyHandler;
|
|||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
pub fn set_proxy_addr(addr: String) {
|
pub fn set_proxy_addr(addr: String) {
|
||||||
if addr.contains(" ") {
|
if addr.contains(' ') {
|
||||||
let addr2 = addr.replace(" ", "");
|
let addr2 = addr.replace(' ', "");
|
||||||
*SERVER.lock().unwrap() = addr2;
|
*SERVER.lock().unwrap() = addr2;
|
||||||
} else {
|
} else {
|
||||||
*SERVER.lock().unwrap() = addr;
|
*SERVER.lock().unwrap() = addr;
|
||||||
@@ -93,11 +93,7 @@ impl HttpHandler for ProxyHandler {
|
|||||||
async fn should_intercept(&mut self, _ctx: &HttpContext, _req: &Request<Body>) -> bool {
|
async fn should_intercept(&mut self, _ctx: &HttpContext, _req: &Request<Body>) -> bool {
|
||||||
let uri = _req.uri().to_string();
|
let uri = _req.uri().to_string();
|
||||||
|
|
||||||
if uri.contains("hoyoverse.com") || uri.contains("mihoyo.com") || uri.contains("yuanshen.com") {
|
uri.contains("hoyoverse.com") || uri.contains("mihoyo.com") || uri.contains("yuanshen.com")
|
||||||
true
|
|
||||||
} else {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user