From f9812773dd725f3303287f75fae5f9c753744e59 Mon Sep 17 00:00:00 2001 From: Diavolo Date: Mon, 3 Apr 2023 19:14:45 +0200 Subject: [PATCH 01/17] fix getguid & getxuid --- src/client/component/bots.cpp | 2 ++ src/client/component/dedicated_patches.cpp | 20 ++++++++++++++++++++ src/client/game/structs.hpp | 4 ++++ src/client/game/symbols.hpp | 6 ++++++ 4 files changed, 32 insertions(+) diff --git a/src/client/component/bots.cpp b/src/client/component/bots.cpp index 2f334f62..0d06afd0 100644 --- a/src/client/component/bots.cpp +++ b/src/client/component/bots.cpp @@ -115,6 +115,8 @@ namespace bots struct component final : generic_component { + static_assert(offsetof(game::client_s, bIsTestClient) == 0xBB360); + void post_unpack() override { utils::hook::jump(game::select(0x141653B70, 0x1402732E0), get_bot_name); diff --git a/src/client/component/dedicated_patches.cpp b/src/client/component/dedicated_patches.cpp index 45a961c1..bb936719 100644 --- a/src/client/component/dedicated_patches.cpp +++ b/src/client/component/dedicated_patches.cpp @@ -67,10 +67,27 @@ namespace dedicated_patches spawn_server_hook.invoke(controllerIndex, server, preload, savegame); } + + uint64_t sv_get_player_xuid_stub(int client_num) + { + return game::svs_clients[client_num].xuid; + } + + int sv_get_guid(int client_num) + { + if (client_num < 0 || client_num >= game::Dvar_GetInt(*game::com_maxclients)) + { + return 0; + } + + return game::svs_clients[client_num].xuid; + } } struct component final : server_component { + static_assert(offsetof(game::client_s, xuid) == 0xBB354); + void post_unpack() override { // Fix infinite loop @@ -90,6 +107,9 @@ namespace dedicated_patches // Don't count server as client utils::hook::jump(0x14052F0F5_g, 0x14052F139_g); + + utils::hook::call(0x1402853D7_g, sv_get_player_xuid_stub); // PlayerCmd_GetXuid + utils::hook::call(0x140283303_g, sv_get_guid); // PlayerCmd_GetGuid } }; } diff --git a/src/client/game/structs.hpp b/src/client/game/structs.hpp index be6386f3..8fff9a42 100644 --- a/src/client/game/structs.hpp +++ b/src/client/game/structs.hpp @@ -1544,6 +1544,10 @@ namespace game struct client_s { + char __pad0[0xBB354]; + int xuid; + char __pad1[0x8]; + bool bIsTestClient; }; enum scriptInstance_t diff --git a/src/client/game/symbols.hpp b/src/client/game/symbols.hpp index 4e325035..029c3d5f 100644 --- a/src/client/game/symbols.hpp +++ b/src/client/game/symbols.hpp @@ -104,6 +104,7 @@ namespace game WEAK symbol Dvar_GetString{0x1422BF590, 0x140575E30}; WEAK symbol Dvar_DisplayableValue{0x1422BC080}; WEAK symbol Dvar_GetBool{0x1422BCED0}; + WEAK symbol Dvar_GetInt{0x0, 0x140575C20}; WEAK symbol Dvar_RegisterBool{ 0x1422D0900, 0x14057B500 @@ -189,6 +190,11 @@ namespace game WEAK symbol s_dvarPool{0x157AC6220, 0x14A3CB620}; WEAK symbol g_dvarCount{0x157AC61CC, 0x14A3CB5FC}; + WEAK symbol svs_clients{0x0, 0x14A178E98}; + + // Dvar variables + WEAK symbol com_maxclients{0x0, 0x14948EE70}; + namespace s_wcd { WEAK symbol codLogo{0x157E75A50, 0x14A640BC0}; From 5848a271a069e6b8c55c2d8e977abf9ce81ceb25 Mon Sep 17 00:00:00 2001 From: Diavolo Date: Mon, 3 Apr 2023 19:18:37 +0200 Subject: [PATCH 02/17] forgot to fill out rest of struct --- src/client/game/structs.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/client/game/structs.hpp b/src/client/game/structs.hpp index 8fff9a42..b3599480 100644 --- a/src/client/game/structs.hpp +++ b/src/client/game/structs.hpp @@ -1548,8 +1548,11 @@ namespace game int xuid; char __pad1[0x8]; bool bIsTestClient; + char __pad2[0x29DAC]; }; + static_assert(sizeof(client_s) == 0xE5110); + enum scriptInstance_t { SCRIPTINSTANCE_SERVER = 0x0, From a6a7c81c2d09aa9f088eb967bf40af1e3a6955f4 Mon Sep 17 00:00:00 2001 From: Edo Date: Mon, 3 Apr 2023 19:54:45 +0200 Subject: [PATCH 03/17] dedicated_patche: handle conversion to unsigned --- src/client/component/dedicated_patches.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/component/dedicated_patches.cpp b/src/client/component/dedicated_patches.cpp index bb936719..307f1095 100644 --- a/src/client/component/dedicated_patches.cpp +++ b/src/client/component/dedicated_patches.cpp @@ -70,7 +70,7 @@ namespace dedicated_patches uint64_t sv_get_player_xuid_stub(int client_num) { - return game::svs_clients[client_num].xuid; + return static_cast(game::svs_clients[client_num].xuid); } int sv_get_guid(int client_num) From 4f89912bf68f622d0395d1da5fd150240142f9ed Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Apr 2023 18:03:23 +0000 Subject: [PATCH 04/17] Bump deps/libtommath from `886126c` to `53fdf5f` Bumps [deps/libtommath](https://github.com/libtom/libtommath) from `886126c` to `53fdf5f`. - [Release notes](https://github.com/libtom/libtommath/releases) - [Commits](https://github.com/libtom/libtommath/compare/886126cb45bac67da77f4238bef6ffb843e9e26f...53fdf5f9c73cb4fde599dd07e54bac8264f7b236) --- updated-dependencies: - dependency-name: deps/libtommath dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- deps/libtommath | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/libtommath b/deps/libtommath index 886126cb..53fdf5f9 160000 --- a/deps/libtommath +++ b/deps/libtommath @@ -1 +1 @@ -Subproject commit 886126cb45bac67da77f4238bef6ffb843e9e26f +Subproject commit 53fdf5f9c73cb4fde599dd07e54bac8264f7b236 From a139b67f9f304a63e17605a5d96132a7f1f70f90 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Apr 2023 18:03:29 +0000 Subject: [PATCH 05/17] Bump deps/curl from `3797f1a` to `a13ef31` Bumps [deps/curl](https://github.com/curl/curl) from `3797f1a` to `a13ef31`. - [Release notes](https://github.com/curl/curl/releases) - [Commits](https://github.com/curl/curl/compare/3797f1a4ca8fbd1c73a93ea973a3a6931b6e689b...a13ef31d0fbbf98120b711746bd8802acaba6b0a) --- updated-dependencies: - dependency-name: deps/curl dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- deps/curl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/curl b/deps/curl index 3797f1a4..a13ef31d 160000 --- a/deps/curl +++ b/deps/curl @@ -1 +1 @@ -Subproject commit 3797f1a4ca8fbd1c73a93ea973a3a6931b6e689b +Subproject commit a13ef31d0fbbf98120b711746bd8802acaba6b0a From 021a619f56b68f64ac49b827da4d28aba5b02f8a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Apr 2023 18:03:48 +0000 Subject: [PATCH 06/17] Bump deps/libtomcrypt from `05f9407` to `fae62af` Bumps [deps/libtomcrypt](https://github.com/libtom/libtomcrypt) from `05f9407` to `fae62af`. - [Release notes](https://github.com/libtom/libtomcrypt/releases) - [Commits](https://github.com/libtom/libtomcrypt/compare/05f94077cc0aa42f550e85d2785a92b668117ada...fae62af0ab16f469c2512ec04575dd60ca018657) --- updated-dependencies: - dependency-name: deps/libtomcrypt dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- deps/libtomcrypt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/libtomcrypt b/deps/libtomcrypt index 05f94077..fae62af0 160000 --- a/deps/libtomcrypt +++ b/deps/libtomcrypt @@ -1 +1 @@ -Subproject commit 05f94077cc0aa42f550e85d2785a92b668117ada +Subproject commit fae62af0ab16f469c2512ec04575dd60ca018657 From 924abd0ed52317a523b10ce0ce7ae1834edb0cc8 Mon Sep 17 00:00:00 2001 From: Diavolo Date: Mon, 3 Apr 2023 21:51:30 +0200 Subject: [PATCH 07/17] fix: forgot to * the array of clients --- src/client/component/dedicated_patches.cpp | 4 ++-- src/client/game/symbols.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/component/dedicated_patches.cpp b/src/client/component/dedicated_patches.cpp index 307f1095..b535a7be 100644 --- a/src/client/component/dedicated_patches.cpp +++ b/src/client/component/dedicated_patches.cpp @@ -70,7 +70,7 @@ namespace dedicated_patches uint64_t sv_get_player_xuid_stub(int client_num) { - return static_cast(game::svs_clients[client_num].xuid); + return static_cast((*game::svs_clients)[client_num].xuid); } int sv_get_guid(int client_num) @@ -80,7 +80,7 @@ namespace dedicated_patches return 0; } - return game::svs_clients[client_num].xuid; + return (*game::svs_clients)[client_num].xuid; } } diff --git a/src/client/game/symbols.hpp b/src/client/game/symbols.hpp index 029c3d5f..c2fd5aec 100644 --- a/src/client/game/symbols.hpp +++ b/src/client/game/symbols.hpp @@ -190,7 +190,7 @@ namespace game WEAK symbol s_dvarPool{0x157AC6220, 0x14A3CB620}; WEAK symbol g_dvarCount{0x157AC61CC, 0x14A3CB5FC}; - WEAK symbol svs_clients{0x0, 0x14A178E98}; + WEAK symbol svs_clients{0x0, 0x14A178E98}; // Dvar variables WEAK symbol com_maxclients{0x0, 0x14948EE70}; From d29b40c618d2332deb23e301435f2606ba2e9cb9 Mon Sep 17 00:00:00 2001 From: Diavolo Date: Mon, 3 Apr 2023 21:54:00 +0200 Subject: [PATCH 08/17] fix: this function did not need to be patched. Oops --- src/client/component/dedicated_patches.cpp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/client/component/dedicated_patches.cpp b/src/client/component/dedicated_patches.cpp index b535a7be..06c943ce 100644 --- a/src/client/component/dedicated_patches.cpp +++ b/src/client/component/dedicated_patches.cpp @@ -72,16 +72,6 @@ namespace dedicated_patches { return static_cast((*game::svs_clients)[client_num].xuid); } - - int sv_get_guid(int client_num) - { - if (client_num < 0 || client_num >= game::Dvar_GetInt(*game::com_maxclients)) - { - return 0; - } - - return (*game::svs_clients)[client_num].xuid; - } } struct component final : server_component @@ -109,7 +99,6 @@ namespace dedicated_patches utils::hook::jump(0x14052F0F5_g, 0x14052F139_g); utils::hook::call(0x1402853D7_g, sv_get_player_xuid_stub); // PlayerCmd_GetXuid - utils::hook::call(0x140283303_g, sv_get_guid); // PlayerCmd_GetGuid } }; } From b1cb80ba2ca597b228b246e03cfc6397b07ff9f2 Mon Sep 17 00:00:00 2001 From: WantedDV <122710241+WantedDV@users.noreply.github.com> Date: Mon, 3 Apr 2023 22:21:35 -0230 Subject: [PATCH 09/17] refresh custom maps list when entering mp/zm menu --- data/ui_scripts/stats/__init__.lua | 38 ++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/data/ui_scripts/stats/__init__.lua b/data/ui_scripts/stats/__init__.lua index a20f2ea3..f861651d 100644 --- a/data/ui_scripts/stats/__init__.lua +++ b/data/ui_scripts/stats/__init__.lua @@ -423,6 +423,43 @@ end local MapVote = 0 +CoD.LobbyMenus.MPButtonsLAN = function( arg0, arg1, arg2 ) + if IsStarterPack() then + AddSmallButton( arg0, arg1, CoD.LobbyButtons.QUIT ) + return + end + if arg2 == 1 then + AddSmallButton( arg0, arg1, CoD.LobbyButtons.MP_CUSTOM_START_GAME ) + AddSmallButton( arg0, arg1, CoD.LobbyButtons.MP_CUSTOM_SETUP_GAME ) + AddSpacer( arg1 ) + end + AddLargeButton( arg0, arg1, CoD.LobbyButtons.MP_CAC ) + AddLargeButton( arg0, arg1, CoD.LobbyButtons.MP_SPECIALISTS ) + AddLargeButton( arg0, arg1, CoD.LobbyButtons.MP_SCORESTREAKS ) + AddSpacer( arg1 ) + AddLargeButton( arg0, arg1, CoD.LobbyButtons.MP_CODCASTER_SETTINGS ) + if Engine.DvarBool( nil, "inventory_test_button_visible" ) then + AddLargeButton( arg0, arg1, CoD.LobbyButtons.MP_INVENTORY_TEST ) + end + Engine.Mods_Lists_UpdateUsermaps() +end + +CoD.LobbyMenus.MPButtonsMain = function ( arg0, arg1, arg2 ) + if arg2 == 1 then + AddLargeButton( arg0, arg1, CoD.LobbyButtons.MP_PUBLIC_MATCH ) + AddLargeButton( arg0, arg1, CoD.LobbyButtons.MP_ARENA ) + AddLargeButton( arg0, arg1, CoD.LobbyButtons.MP_CUSTOM_GAMES ) + AddLargeButton( arg0, arg1, CoD.LobbyButtons.THEATER_MP ) + end + AddSpacer( arg1 ) + if CoD.isPC then + AddLargeButton( arg0, arg1, CoD.LobbyButtons.STEAM_STORE ) + else + AddLargeButton( arg0, arg1, CoD.LobbyButtons.STORE ) + end + Engine.Mods_Lists_UpdateUsermaps() +end + CoD.LobbyMenus.MPButtonsOnline = function ( f26_arg0, f26_arg1, f26_arg2 ) if f26_arg2 == 1 then AddLargeButton( f26_arg0, f26_arg1, CoD.LobbyButtons.MP_FIND_MATCH ) @@ -510,6 +547,7 @@ CoD.LobbyMenus.ZMButtonsOnline = function ( f33_arg0, f33_arg1, f33_arg2 ) AddLargeButton( f33_arg0, f33_arg1, CoD.LobbyButtons.ZM_BUILD_KITS ) AddSpacer( f33_arg1 ) AddSmallButton( f33_arg0, f33_arg1, CoD.LobbyButtons.MP_STATS ) + Engine.Mods_Lists_UpdateUsermaps() end local targetButtons = { From 55c340c68f8bba71449ffd2ac4fa1ca79b3eb919 Mon Sep 17 00:00:00 2001 From: Diavolo Date: Tue, 4 Apr 2023 10:37:21 +0200 Subject: [PATCH 10/17] feat: implement sv_lanOnly & fix heart beat delay --- src/client/component/dedicated.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/client/component/dedicated.cpp b/src/client/component/dedicated.cpp index 6a5cde7f..9a66d959 100644 --- a/src/client/component/dedicated.cpp +++ b/src/client/component/dedicated.cpp @@ -15,6 +15,8 @@ namespace dedicated { namespace { + const game::dvar_t* sv_lan_only; + void sv_con_tell_f_stub(game::client_s* cl_0, game::svscmd_type type, [[maybe_unused]] const char* fmt, [[maybe_unused]] int c, char* text) { @@ -23,6 +25,11 @@ namespace dedicated void send_heartbeat_packet() { + if (sv_lan_only->current.value.enabled) + { + return; + } + game::netadr_t target{}; if (server_list::get_master_server(target)) { @@ -64,11 +71,14 @@ namespace dedicated // Fix tell command for IW4M utils::hook::call(0x14052A8CF_g, sv_con_tell_f_stub); + scheduler::once(send_heartbeat, scheduler::pipeline::main); scheduler::loop(send_heartbeat, scheduler::pipeline::main, 5min); command::add("heartbeat", send_heartbeat); // Hook GScr_ExitLevel utils::hook::jump(0x1402D1AA0_g, trigger_map_rotation); + + sv_lan_only = game::register_dvar_bool("sv_lanOnly", false, game::DVAR_NONE, "Don't send heartbeats"); } }; } From 34769f594d1545b941c0c798f814a21f481bcdb2 Mon Sep 17 00:00:00 2001 From: Sergio Brighenti Date: Tue, 4 Apr 2023 12:29:30 +0200 Subject: [PATCH 11/17] fix: restart button is never shown on online sessions --- data/ui_scripts/party/__init__.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/ui_scripts/party/__init__.lua b/data/ui_scripts/party/__init__.lua index b51b1fc0..741d9378 100644 --- a/data/ui_scripts/party/__init__.lua +++ b/data/ui_scripts/party/__init__.lua @@ -71,7 +71,7 @@ DataSources.StartMenuGameOptions = ListHelper_SetupDataSource("StartMenuGameOpti end elseif CoD.isZombie then table.insert(options, {models = {displayText = "MENU_RESUMEGAME_CAPS", action = StartMenuGoBack_ListElement}}) - if Engine.IsLobbyHost(Enum.LobbyType.LOBBY_TYPE_GAME) and (not not (Engine.SessionModeIsMode(CoD.SESSIONMODE_SYSTEMLINK) == true) or Engine.SessionModeIsMode(CoD.SESSIONMODE_OFFLINE) == true) then + if Engine.IsLobbyHost(Enum.LobbyType.LOBBY_TYPE_GAME) and (not Engine.SessionModeIsMode(CoD.SESSIONMODE_SYSTEMLINK) or Engine.SessionModeIsMode(CoD.SESSIONMODE_OFFLINE)) then table.insert(options, {models = {displayText = "MENU_RESTART_LEVEL_CAPS", action = RestartGame}}) end if Engine.IsLobbyHost(Enum.LobbyType.LOBBY_TYPE_GAME) == true then @@ -81,4 +81,4 @@ DataSources.StartMenuGameOptions = ListHelper_SetupDataSource("StartMenuGameOpti end end return options -end, true) \ No newline at end of file +end, true) From 3c4642303f37d67266d97c52fde73490fab5f995 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Apr 2023 18:01:59 +0000 Subject: [PATCH 12/17] Bump deps/curl from `a13ef31` to `4399a53` Bumps [deps/curl](https://github.com/curl/curl) from `a13ef31` to `4399a53`. - [Release notes](https://github.com/curl/curl/releases) - [Commits](https://github.com/curl/curl/compare/a13ef31d0fbbf98120b711746bd8802acaba6b0a...4399a532e9b7f340a3c8a573f3c2d36d2032bbc0) --- updated-dependencies: - dependency-name: deps/curl dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- deps/curl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/curl b/deps/curl index a13ef31d..4399a532 160000 --- a/deps/curl +++ b/deps/curl @@ -1 +1 @@ -Subproject commit a13ef31d0fbbf98120b711746bd8802acaba6b0a +Subproject commit 4399a532e9b7f340a3c8a573f3c2d36d2032bbc0 From fe59e621803afbbe25a730415dbffd2193288160 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Apr 2023 18:01:06 +0000 Subject: [PATCH 13/17] Bump deps/libtommath from `53fdf5f` to `37bd262` Bumps [deps/libtommath](https://github.com/libtom/libtommath) from `53fdf5f` to `37bd262`. - [Release notes](https://github.com/libtom/libtommath/releases) - [Commits](https://github.com/libtom/libtommath/compare/53fdf5f9c73cb4fde599dd07e54bac8264f7b236...37bd262cc22aeffaac5b9528ade3bf07fe8ea424) --- updated-dependencies: - dependency-name: deps/libtommath dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- deps/libtommath | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/libtommath b/deps/libtommath index 53fdf5f9..37bd262c 160000 --- a/deps/libtommath +++ b/deps/libtommath @@ -1 +1 @@ -Subproject commit 53fdf5f9c73cb4fde599dd07e54bac8264f7b236 +Subproject commit 37bd262cc22aeffaac5b9528ade3bf07fe8ea424 From 6f2607b91be63e70b889719c5badd96fc3eba2d8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Apr 2023 18:01:10 +0000 Subject: [PATCH 14/17] Bump deps/curl from `4399a53` to `98fac31` Bumps [deps/curl](https://github.com/curl/curl) from `4399a53` to `98fac31`. - [Release notes](https://github.com/curl/curl/releases) - [Commits](https://github.com/curl/curl/compare/4399a532e9b7f340a3c8a573f3c2d36d2032bbc0...98fac31b0613fc8cb88709a78c816d38d715fe11) --- updated-dependencies: - dependency-name: deps/curl dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- deps/curl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/curl b/deps/curl index 4399a532..98fac31b 160000 --- a/deps/curl +++ b/deps/curl @@ -1 +1 @@ -Subproject commit 4399a532e9b7f340a3c8a573f3c2d36d2032bbc0 +Subproject commit 98fac31b0613fc8cb88709a78c816d38d715fe11 From 08a1d6c744d02e3d89c842b16638abcb45983071 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 6 Apr 2023 17:22:14 +0000 Subject: [PATCH 15/17] Bump deps/curl from `98fac31` to `356dd0b` Bumps [deps/curl](https://github.com/curl/curl) from `98fac31` to `356dd0b`. - [Release notes](https://github.com/curl/curl/releases) - [Commits](https://github.com/curl/curl/compare/98fac31b0613fc8cb88709a78c816d38d715fe11...356dd0b73a75ed6d56682c818b73145862881989) --- updated-dependencies: - dependency-name: deps/curl dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- deps/curl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/curl b/deps/curl index 98fac31b..356dd0b7 160000 --- a/deps/curl +++ b/deps/curl @@ -1 +1 @@ -Subproject commit 98fac31b0613fc8cb88709a78c816d38d715fe11 +Subproject commit 356dd0b73a75ed6d56682c818b73145862881989 From 24bfcd9f32ce3c7903ed1d91afa50152a1498cd5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 6 Apr 2023 17:22:18 +0000 Subject: [PATCH 16/17] Bump deps/libtommath from `37bd262` to `3f10a28` Bumps [deps/libtommath](https://github.com/libtom/libtommath) from `37bd262` to `3f10a28`. - [Release notes](https://github.com/libtom/libtommath/releases) - [Commits](https://github.com/libtom/libtommath/compare/37bd262cc22aeffaac5b9528ade3bf07fe8ea424...3f10a28885601256c8b5261be3b15c926c93393d) --- updated-dependencies: - dependency-name: deps/libtommath dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- deps/libtommath | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/libtommath b/deps/libtommath index 37bd262c..3f10a288 160000 --- a/deps/libtommath +++ b/deps/libtommath @@ -1 +1 @@ -Subproject commit 37bd262cc22aeffaac5b9528ade3bf07fe8ea424 +Subproject commit 3f10a28885601256c8b5261be3b15c926c93393d From a939a536f37c595bb13c11ffeff7d1519239e037 Mon Sep 17 00:00:00 2001 From: BrentVL-1952840 <70229620+Brentdevent@users.noreply.github.com> Date: Thu, 6 Apr 2023 23:55:10 +0200 Subject: [PATCH 17/17] Workaround out-of-gobblegums --- src/client/component/script.cpp | 8 ++++++++ src/client/game/symbols.hpp | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/client/component/script.cpp b/src/client/component/script.cpp index f840f406..4a9e3eb6 100644 --- a/src/client/component/script.cpp +++ b/src/client/component/script.cpp @@ -13,6 +13,8 @@ namespace script namespace { utils::hook::detour db_findxassetheader_hook; + utils::hook::detour gscr_get_bgb_remaining_hook; + std::unordered_map loaded_scripts; game::RawFile* get_loaded_script(const std::string& name) @@ -110,6 +112,11 @@ namespace script return asset_header; } + + void gscr_get_bgb_remaining_stub(game::scriptInstance_t inst, void* entref) + { + game::Scr_AddInt(game::SCRIPTINSTANCE_SERVER, 255); + } } struct component final : generic_component @@ -126,6 +133,7 @@ namespace script } db_findxassetheader_hook.create(game::select(0x141420ED0, 0x1401D5FB0), db_findxassetheader_stub); + gscr_get_bgb_remaining_hook.create(game::select(0x141A8CAB0, 0x1402D2310), gscr_get_bgb_remaining_stub); } }; }; diff --git a/src/client/game/symbols.hpp b/src/client/game/symbols.hpp index c2fd5aec..7d41fc0e 100644 --- a/src/client/game/symbols.hpp +++ b/src/client/game/symbols.hpp @@ -139,7 +139,7 @@ namespace game WEAK symbol CL_CheckKeepDrawingConnectScreen{0x1413CCAE0}; // Scr - WEAK symbol Scr_AddInt{0x0, 0x14016F160}; + WEAK symbol Scr_AddInt{0x1412E9870, 0x14016F160}; WEAK symbol Scr_AddString{0x0, 0x14016F320}; WEAK symbol Scr_GetString{0x0, 0x140171490}; WEAK symbol Scr_Notify_Canon{