diff --git a/premake5.lua b/premake5.lua index 36a252a..9d23d31 100644 --- a/premake5.lua +++ b/premake5.lua @@ -296,20 +296,6 @@ resincludedirs {"$(ProjectDir)src"} dependencies.imports() -project "runner" -kind "WindowedApp" -language "C++" - -files {"./src/runner/**.rc", "./src/runner/**.hpp", "./src/runner/**.cpp", "./src/runner/resources/**.*"} - -includedirs {"./src/runner", "./src/common", "%{prj.location}/src"} - -resincludedirs {"$(ProjectDir)src"} - -links {"common"} - -dependencies.imports() - project "client" kind "ConsoleApp" language "C++" @@ -327,7 +313,7 @@ includedirs {"./src/client", "./src/common", "%{prj.location}/src"} resincludedirs {"$(ProjectDir)src"} -dependson {"tlsdll", "runner"} +dependson {"tlsdll"} links {"common"} @@ -370,21 +356,5 @@ links {"common"} resincludedirs {"$(ProjectDir)src"} -project "runner" -kind "WindowedApp" -language "C++" - -files {"./src/runner/**.rc", "./src/runner/**.hpp", "./src/runner/**.cpp", "./src/runner/resources/**.*"} - -includedirs {"./src/runner", "./src/common", "%{prj.location}/src"} - -links {"common"} - -resincludedirs {"$(ProjectDir)src"} - -links {"common"} - -dependencies.imports() - group "Dependencies" dependencies.projects() \ No newline at end of file diff --git a/src/client/component/steam_proxy.cpp b/src/client/component/steam_proxy.cpp index 0cb182f..0b6a8ba 100644 --- a/src/client/component/steam_proxy.cpp +++ b/src/client/component/steam_proxy.cpp @@ -18,8 +18,6 @@ namespace steam_proxy { namespace { - utils::binary_resource runner_file(RUNNER, "runner.exe"); - utils::nt::library steam_client_module_{}; #ifdef LOAD_STEAM_OVERLAY utils::nt::library steam_overlay_module_{}; @@ -84,8 +82,7 @@ namespace steam_proxy steam_pipe_ = steam_client_module_.invoke("Steam_CreateSteamPipe"); global_user_ = steam_client_module_.invoke( "Steam_ConnectToGlobalUser", steam_pipe_); - client_user_ = client_engine_.invoke(8, steam_pipe_, global_user_); - // GetIClientUser + client_user_ = client_engine_.invoke(8, steam_pipe_, global_user_); // GetIClientUser client_utils_ = client_engine_.invoke(14, steam_pipe_); // GetIClientUtils } @@ -147,36 +144,23 @@ namespace steam_proxy client_utils_.invoke("SetAppIDForCurrentPipe", app_id, false); - char our_directory[MAX_PATH] = { 0 }; - GetCurrentDirectoryA(sizeof(our_directory), our_directory); - - const auto path = runner_file.get_extracted_file(); - const std::string cmdline = utils::string::va("\"%s\" -proc %d", path.data(), GetCurrentProcessId()); - - steam::game_id game_id; - game_id.raw.type = 1; // k_EGameIDTypeGameMod - game_id.raw.app_id = app_id & 0xFFFFFF; - - const auto* mod_id = "iw7"; - game_id.raw.mod_id = *reinterpret_cast(mod_id) | 0x80000000; - - client_user_.invoke("SpawnProcess", path.data(), cmdline.data(), our_directory, - &game_id.bits, title.data(), 0, 0, 0); - return ownership_state::success; } ownership_state start_mod(const std::string& title, const size_t app_id) { - __try + try { return start_mod_unsafe(title, app_id); } - __except (EXCEPTION_EXECUTE_HANDLER) + catch (const std::exception& e) { do_cleanup(); - return ownership_state::error; + printf("Steam: %s\n", e.what()); + MessageBoxA(GetForegroundWindow(), e.what(), "Error", MB_ICONERROR); + TerminateProcess(GetCurrentProcess(), 1234); } + return ownership_state::error; } } @@ -218,8 +202,9 @@ namespace steam_proxy break; } } - catch (std::exception& e) + catch (const std::exception& e) { + do_cleanup(); printf("Steam: %s\n", e.what()); MessageBoxA(GetForegroundWindow(), e.what(), "Error", MB_ICONERROR); TerminateProcess(GetCurrentProcess(), 1234); diff --git a/src/client/resource.hpp b/src/client/resource.hpp index 0ed778c..34c576e 100644 --- a/src/client/resource.hpp +++ b/src/client/resource.hpp @@ -9,7 +9,6 @@ #define DW_PLAYLISTS 303 #define TLS_DLL 304 -#define RUNNER 305 #define ICON_IMAGE 306 diff --git a/src/client/resource.rc b/src/client/resource.rc index bfadb29..e657525 100644 --- a/src/client/resource.rc +++ b/src/client/resource.rc @@ -107,12 +107,6 @@ TLS_DLL RCDATA "../../build/bin/x64/Debug/tlsdll.dll" TLS_DLL RCDATA "../../build/bin/x64/Release/tlsdll.dll" #endif -#ifdef _DEBUG -RUNNER RCDATA "../../build/bin/x64/Debug/runner.exe" -#else -RUNNER RCDATA "../../build/bin/x64/Release/runner.exe" -#endif - ICON_IMAGE RCDATA "resources/icon.png" #endif // English (United States) resources