mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[7166] Make reserved name check case-insensitive.
Original patch provided by jpmythic.
This commit is contained in:
parent
df13468ee1
commit
737600a665
3 changed files with 24 additions and 9 deletions
|
|
@ -6315,11 +6315,18 @@ void ObjectMgr::LoadReservedPlayersNames()
|
|||
bar.step();
|
||||
fields = result->Fetch();
|
||||
std::string name= fields[0].GetCppString();
|
||||
if(normalizePlayerName(name))
|
||||
|
||||
std::wstring wstr;
|
||||
if(!Utf8toWStr (name,wstr))
|
||||
{
|
||||
m_ReservedNames.insert(name);
|
||||
++count;
|
||||
sLog.outError("Table `reserved_name` have invalid name: %s", name.c_str() );
|
||||
continue;
|
||||
}
|
||||
|
||||
wstrToLower(wstr);
|
||||
|
||||
m_ReservedNames.insert(wstr);
|
||||
++count;
|
||||
} while ( result->NextRow() );
|
||||
|
||||
delete result;
|
||||
|
|
@ -6328,6 +6335,17 @@ void ObjectMgr::LoadReservedPlayersNames()
|
|||
sLog.outString( ">> Loaded %u reserved player names", count );
|
||||
}
|
||||
|
||||
bool ObjectMgr::IsReservedName( const std::string& name ) const
|
||||
{
|
||||
std::wstring wstr;
|
||||
if(!Utf8toWStr (name,wstr))
|
||||
return false;
|
||||
|
||||
wstrToLower(wstr);
|
||||
|
||||
return m_ReservedNames.find(wstr) != m_ReservedNames.end();
|
||||
}
|
||||
|
||||
enum LanguageType
|
||||
{
|
||||
LT_BASIC_LATIN = 0x0000,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue