From 6b2d12206c56222ddd7877a786d11701396fc63f Mon Sep 17 00:00:00 2001 From: Motive <42782517+motivewc@users.noreply.github.com> Date: Wed, 28 Aug 2024 13:59:19 -0400 Subject: Core: Allow macOS arm64 client to connect (#30173) --- src/server/bnetserver/Server/Session.cpp | 2 +- src/server/game/Server/WorldSocket.cpp | 4 +++- src/server/shared/Realm/RealmList.cpp | 8 +++++++- src/server/shared/Realm/RealmList.h | 1 + 4 files changed, 12 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/bnetserver/Server/Session.cpp b/src/server/bnetserver/Server/Session.cpp index 46fd1d1479a..c3aaa972160 100644 --- a/src/server/bnetserver/Server/Session.cpp +++ b/src/server/bnetserver/Server/Session.cpp @@ -219,7 +219,7 @@ uint32 Battlenet::Session::HandleLogon(authentication::v1::LogonRequest const* l return ERROR_BAD_PROGRAM; } - if (logonRequest->platform() != "Win" && logonRequest->platform() != "Wn64" && logonRequest->platform() != "Mc64") + if (logonRequest->platform() != "Win" && logonRequest->platform() != "Wn64" && logonRequest->platform() != "Mc64" && logonRequest->platform() != "MacA") { TC_LOG_DEBUG("session", "[Battlenet::LogonRequest] {} attempted to log in from an unsupported platform (using {})!", GetClientInfo(), logonRequest->platform()); return ERROR_BAD_PLATFORM; diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 68783a321ae..f583c488367 100644 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -713,6 +713,8 @@ void WorldSocket::HandleAuthSessionCallback(std::shared_ptrWin64AuthSeed.data(), buildInfo->Win64AuthSeed.size()); else if (account.Game.OS == "Mc64") digestKeyHash.UpdateData(buildInfo->Mac64AuthSeed.data(), buildInfo->Mac64AuthSeed.size()); + else if (account.Game.OS == "MacA") + digestKeyHash.UpdateData(buildInfo->MacArmAuthSeed.data(), buildInfo->MacArmAuthSeed.size()); digestKeyHash.Finalize(); @@ -790,7 +792,7 @@ void WorldSocket::HandleAuthSessionCallback(std::shared_ptrgetBoolConfig(CONFIG_WARDEN_ENABLED); - if (wardenActive && account.Game.OS != "Win" && account.Game.OS != "Wn64" && account.Game.OS != "Mc64") + if (wardenActive && account.Game.OS != "Win" && account.Game.OS != "Wn64" && account.Game.OS != "Mc64" && account.Game.OS != "MacA") { SendAuthResponseError(ERROR_DENIED); TC_LOG_ERROR("network", "WorldSocket::HandleAuthSession: Client {} attempted to log in using invalid client OS ({}).", address, account.Game.OS); diff --git a/src/server/shared/Realm/RealmList.cpp b/src/server/shared/Realm/RealmList.cpp index 2568a859f88..fd1e6e3a165 100644 --- a/src/server/shared/Realm/RealmList.cpp +++ b/src/server/shared/Realm/RealmList.cpp @@ -82,7 +82,7 @@ void RealmList::Close() void RealmList::LoadBuildInfo() { // 0 1 2 3 4 5 6 - if (QueryResult result = LoginDatabase.Query("SELECT majorVersion, minorVersion, bugfixVersion, hotfixVersion, build, win64AuthSeed, mac64AuthSeed FROM build_info ORDER BY build ASC")) + if (QueryResult result = LoginDatabase.Query("SELECT majorVersion, minorVersion, bugfixVersion, hotfixVersion, build, win64AuthSeed, mac64AuthSeed, macArmAuthSeed FROM build_info ORDER BY build ASC")) { do { @@ -111,6 +111,12 @@ void RealmList::LoadBuildInfo() else build.Mac64AuthSeed = { }; + std::string macArmAuthSeedHexStr = fields[7].GetString(); + if (macArmAuthSeedHexStr.length() == build.MacArmAuthSeed.size() * 2) + HexStrToByteArray(macArmAuthSeedHexStr, build.MacArmAuthSeed); + else + build.MacArmAuthSeed = { }; + } while (result->NextRow()); } } diff --git a/src/server/shared/Realm/RealmList.h b/src/server/shared/Realm/RealmList.h index 3cbbb97c316..b61ad502877 100644 --- a/src/server/shared/Realm/RealmList.h +++ b/src/server/shared/Realm/RealmList.h @@ -38,6 +38,7 @@ struct RealmBuildInfo std::array HotfixVersion; std::array Win64AuthSeed; std::array Mac64AuthSeed; + std::array MacArmAuthSeed; }; namespace bgs::protocol::game_utilities::v1 -- cgit v1.2.3