use windows api instead of netsh command to manage game's network access

This commit is contained in:
2025-04-19 10:34:10 +01:00
parent 89892ef592
commit 09f5a3895b
3 changed files with 119 additions and 59 deletions
+6 -5
View File
@@ -32,10 +32,11 @@ pub struct App {
pub flags: Flags,
pub sysinfo: sysinfo::System,
game_handle: windows::Win32::Foundation::HANDLE,
pub launch: features::launch::Launch,
force_close: features::force_close::ForceClose,
empty_session: features::empty_session::EmptySession,
pub anti_afk: features::anti_afk::AntiAfk,
empty_session: features::empty_session::EmptySession,
force_close: features::force_close::ForceClose,
game_networking: features::game_networking::GameNetworking,
pub launch: features::launch::Launch,
}
impl eframe::App for App {
@@ -147,13 +148,13 @@ impl App {
.add_sized([button_width, 18.0], egui::Button::new("Block"))
.clicked()
{
features::game_networking::block_all(&mut self.sysinfo);
self.game_networking.block_all(&mut self.sysinfo);
}
if ui
.add_sized([button_width, 18.0], egui::Button::new("Unblock"))
.clicked()
{
features::game_networking::unblock_all();
self.game_networking.unblock_all();
}
});
});