[RCon]: Use Hash only for IP (#807)
This commit is contained in:
parent
cda6214d63
commit
6b8eabe513
@ -88,8 +88,7 @@ namespace Components
|
||||
}
|
||||
|
||||
Network::Address address(params->get(1));
|
||||
std::hash<Network::Address> hashFn;
|
||||
const auto hash = hashFn(address);
|
||||
const auto hash = std::hash<std::uint32_t>()(*reinterpret_cast<const std::uint32_t*>(&address.getIP().bytes[0]));
|
||||
|
||||
if (address.isValid() && std::ranges::find(RconAddresses, hash) == RconAddresses.end())
|
||||
{
|
||||
@ -200,8 +199,7 @@ namespace Components
|
||||
|
||||
Network::OnClientPacket("rcon", [](const Network::Address& address, [[maybe_unused]] const std::string& data)
|
||||
{
|
||||
std::hash<Network::Address> hashFn;
|
||||
const auto hash = hashFn(address);
|
||||
const auto hash = std::hash<std::uint32_t>()(*reinterpret_cast<const std::uint32_t*>(&address.getIP().bytes[0]));
|
||||
if (!RconAddresses.empty() && std::ranges::find(RconAddresses, hash) == RconAddresses.end())
|
||||
{
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user