diff options
| author | Shauren <shauren.trinity@gmail.com> | 2024-08-29 15:08:47 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2024-08-29 15:08:47 +0200 |
| commit | 8e1595265925e0840d07e943b8c9ff1e906d4719 (patch) | |
| tree | 644ad23420ca590c3b8980aab6cb8c5816e5052c /src/server/bnetserver/Server | |
| parent | bffc7ece61abf9fdc8c5dd599a8d22a549dc6b00 (diff) | |
Core/Auth: Refactor client auth key storage to support more future client variants and preserve more information about client version
Diffstat (limited to 'src/server/bnetserver/Server')
| -rw-r--r-- | src/server/bnetserver/Server/Session.cpp | 6 | ||||
| -rw-r--r-- | src/server/bnetserver/Server/Session.h | 2 |
2 files changed, 6 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; diff --git a/src/server/bnetserver/Server/Session.h b/src/server/bnetserver/Server/Session.h index 33a058f940c..8a8b1f0a15b 100644 --- a/src/server/bnetserver/Server/Session.h +++ b/src/server/bnetserver/Server/Session.h @@ -19,6 +19,7 @@ #define Session_h__ #include "AsyncCallbackProcessor.h" +#include "ClientBuildInfo.h" #include "Duration.h" #include "QueryResult.h" #include "Realm.h" @@ -173,6 +174,7 @@ namespace Battlenet std::string _locale; std::string _os; uint32 _build; + ClientBuild::VariantId _clientInfo; Minutes _timezoneOffset; std::string _ipCountry; |
