mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 03:15:41 +00:00
feat(Core): add argument to .character rename to add name to reserved_name (#6163)
This commit is contained in:
@@ -7553,6 +7553,26 @@ bool ObjectMgr::IsReservedName(const std::string& name) const
|
||||
return _reservedNamesStore.find(wstr) != _reservedNamesStore.end();
|
||||
}
|
||||
|
||||
void ObjectMgr::AddReservedPlayerName(std::string const& name)
|
||||
{
|
||||
if (!IsReservedName(name))
|
||||
{
|
||||
std::wstring wstr;
|
||||
if (!Utf8toWStr(name, wstr))
|
||||
{
|
||||
LOG_ERROR("server", "Could not add invalid name to reserved player names: %s", name.c_str());
|
||||
return;
|
||||
}
|
||||
wstrToLower(wstr);
|
||||
|
||||
_reservedNamesStore.insert(wstr);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_RESERVED_PLAYER_NAME);
|
||||
stmt->setString(0, name);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
}
|
||||
|
||||
enum LanguageType
|
||||
{
|
||||
LT_BASIC_LATIN = 0x0000,
|
||||
|
||||
Reference in New Issue
Block a user