diff options
author | Shauren <shauren.trinity@gmail.com> | 2020-06-30 00:22:25 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2020-06-30 00:22:25 +0200 |
commit | 79cd94d26df33a332586b2aa72a99b123199c88f (patch) | |
tree | dba4de419d8c470b4f932702d0ba71da569c9e03 /src/server/bnetserver/Server/Session.cpp | |
parent | 40c71ea9fca547f2a6fd547cb1cd35af361c4f3c (diff) |
Core/Misc: Changed GetLocaleByName to return invalid value on invalid input instead of LOCALE_enUS
* Also added IsValidLocale helper function
Diffstat (limited to 'src/server/bnetserver/Server/Session.cpp')
-rw-r--r-- | src/server/bnetserver/Server/Session.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/server/bnetserver/Server/Session.cpp b/src/server/bnetserver/Server/Session.cpp index 6a41c0f1dc2..9e3ec49a0ca 100644 --- a/src/server/bnetserver/Server/Session.cpp +++ b/src/server/bnetserver/Server/Session.cpp @@ -218,7 +218,7 @@ uint32 Battlenet::Session::HandleLogon(authentication::v1::LogonRequest const* l return ERROR_BAD_PLATFORM; } - if (GetLocaleByName(logonRequest->locale()) == LOCALE_enUS && logonRequest->locale() != "enUS") + if (!IsValidLocale(GetLocaleByName(logonRequest->locale()))) { TC_LOG_DEBUG("session", "[Battlenet::LogonRequest] %s attempted to log in with unsupported locale (using %s)!", GetClientInfo().c_str(), logonRequest->locale().c_str()); return ERROR_BAD_LOCALE; |