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

Port From (https://github.com/TrinityCore/TrinityCore/commit/79cd94d26df33a332586b2aa72a99b123199c88f)
This commit is contained in:
hondacrx
2020-07-14 17:11:56 -04:00
parent e179d29b55
commit 4bb9823456
5 changed files with 21 additions and 16 deletions
@@ -30,7 +30,7 @@ namespace BNetServer.Networking
return BattlenetRpcErrorCode.BadPlatform;
}
if (logonRequest.Locale.ToEnum<Locale>() == Locale.enUS && logonRequest.Locale != "enUS")
if (!SharedConst.IsValidLocale(logonRequest.Locale.ToEnum<Locale>()))
{
Log.outDebug(LogFilter.Session, $"Battlenet.LogonRequest: {GetClientInfo()} attempted to log in with unsupported locale (using {logonRequest.Locale})!");
return BattlenetRpcErrorCode.BadLocale;