*Update to Mangos 7183.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-01-25 16:35:14 -06:00
parent 30f6b38941
commit ef88b04451
37 changed files with 914 additions and 646 deletions

View File

@@ -6486,11 +6486,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;
@@ -6499,6 +6506,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,