diff --git a/src/client/component/network.cpp b/src/client/component/network.cpp index d476527c..590af692 100644 --- a/src/client/component/network.cpp +++ b/src/client/component/network.cpp @@ -14,6 +14,8 @@ namespace network { namespace { + utils::hook::detour handle_packet_internal_hook{}; + std::unordered_map& get_callbacks() { static std::unordered_map callbacks{}; @@ -127,6 +129,17 @@ namespace network { game::Cbuf_ExecuteBuffer(local_client_num, controller_index, buffer); } + + uint64_t handle_packet_internal_stub(const game::ControllerIndex_t controller_index, const game::netadr_t from_adr, const game::XUID from_xuid, + const game::LobbyType lobby_type, const uint64_t dest_module, game::msg_t* msg) + { + if (from_adr.type != game::NA_LOOPBACK) + { + return 0; + } + + return handle_packet_internal_hook.invoke(controller_index, from_adr, from_xuid, lobby_type, dest_module, msg) ? 1 : 0; + } } void on(const std::string& command, const callback& callback) @@ -246,6 +259,9 @@ namespace network // TODO: Fix that scheduler::once(create_ip_socket, scheduler::main); + + // Kill lobby system + handle_packet_internal_hook.create(game::select(0x141EF8030, 0x1404A5B90), &handle_packet_internal_stub); } }; }