Core/Misc: Changed GetLocaleByName to return invalid value on invalid input instead of LOCALE_enUS

* Also added IsValidLocale helper function
This commit is contained in:
Shauren
2020-06-30 00:22:25 +02:00
parent 40c71ea9fc
commit 79cd94d26d
6 changed files with 23 additions and 18 deletions

View File

@@ -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;