diff options
author | p0358 <p0358@users.noreply.github.com> | 2022-01-02 09:51:35 +0100 |
---|---|---|
committer | p0358 <p0358@users.noreply.github.com> | 2022-01-02 09:51:35 +0100 |
commit | 92add9355edbe7a9b639e48077518ee4419e3d4c (patch) | |
tree | d34147cd01caf8da98267be1c72dc513b26fcb92 /loader_wsock32_proxy/loader.cpp | |
parent | 6b46d5a0617ce2c87aa1428bcd25c304f94a2749 (diff) | |
download | NorthstarLauncher-92add9355edbe7a9b639e48077518ee4419e3d4c.tar.gz NorthstarLauncher-92add9355edbe7a9b639e48077518ee4419e3d4c.zip |
make wsock32 proxy opt-in
Diffstat (limited to 'loader_wsock32_proxy/loader.cpp')
-rw-r--r-- | loader_wsock32_proxy/loader.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/loader_wsock32_proxy/loader.cpp b/loader_wsock32_proxy/loader.cpp index 49096bb0..907caa9d 100644 --- a/loader_wsock32_proxy/loader.cpp +++ b/loader_wsock32_proxy/loader.cpp @@ -16,9 +16,9 @@ void LibraryLoadError(DWORD dwMessageId, const wchar_t* libName, const wchar_t* bool ShouldLoadNorthstar() { - bool loadNorthstar = !strstr(GetCommandLineA(), "-vanilla"); + bool loadNorthstar = strstr(GetCommandLineA(), "-northstar"); - if (!loadNorthstar) + if (loadNorthstar) return loadNorthstar; auto runNorthstarFile = std::ifstream("run_northstar.txt"); @@ -27,8 +27,8 @@ bool ShouldLoadNorthstar() std::stringstream runNorthstarFileBuffer; runNorthstarFileBuffer << runNorthstarFile.rdbuf(); runNorthstarFile.close(); - if (runNorthstarFileBuffer.str()._Starts_with("0")) - loadNorthstar = false; + if (!runNorthstarFileBuffer.str()._Starts_with("0")) + loadNorthstar = true; } return loadNorthstar; } @@ -63,6 +63,9 @@ int LauncherMainHook(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi bool ProvisionNorthstar() { + if (!ShouldLoadNorthstar()) + return true; + if (MH_Initialize() != MH_OK) { MessageBoxA(GetForegroundWindow(), "MH_Initialize failed\nThe game cannot continue and has to exit.", "Northstar Wsock32 Proxy Error", 0); |