mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-02 06:40:42 -07:00
network: icmp emulation (#694)
## Link to GitHub Issue or related Pull Request, if one exists #0 ## Description of change Add `-icmphook` option under spicecfg Development/Network for emulating keepalive ping replies in user mode, so games do not need to open privileged raw ICMP sockets. This makes connecting to networks possible on macOS under Whisky, and on Windows with ICMP firewalled or spice running without Administrator privileges. ## Testing Tested DDR and SDVX on Windows 10 and macOS Tahoe. Network check status in test menu shows `CONNECTED` when -icmphook is enabled, and `NOT CONNECTED` when it is disabled. Actual network functionality works as expected (under previously impossible conditions).
This commit is contained in:
@@ -76,6 +76,7 @@
|
||||
#include "hooks/graphics/graphics.h"
|
||||
#include "hooks/lang.h"
|
||||
#include "hooks/networkhook.h"
|
||||
#include "hooks/icmphook_net.h"
|
||||
#include "hooks/unisintrhook.h"
|
||||
#include "launcher/launcher.h"
|
||||
#include "launcher/logger.h"
|
||||
@@ -244,6 +245,7 @@ int main_implementation(int argc, char *argv[]) {
|
||||
bool easrv_smart = false;
|
||||
bool load_stubs = false;
|
||||
bool netfix_disable = false;
|
||||
bool icmphook_enable = false;
|
||||
bool lang_disable = false;
|
||||
std::string process_priority_str = "high";
|
||||
bool cardio_enabled = false;
|
||||
@@ -732,6 +734,9 @@ int main_implementation(int argc, char *argv[]) {
|
||||
if (options[launcher::Options::DisableNetworkFixes].value_bool()) {
|
||||
netfix_disable = true;
|
||||
}
|
||||
if (options[launcher::Options::EnableICMPHook].value_bool()) {
|
||||
icmphook_enable = true;
|
||||
}
|
||||
if (options[launcher::Options::DisableACPHook].value_bool()) {
|
||||
lang_disable = true;
|
||||
}
|
||||
@@ -2259,6 +2264,11 @@ int main_implementation(int argc, char *argv[]) {
|
||||
avs::core::load_dll();
|
||||
avs::ea3::load_dll();
|
||||
|
||||
// ICMP emulation (opt-in; before games open raw ICMP sockets)
|
||||
if (icmphook_enable) {
|
||||
icmphook_net_init();
|
||||
}
|
||||
|
||||
// net fix
|
||||
if (!netfix_disable) {
|
||||
networkhook_init();
|
||||
|
||||
Reference in New Issue
Block a user