Kill lobby system

This is a step towards #100
This commit is contained in:
momo5502 2023-02-26 10:05:29 +01:00
parent 86e28acc48
commit ed2609d904

View File

@ -14,6 +14,8 @@ namespace network
{
namespace
{
utils::hook::detour handle_packet_internal_hook{};
std::unordered_map<std::string, callback>& get_callbacks()
{
static std::unordered_map<std::string, callback> 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<bool>(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);
}
};
}