mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
Fix ipv6 in new servers.db
I do not like the new servers.db personally
This commit is contained in:
parent
6280969eb6
commit
203abca1e9
|
|
@ -821,7 +821,11 @@ void CPlatformNetworkManagerStub::SearchForGames()
|
||||||
info->data.isJoinable = true;
|
info->data.isJoinable = true;
|
||||||
strncpy_s(info->data.hostIP, sizeof(info->data.hostIP), ipBuf, _TRUNCATE);
|
strncpy_s(info->data.hostIP, sizeof(info->data.hostIP), ipBuf, _TRUNCATE);
|
||||||
info->data.hostPort = port;
|
info->data.hostPort = port;
|
||||||
info->sessionId = (SessionID)(static_cast<uint64_t>(inet_addr(ipBuf)) | (static_cast<uint64_t>(port) << 32));
|
|
||||||
|
//Hash IP so IPv4 and 6 both are a valid sess id
|
||||||
|
uint64_t ipHash = (uint64_t)std::hash<std::string>{}(ipBuf);
|
||||||
|
info->sessionId = (SessionID)(ipHash ^ (static_cast<uint64_t>(port << 32)));
|
||||||
|
|
||||||
friendsSessions[0].push_back(info);
|
friendsSessions[0].push_back(info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue