diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 722db1bdb..d21730d57 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,12 +38,24 @@ jobs: - name: Build and install debug run: | cmake --preset x64-Debug . + $f = Get-ChildItem _build/x64-Debug -Recurse -Filter steamnetworkingsockets_internal.h | Select-Object -First 1 + if (-not $f) { throw "GNS header nicht gefunden" } + $txt = Get-Content $f.FullName -Raw + $new = $txt -replace 'msg\.GetTypeName\(\)\.c_str\(\)', 'std::string( msg.GetTypeName() ).c_str()' + if ($new -eq $txt) { throw "Patch wurde nicht angewendet" } + Set-Content -Path $f.FullName -Value $new -NoNewline cmake --build _build/x64-Debug -j12 cmake --install _build/x64-Debug - name: Build and install release run: | cmake --preset x64-Release . + $f = Get-ChildItem _build/x64-Release -Recurse -Filter steamnetworkingsockets_internal.h | Select-Object -First 1 + if (-not $f) { throw "GNS header nicht gefunden" } + $txt = Get-Content $f.FullName -Raw + $new = $txt -replace 'msg\.GetTypeName\(\)\.c_str\(\)', 'std::string( msg.GetTypeName() ).c_str()' + if ($new -eq $txt) { throw "Patch wurde nicht angewendet" } + Set-Content -Path $f.FullName -Value $new -NoNewline cmake --build _build/x64-Release -j12 cmake --install _build/x64-Release @@ -173,4 +185,4 @@ jobs: upload_url: ${{ steps.get_release.outputs.upload_url }} asset_path: ${{ matrix.artifact }}/${{ matrix.artifact }}.zip asset_name: ${{ matrix.artifact }}.zip - asset_content_type: application/zip \ No newline at end of file + asset_content_type: application/zip diff --git a/CMakeLists.txt b/CMakeLists.txt index ffcc13160..7352c4105 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,7 @@ find_package(imguizmo CONFIG REQUIRED) find_package(unofficial-imgui-node-editor CONFIG REQUIRED) find_package(implot CONFIG REQUIRED) find_package(directxtex CONFIG REQUIRED) -#CPMAddPackage("gh:ValveSoftware/GameNetworkingSockets@1.4.1") +CPMAddPackage("gh:ValveSoftware/GameNetworkingSockets@1.4.1") CPMAddPackage("gh:OrfeasZ/ZHMTools@4.0.0") #add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../ZHMTools" "${VCPKG_BUILD_ROOT}/zhmtools") diff --git a/Mods/Hitmen/Src/Hitmen.cpp b/Mods/Hitmen/Src/Hitmen.cpp index 8e188db38..34c7f3b8e 100644 --- a/Mods/Hitmen/Src/Hitmen.cpp +++ b/Mods/Hitmen/Src/Hitmen.cpp @@ -14,7 +14,7 @@ #include "Glacier/EntityFactory.h" #include -#include "backends/imgui_impl_dx12.h" +#include #include "Glacier/SGameUpdateEvent.h" #include "Glacier/ZCollision.h" #include "Glacier/ZPhysics.h" @@ -64,7 +64,6 @@ void Hitmen::Init() { Hooks::ZEntitySceneContext_ClearScene->AddDetour(this, &Hitmen::OnClearScene); Hooks::ZEntitySceneContext_LoadScene->AddDetour(this, &Hitmen::OnLoadScene); - Hooks::ZPlayerRegistry_GetLocalPlayer->AddDetour(this, &Hitmen::GetLocalPlayer); } static void ServerCallback(SteamNetConnectionStatusChangedCallback_t* p_Info) @@ -578,24 +577,10 @@ void Hitmen::OnDraw3D(IRenderer* p_Renderer) } }*/ } - -DEFINE_PLUGIN_DETOUR(Hitmen, void, OnLoadScene, ZEntitySceneContext* th, ZSceneData& p_SceneData) -{ - // p_SceneData.m_sceneName = "assembly:/_pro/scenes/users/notex/test.entity"; - //p_SceneData.m_sceneName = "assembly:/_pro/scenes/missions/golden/mission_gecko/scene_gecko_basic.entity"; - //p_SceneData.m_sceneName = "assembly:/_PRO/Scenes/Missions/TheFacility/_Scene_Mission_Polarbear_Module_002_B.entity"; - //p_SceneData.m_sceneBricks.clear(); - - //p_SceneData.m_sceneName = "assembly:/_PRO/Scenes/Missions/Ancestral/scene_bulldog.entity"; - //p_SceneData.m_sceneBricks.clear(); - //p_SceneData.m_sceneBricks.push_back("assembly:/_PRO/scenes/missions/golden/mission_gecko/mission_gecko.brick"); - - /* - * Loading scene: assembly:/_pro/scenes/missions/golden/mission_gecko/scene_gecko_basic.entity -+ With brick: assembly:/_PRO/scenes/missions/golden/mission_gecko/mission_gecko.brick - */ - return HookResult(HookAction::Continue()); -} + DEFINE_PLUGIN_DETOUR(Hitmen, bool, OnLoadScene, ZEntitySceneContext* th, SSceneInitParameters& p_SceneData) + { + return HookResult(HookAction::Continue()); + } DEFINE_PLUGIN_DETOUR(Hitmen, void, OnClearScene, ZEntitySceneContext* th, bool p_FullyUnloadScene) { @@ -605,11 +590,4 @@ DEFINE_PLUGIN_DETOUR(Hitmen, void, OnClearScene, ZEntitySceneContext* th, bool p return HookResult(HookAction::Continue()); } -DEFINE_PLUGIN_DETOUR(Hitmen, TEntityRef*, GetLocalPlayer, ZPlayerRegistry* th, TEntityRef* out) -{ - auto s_Result = p_Hook->CallOriginal(th, out); - - return HookResult(HookAction::Return(), out); -} - DEFINE_ZHM_PLUGIN(Hitmen); diff --git a/Mods/Hitmen/Src/Hitmen.h b/Mods/Hitmen/Src/Hitmen.h index 0fd6e7fbb..4482e44a4 100644 --- a/Mods/Hitmen/Src/Hitmen.h +++ b/Mods/Hitmen/Src/Hitmen.h @@ -40,9 +40,9 @@ class Hitmen : public IPluginInterface void OnNpcPositions(BinaryStreamReader& p_Reader); private: - DECLARE_PLUGIN_DETOUR(Hitmen, void, OnLoadScene, ZEntitySceneContext*, ZSceneData&); + DECLARE_PLUGIN_DETOUR(Hitmen, bool, OnLoadScene, ZEntitySceneContext*, SSceneInitParameters&); DECLARE_PLUGIN_DETOUR(Hitmen, void, OnClearScene, ZEntitySceneContext* th, bool p_FullyUnloadScene); - DECLARE_PLUGIN_DETOUR(Hitmen, TEntityRef*, GetLocalPlayer, ZPlayerRegistry* th, TEntityRef* out); + // DECLARE_PLUGIN_DETOUR(Hitmen, TEntityRef*, GetLocalPlayer, ZPlayerRegistry* th, TEntityRef* out); private: bool m_Initialized = false; diff --git a/vcpkg.json b/vcpkg.json index b7ca50594..7dcaf49e4 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -8,7 +8,6 @@ "lz4", "directx-headers", "protobuf", - "gamenetworkingsockets", "zlib", "libuv", {