From 203abca1e93d03e1706ae07d7611b7b74297f619 Mon Sep 17 00:00:00 2001 From: Brendon <43822289+12brendon34@users.noreply.github.com> Date: Sun, 8 Mar 2026 04:11:47 -0700 Subject: [PATCH] Fix ipv6 in new servers.db I do not like the new servers.db personally --- .../Common/Network/PlatformNetworkManagerStub.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.cpp b/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.cpp index 44ca3c2f9..a3c536065 100644 --- a/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.cpp +++ b/Minecraft.Client/Common/Network/PlatformNetworkManagerStub.cpp @@ -821,7 +821,11 @@ void CPlatformNetworkManagerStub::SearchForGames() info->data.isJoinable = true; strncpy_s(info->data.hostIP, sizeof(info->data.hostIP), ipBuf, _TRUNCATE); info->data.hostPort = port; - info->sessionId = (SessionID)(static_cast(inet_addr(ipBuf)) | (static_cast(port) << 32)); + + //Hash IP so IPv4 and 6 both are a valid sess id + uint64_t ipHash = (uint64_t)std::hash{}(ipBuf); + info->sessionId = (SessionID)(ipHash ^ (static_cast(port << 32))); + friendsSessions[0].push_back(info); } }