diff options
author | Shauren <shauren.trinity@gmail.com> | 2024-08-29 15:08:47 +0200 |
---|---|---|
committer | Ovahlord <dreadkiller@gmx.de> | 2024-08-30 17:35:01 +0200 |
commit | 2b8c5ad42dc886a7246b18af99c4966e9f1aba0e (patch) | |
tree | 4b3ef359bfa8bbe192984bc2b555eca338febf69 /src/server/bnetserver/Server/Session.cpp | |
parent | cf86c057383bd038cbdfd292e0ca98c7e6211d5c (diff) |
Core/Auth: Refactor client auth key storage to support more future client variants and preserve more information about client version
(cherry picked from commit 8e1595265925e0840d07e943b8c9ff1e906d4719)
Diffstat (limited to 'src/server/bnetserver/Server/Session.cpp')
-rw-r--r-- | src/server/bnetserver/Server/Session.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/server/bnetserver/Server/Session.cpp b/src/server/bnetserver/Server/Session.cpp index d95e99e34a6..a4f760a905a 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" && logonRequest->platform() != "MacA") + if (!ClientBuild::Platform::IsValid(logonRequest->platform())) { TC_LOG_DEBUG("session", "[Battlenet::LogonRequest] {} attempted to log in from an unsupported platform (using {})!", GetClientInfo(), logonRequest->platform()); return ERROR_BAD_PLATFORM; @@ -591,6 +591,8 @@ uint32 Battlenet::Session::GetRealmListTicket(std::unordered_map<std::string, Va clientInfoOk = true; memcpy(_clientSecret.data(), data.info().secret().data(), _clientSecret.size()); } + + _clientInfo = { .Platform = data.info().platformtype(), .Arch = data.info().clientarch(), .Type = data.info().type() }; } } @@ -691,7 +693,7 @@ uint32 Battlenet::Session::GetRealmList(std::unordered_map<std::string, Variant uint32 Battlenet::Session::JoinRealm(std::unordered_map<std::string, Variant const*> const& params, game_utilities::v1::ClientResponse* response) { if (Variant const* realmAddress = Trinity::Containers::MapGetValuePtr(params, "Param_RealmAddress")) - return sRealmList->JoinRealm(realmAddress->uint_value(), _build, GetRemoteIpAddress(), _clientSecret, GetLocaleByName(_locale), + return sRealmList->JoinRealm(realmAddress->uint_value(), _build, _clientInfo, GetRemoteIpAddress(), _clientSecret, GetLocaleByName(_locale), _os, _timezoneOffset, _gameAccountInfo->Name, _gameAccountInfo->SecurityLevel, response); return ERROR_WOW_SERVICES_INVALID_JOIN_TICKET; |