mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[8126] Improvemets in player/pet/charter name checks.
* Implement new config options for minimal player/pet/charter name length (2 by default) * Better error reporting at problems in names. * Add check from max pet/charter name length (same as for player names at client side)
This commit is contained in:
parent
60fe792866
commit
715470a898
12 changed files with 114 additions and 48 deletions
|
|
@ -244,30 +244,31 @@ void WorldSession::HandleCharCreateOpcode( WorldPacket & recv_data )
|
||||||
}
|
}
|
||||||
|
|
||||||
// prevent character creating with invalid name
|
// prevent character creating with invalid name
|
||||||
if(!normalizePlayerName(name))
|
if (!normalizePlayerName(name))
|
||||||
{
|
{
|
||||||
data << (uint8)CHAR_NAME_INVALID_CHARACTER;
|
data << (uint8)CHAR_NAME_NO_NAME;
|
||||||
SendPacket( &data );
|
SendPacket( &data );
|
||||||
sLog.outError("Account:[%d] but tried to Create character with empty [name] ",GetAccountId());
|
sLog.outError("Account:[%d] but tried to Create character with empty [name] ",GetAccountId());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check name limitations
|
// check name limitations
|
||||||
if(!ObjectMgr::IsValidName(name,true))
|
uint8 res = ObjectMgr::CheckPlayerName(name,true);
|
||||||
|
if (res != CHAR_NAME_SUCCESS)
|
||||||
{
|
{
|
||||||
data << (uint8)CHAR_NAME_INVALID_CHARACTER;
|
data << uint8(res);
|
||||||
SendPacket( &data );
|
SendPacket( &data );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(GetSecurity() == SEC_PLAYER && objmgr.IsReservedName(name))
|
if (GetSecurity() == SEC_PLAYER && objmgr.IsReservedName(name))
|
||||||
{
|
{
|
||||||
data << (uint8)CHAR_NAME_RESERVED;
|
data << (uint8)CHAR_NAME_RESERVED;
|
||||||
SendPacket( &data );
|
SendPacket( &data );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(objmgr.GetPlayerGUIDByName(name))
|
if (objmgr.GetPlayerGUIDByName(name))
|
||||||
{
|
{
|
||||||
data << (uint8)CHAR_CREATE_NAME_IN_USE;
|
data << (uint8)CHAR_CREATE_NAME_IN_USE;
|
||||||
SendPacket( &data );
|
SendPacket( &data );
|
||||||
|
|
@ -275,7 +276,7 @@ void WorldSession::HandleCharCreateOpcode( WorldPacket & recv_data )
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryResult *resultacct = loginDatabase.PQuery("SELECT SUM(numchars) FROM realmcharacters WHERE acctid = '%d'", GetAccountId());
|
QueryResult *resultacct = loginDatabase.PQuery("SELECT SUM(numchars) FROM realmcharacters WHERE acctid = '%d'", GetAccountId());
|
||||||
if ( resultacct )
|
if (resultacct)
|
||||||
{
|
{
|
||||||
Field *fields=resultacct->Fetch();
|
Field *fields=resultacct->Fetch();
|
||||||
uint32 acctcharcount = fields[0].GetUInt32();
|
uint32 acctcharcount = fields[0].GetUInt32();
|
||||||
|
|
@ -967,7 +968,7 @@ void WorldSession::HandleCharRenameOpcode(WorldPacket& recv_data)
|
||||||
recv_data >> newname;
|
recv_data >> newname;
|
||||||
|
|
||||||
// prevent character rename to invalid name
|
// prevent character rename to invalid name
|
||||||
if(!normalizePlayerName(newname))
|
if (!normalizePlayerName(newname))
|
||||||
{
|
{
|
||||||
WorldPacket data(SMSG_CHAR_RENAME, 1);
|
WorldPacket data(SMSG_CHAR_RENAME, 1);
|
||||||
data << uint8(CHAR_NAME_NO_NAME);
|
data << uint8(CHAR_NAME_NO_NAME);
|
||||||
|
|
@ -975,16 +976,17 @@ void WorldSession::HandleCharRenameOpcode(WorldPacket& recv_data)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!ObjectMgr::IsValidName(newname, true))
|
uint8 res = ObjectMgr::CheckPlayerName(newname,true);
|
||||||
|
if (res != CHAR_NAME_SUCCESS)
|
||||||
{
|
{
|
||||||
WorldPacket data(SMSG_CHAR_RENAME, 1);
|
WorldPacket data(SMSG_CHAR_RENAME, 1);
|
||||||
data << uint8(CHAR_NAME_INVALID_CHARACTER);
|
data << uint8(res);
|
||||||
SendPacket( &data );
|
SendPacket( &data );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check name limitations
|
// check name limitations
|
||||||
if(GetSecurity() == SEC_PLAYER && objmgr.IsReservedName(newname))
|
if (GetSecurity() == SEC_PLAYER && objmgr.IsReservedName(newname))
|
||||||
{
|
{
|
||||||
WorldPacket data(SMSG_CHAR_RENAME, 1);
|
WorldPacket data(SMSG_CHAR_RENAME, 1);
|
||||||
data << uint8(CHAR_NAME_RESERVED);
|
data << uint8(CHAR_NAME_RESERVED);
|
||||||
|
|
@ -1240,7 +1242,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data)
|
||||||
}
|
}
|
||||||
|
|
||||||
// prevent character rename to invalid name
|
// prevent character rename to invalid name
|
||||||
if(!normalizePlayerName(newname))
|
if (!normalizePlayerName(newname))
|
||||||
{
|
{
|
||||||
WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1);
|
WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1);
|
||||||
data << uint8(CHAR_NAME_NO_NAME);
|
data << uint8(CHAR_NAME_NO_NAME);
|
||||||
|
|
@ -1248,16 +1250,17 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!ObjectMgr::IsValidName(newname,true))
|
uint8 res = ObjectMgr::CheckPlayerName(newname,true);
|
||||||
|
if (res != CHAR_NAME_SUCCESS)
|
||||||
{
|
{
|
||||||
WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1);
|
WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1);
|
||||||
data << uint8(CHAR_NAME_INVALID_CHARACTER);
|
data << uint8(res);
|
||||||
SendPacket( &data );
|
SendPacket( &data );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check name limitations
|
// check name limitations
|
||||||
if(GetSecurity() == SEC_PLAYER && objmgr.IsReservedName(newname))
|
if (GetSecurity() == SEC_PLAYER && objmgr.IsReservedName(newname))
|
||||||
{
|
{
|
||||||
WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1);
|
WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1);
|
||||||
data << uint8(CHAR_NAME_RESERVED);
|
data << uint8(CHAR_NAME_RESERVED);
|
||||||
|
|
@ -1266,9 +1269,9 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data)
|
||||||
}
|
}
|
||||||
|
|
||||||
// character with this name already exist
|
// character with this name already exist
|
||||||
if(uint64 newguid = objmgr.GetPlayerGUIDByName(newname))
|
if (uint64 newguid = objmgr.GetPlayerGUIDByName(newname))
|
||||||
{
|
{
|
||||||
if(newguid != guid)
|
if (newguid != guid)
|
||||||
{
|
{
|
||||||
WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1);
|
WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1);
|
||||||
data << uint8(CHAR_CREATE_NAME_IN_USE);
|
data << uint8(CHAR_CREATE_NAME_IN_USE);
|
||||||
|
|
|
||||||
|
|
@ -5623,18 +5623,18 @@ bool ChatHandler::HandlePDumpLoadCommand(const char *args)
|
||||||
char* name_str = strtok(NULL, " ");
|
char* name_str = strtok(NULL, " ");
|
||||||
|
|
||||||
std::string name;
|
std::string name;
|
||||||
if(name_str)
|
if (name_str)
|
||||||
{
|
{
|
||||||
name = name_str;
|
name = name_str;
|
||||||
// normalize the name if specified and check if it exists
|
// normalize the name if specified and check if it exists
|
||||||
if(!normalizePlayerName(name))
|
if (!normalizePlayerName(name))
|
||||||
{
|
{
|
||||||
PSendSysMessage(LANG_INVALID_CHARACTER_NAME);
|
PSendSysMessage(LANG_INVALID_CHARACTER_NAME);
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!ObjectMgr::IsValidName(name,true))
|
if (ObjectMgr::CheckPlayerName(name,true) != CHAR_NAME_SUCCESS)
|
||||||
{
|
{
|
||||||
PSendSysMessage(LANG_INVALID_CHARACTER_NAME);
|
PSendSysMessage(LANG_INVALID_CHARACTER_NAME);
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
|
|
@ -5646,17 +5646,17 @@ bool ChatHandler::HandlePDumpLoadCommand(const char *args)
|
||||||
|
|
||||||
uint32 guid = 0;
|
uint32 guid = 0;
|
||||||
|
|
||||||
if(guid_str)
|
if (guid_str)
|
||||||
{
|
{
|
||||||
guid = atoi(guid_str);
|
guid = atoi(guid_str);
|
||||||
if(!guid)
|
if (!guid)
|
||||||
{
|
{
|
||||||
PSendSysMessage(LANG_INVALID_CHARACTER_GUID);
|
PSendSysMessage(LANG_INVALID_CHARACTER_GUID);
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(objmgr.GetPlayerAccountIdByGUID(guid))
|
if (objmgr.GetPlayerAccountIdByGUID(guid))
|
||||||
{
|
{
|
||||||
PSendSysMessage(LANG_CHARACTER_GUID_IN_USE,guid);
|
PSendSysMessage(LANG_CHARACTER_GUID_IN_USE,guid);
|
||||||
SetSentErrorMessage(true);
|
SetSentErrorMessage(true);
|
||||||
|
|
|
||||||
|
|
@ -6645,18 +6645,24 @@ bool isValidString(std::wstring wstr, uint32 strictMask, bool numericOrSpace, bo
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ObjectMgr::IsValidName( const std::string& name, bool create )
|
uint8 ObjectMgr::CheckPlayerName( const std::string& name, bool create )
|
||||||
{
|
{
|
||||||
std::wstring wname;
|
std::wstring wname;
|
||||||
if(!Utf8toWStr(name,wname))
|
if(!Utf8toWStr(name,wname))
|
||||||
return false;
|
return CHAR_NAME_INVALID_CHARACTER;
|
||||||
|
|
||||||
if(wname.size() < 1 || wname.size() > MAX_PLAYER_NAME)
|
if(wname.size() > MAX_PLAYER_NAME)
|
||||||
return false;
|
return CHAR_NAME_TOO_LONG;
|
||||||
|
|
||||||
|
uint32 minName = sWorld.getConfig(CONFIG_MIN_PLAYER_NAME);
|
||||||
|
if(wname.size() < minName)
|
||||||
|
return CHAR_NAME_TOO_SHORT;
|
||||||
|
|
||||||
uint32 strictMask = sWorld.getConfig(CONFIG_STRICT_PLAYER_NAMES);
|
uint32 strictMask = sWorld.getConfig(CONFIG_STRICT_PLAYER_NAMES);
|
||||||
|
if(!isValidString(wname,strictMask,false,create))
|
||||||
|
return CHAR_NAME_MIXED_LANGUAGES;
|
||||||
|
|
||||||
return isValidString(wname,strictMask,false,create);
|
return CHAR_NAME_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ObjectMgr::IsValidCharterName( const std::string& name )
|
bool ObjectMgr::IsValidCharterName( const std::string& name )
|
||||||
|
|
@ -6665,7 +6671,11 @@ bool ObjectMgr::IsValidCharterName( const std::string& name )
|
||||||
if(!Utf8toWStr(name,wname))
|
if(!Utf8toWStr(name,wname))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if(wname.size() < 1)
|
if(wname.size() > MAX_CHARTER_NAME)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
uint32 minName = sWorld.getConfig(CONFIG_MIN_CHARTER_NAME);
|
||||||
|
if(wname.size() < minName)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
uint32 strictMask = sWorld.getConfig(CONFIG_STRICT_CHARTER_NAMES);
|
uint32 strictMask = sWorld.getConfig(CONFIG_STRICT_CHARTER_NAMES);
|
||||||
|
|
@ -6673,18 +6683,24 @@ bool ObjectMgr::IsValidCharterName( const std::string& name )
|
||||||
return isValidString(wname,strictMask,true);
|
return isValidString(wname,strictMask,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ObjectMgr::IsValidPetName( const std::string& name )
|
PetNameInvalidReason ObjectMgr::CheckPetName( const std::string& name )
|
||||||
{
|
{
|
||||||
std::wstring wname;
|
std::wstring wname;
|
||||||
if(!Utf8toWStr(name,wname))
|
if(!Utf8toWStr(name,wname))
|
||||||
return false;
|
return PET_NAME_INVALID;
|
||||||
|
|
||||||
if(wname.size() < 1)
|
if(wname.size() > MAX_PET_NAME)
|
||||||
return false;
|
return PET_NAME_TOO_LONG;
|
||||||
|
|
||||||
|
uint32 minName = sWorld.getConfig(CONFIG_MIN_PET_NAME);
|
||||||
|
if(wname.size() < minName)
|
||||||
|
return PET_NAME_TOO_SHORT;
|
||||||
|
|
||||||
uint32 strictMask = sWorld.getConfig(CONFIG_STRICT_PET_NAMES);
|
uint32 strictMask = sWorld.getConfig(CONFIG_STRICT_PET_NAMES);
|
||||||
|
if(!isValidString(wname,strictMask,false))
|
||||||
|
return PET_NAME_MIXED_LANGUAGES;
|
||||||
|
|
||||||
return isValidString(wname,strictMask,false);
|
return PET_NAME_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ObjectMgr::GetIndexForLocale( LocaleConstant loc )
|
int ObjectMgr::GetIndexForLocale( LocaleConstant loc )
|
||||||
|
|
|
||||||
|
|
@ -281,6 +281,8 @@ SkillRangeType GetSkillRangeType(SkillLineEntry const *pSkill, bool racial);
|
||||||
|
|
||||||
#define MAX_PLAYER_NAME 12 // max allowed by client name length
|
#define MAX_PLAYER_NAME 12 // max allowed by client name length
|
||||||
#define MAX_INTERNAL_PLAYER_NAME 15 // max server internal player name length ( > MAX_PLAYER_NAME for support declined names )
|
#define MAX_INTERNAL_PLAYER_NAME 15 // max server internal player name length ( > MAX_PLAYER_NAME for support declined names )
|
||||||
|
#define MAX_PET_NAME 12 // max allowed by client name length
|
||||||
|
#define MAX_CHARTER_NAME 24 // max allowed by client name length
|
||||||
|
|
||||||
bool normalizePlayerName(std::string& name);
|
bool normalizePlayerName(std::string& name);
|
||||||
|
|
||||||
|
|
@ -693,9 +695,9 @@ class ObjectMgr
|
||||||
bool IsReservedName(const std::string& name) const;
|
bool IsReservedName(const std::string& name) const;
|
||||||
|
|
||||||
// name with valid structure and symbols
|
// name with valid structure and symbols
|
||||||
static bool IsValidName( const std::string& name, bool create = false );
|
static uint8 CheckPlayerName( const std::string& name, bool create = false );
|
||||||
|
static PetNameInvalidReason CheckPetName( const std::string& name );
|
||||||
static bool IsValidCharterName( const std::string& name );
|
static bool IsValidCharterName( const std::string& name );
|
||||||
static bool IsValidPetName( const std::string& name );
|
|
||||||
|
|
||||||
static bool CheckDeclinedNames(std::wstring mainpart, DeclinedName const& names);
|
static bool CheckDeclinedNames(std::wstring mainpart, DeclinedName const& names);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -91,6 +91,9 @@ enum PetTalk
|
||||||
|
|
||||||
enum PetNameInvalidReason
|
enum PetNameInvalidReason
|
||||||
{
|
{
|
||||||
|
// custom, not send
|
||||||
|
PET_NAME_SUCCESS = 0,
|
||||||
|
|
||||||
PET_NAME_INVALID = 1,
|
PET_NAME_INVALID = 1,
|
||||||
PET_NAME_NO_NAME = 2,
|
PET_NAME_NO_NAME = 2,
|
||||||
PET_NAME_TOO_SHORT = 3,
|
PET_NAME_TOO_SHORT = 3,
|
||||||
|
|
|
||||||
|
|
@ -401,9 +401,10 @@ void WorldSession::HandlePetRename( WorldPacket & recv_data )
|
||||||
pet->GetOwnerGUID() != _player->GetGUID() || !pet->GetCharmInfo() )
|
pet->GetOwnerGUID() != _player->GetGUID() || !pet->GetCharmInfo() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(!ObjectMgr::IsValidPetName(name))
|
PetNameInvalidReason res = ObjectMgr::CheckPetName(name);
|
||||||
|
if(res != PET_NAME_SUCCESS)
|
||||||
{
|
{
|
||||||
SendPetNameInvalid(PET_NAME_INVALID, name, NULL);
|
SendPetNameInvalid(res, name, NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14043,7 +14043,8 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
|
||||||
m_name = fields[3].GetCppString();
|
m_name = fields[3].GetCppString();
|
||||||
|
|
||||||
// check name limitations
|
// check name limitations
|
||||||
if(!ObjectMgr::IsValidName(m_name) || (GetSession()->GetSecurity() == SEC_PLAYER && objmgr.IsReservedName(m_name)))
|
if (ObjectMgr::CheckPlayerName(m_name) != CHAR_NAME_SUCCESS ||
|
||||||
|
GetSession()->GetSecurity() == SEC_PLAYER && objmgr.IsReservedName(m_name))
|
||||||
{
|
{
|
||||||
delete result;
|
delete result;
|
||||||
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u' WHERE guid ='%u'", uint32(AT_LOGIN_RENAME),guid);
|
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u' WHERE guid ='%u'", uint32(AT_LOGIN_RENAME),guid);
|
||||||
|
|
|
||||||
|
|
@ -393,7 +393,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
|
||||||
{
|
{
|
||||||
QueryResult *result = CharacterDatabase.PQuery("SELECT COUNT(guid) FROM characters WHERE account = '%d'", account);
|
QueryResult *result = CharacterDatabase.PQuery("SELECT COUNT(guid) FROM characters WHERE account = '%d'", account);
|
||||||
uint8 charcount = 0;
|
uint8 charcount = 0;
|
||||||
if ( result )
|
if (result)
|
||||||
{
|
{
|
||||||
Field *fields=result->Fetch();
|
Field *fields=result->Fetch();
|
||||||
charcount = fields[0].GetUInt8();
|
charcount = fields[0].GetUInt8();
|
||||||
|
|
@ -405,7 +405,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
|
||||||
}
|
}
|
||||||
|
|
||||||
FILE *fin = fopen(file.c_str(), "r");
|
FILE *fin = fopen(file.c_str(), "r");
|
||||||
if(!fin)
|
if (!fin)
|
||||||
return DUMP_FILE_OPEN_ERROR;
|
return DUMP_FILE_OPEN_ERROR;
|
||||||
|
|
||||||
QueryResult * result = NULL;
|
QueryResult * result = NULL;
|
||||||
|
|
@ -413,7 +413,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
|
||||||
|
|
||||||
// make sure the same guid doesn't already exist and is safe to use
|
// make sure the same guid doesn't already exist and is safe to use
|
||||||
bool incHighest = true;
|
bool incHighest = true;
|
||||||
if(guid != 0 && guid < objmgr.m_hiCharGuid)
|
if (guid != 0 && guid < objmgr.m_hiCharGuid)
|
||||||
{
|
{
|
||||||
result = CharacterDatabase.PQuery("SELECT * FROM characters WHERE guid = '%d'", guid);
|
result = CharacterDatabase.PQuery("SELECT * FROM characters WHERE guid = '%d'", guid);
|
||||||
if (result)
|
if (result)
|
||||||
|
|
@ -427,10 +427,10 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
|
||||||
guid = objmgr.m_hiCharGuid;
|
guid = objmgr.m_hiCharGuid;
|
||||||
|
|
||||||
// normalize the name if specified and check if it exists
|
// normalize the name if specified and check if it exists
|
||||||
if(!normalizePlayerName(name))
|
if (!normalizePlayerName(name))
|
||||||
name = "";
|
name = "";
|
||||||
|
|
||||||
if(ObjectMgr::IsValidName(name,true))
|
if (ObjectMgr::CheckPlayerName(name,true) == CHAR_NAME_SUCCESS)
|
||||||
{
|
{
|
||||||
CharacterDatabase.escape_string(name); // for safe, we use name only for sql quearies anyway
|
CharacterDatabase.escape_string(name); // for safe, we use name only for sql quearies anyway
|
||||||
result = CharacterDatabase.PQuery("SELECT * FROM characters WHERE name = '%s'", name.c_str());
|
result = CharacterDatabase.PQuery("SELECT * FROM characters WHERE name = '%s'", name.c_str());
|
||||||
|
|
@ -440,7 +440,8 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
|
||||||
delete result;
|
delete result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else name = "";
|
else
|
||||||
|
name = "";
|
||||||
|
|
||||||
// name encoded or empty
|
// name encoded or empty
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -624,6 +624,27 @@ void World::LoadConfigSettings(bool reload)
|
||||||
m_configs[CONFIG_STRICT_CHARTER_NAMES] = sConfig.GetIntDefault ("StrictCharterNames", 0);
|
m_configs[CONFIG_STRICT_CHARTER_NAMES] = sConfig.GetIntDefault ("StrictCharterNames", 0);
|
||||||
m_configs[CONFIG_STRICT_PET_NAMES] = sConfig.GetIntDefault ("StrictPetNames", 0);
|
m_configs[CONFIG_STRICT_PET_NAMES] = sConfig.GetIntDefault ("StrictPetNames", 0);
|
||||||
|
|
||||||
|
m_configs[CONFIG_MIN_PLAYER_NAME] = sConfig.GetIntDefault ("MinPlayerName", 2);
|
||||||
|
if(m_configs[CONFIG_MIN_PLAYER_NAME] < 1 || m_configs[CONFIG_MIN_PLAYER_NAME] > MAX_PLAYER_NAME)
|
||||||
|
{
|
||||||
|
sLog.outError("MinPlayerName (%i) must be in range 1..%u. Set to 2.",m_configs[CONFIG_MIN_PLAYER_NAME],MAX_PLAYER_NAME);
|
||||||
|
m_configs[CONFIG_MIN_PLAYER_NAME] = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_configs[CONFIG_MIN_CHARTER_NAME] = sConfig.GetIntDefault ("MinCharterName", 2);
|
||||||
|
if(m_configs[CONFIG_MIN_CHARTER_NAME] < 1 || m_configs[CONFIG_MIN_CHARTER_NAME] > MAX_CHARTER_NAME)
|
||||||
|
{
|
||||||
|
sLog.outError("MinCharterName (%i) must be in range 1..%u. Set to 2.",m_configs[CONFIG_MIN_CHARTER_NAME],MAX_CHARTER_NAME);
|
||||||
|
m_configs[CONFIG_MIN_CHARTER_NAME] = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_configs[CONFIG_MIN_PET_NAME] = sConfig.GetIntDefault ("MinPetName", 2);
|
||||||
|
if(m_configs[CONFIG_MIN_PET_NAME] < 1 || m_configs[CONFIG_MIN_PET_NAME] > MAX_PET_NAME)
|
||||||
|
{
|
||||||
|
sLog.outError("MinPetName (%i) must be in range 1..%u. Set to 2.",m_configs[CONFIG_MIN_PET_NAME],MAX_PET_NAME);
|
||||||
|
m_configs[CONFIG_MIN_PET_NAME] = 2;
|
||||||
|
}
|
||||||
|
|
||||||
m_configs[CONFIG_CHARACTERS_CREATING_DISABLED] = sConfig.GetIntDefault ("CharactersCreatingDisabled", 0);
|
m_configs[CONFIG_CHARACTERS_CREATING_DISABLED] = sConfig.GetIntDefault ("CharactersCreatingDisabled", 0);
|
||||||
|
|
||||||
m_configs[CONFIG_CHARACTERS_PER_REALM] = sConfig.GetIntDefault("CharactersPerRealm", 10);
|
m_configs[CONFIG_CHARACTERS_PER_REALM] = sConfig.GetIntDefault("CharactersPerRealm", 10);
|
||||||
|
|
|
||||||
|
|
@ -107,6 +107,9 @@ enum WorldConfigs
|
||||||
CONFIG_STRICT_PLAYER_NAMES,
|
CONFIG_STRICT_PLAYER_NAMES,
|
||||||
CONFIG_STRICT_CHARTER_NAMES,
|
CONFIG_STRICT_CHARTER_NAMES,
|
||||||
CONFIG_STRICT_PET_NAMES,
|
CONFIG_STRICT_PET_NAMES,
|
||||||
|
CONFIG_MIN_PLAYER_NAME,
|
||||||
|
CONFIG_MIN_CHARTER_NAME,
|
||||||
|
CONFIG_MIN_PET_NAME,
|
||||||
CONFIG_CHARACTERS_CREATING_DISABLED,
|
CONFIG_CHARACTERS_CREATING_DISABLED,
|
||||||
CONFIG_CHARACTERS_PER_ACCOUNT,
|
CONFIG_CHARACTERS_PER_ACCOUNT,
|
||||||
CONFIG_CHARACTERS_PER_REALM,
|
CONFIG_CHARACTERS_PER_REALM,
|
||||||
|
|
|
||||||
|
|
@ -396,6 +396,18 @@ LogColors = ""
|
||||||
# (included in client by default, with active official localization or custom localization fonts in clientdir/Fonts).
|
# (included in client by default, with active official localization or custom localization fonts in clientdir/Fonts).
|
||||||
# 3 basic latin characters + server timezone specific
|
# 3 basic latin characters + server timezone specific
|
||||||
#
|
#
|
||||||
|
# MinPlayerName
|
||||||
|
# Minimal name length (1..12)
|
||||||
|
# Default: 2
|
||||||
|
#
|
||||||
|
# MinCharterName
|
||||||
|
# Minimal name length (1..24)
|
||||||
|
# Default: 2
|
||||||
|
#
|
||||||
|
# MinPetName
|
||||||
|
# Minimal name length (1..12)
|
||||||
|
# Default: 2
|
||||||
|
#
|
||||||
# CharactersCreatingDisabled
|
# CharactersCreatingDisabled
|
||||||
# Disable characters creating for specific team or any (non-player accounts not affected)
|
# Disable characters creating for specific team or any (non-player accounts not affected)
|
||||||
# Default: 0 - enabled
|
# Default: 0 - enabled
|
||||||
|
|
@ -579,6 +591,9 @@ DeclinedNames = 0
|
||||||
StrictPlayerNames = 0
|
StrictPlayerNames = 0
|
||||||
StrictCharterNames = 0
|
StrictCharterNames = 0
|
||||||
StrictPetNames = 0
|
StrictPetNames = 0
|
||||||
|
MinPlayerName = 2
|
||||||
|
MinCharterName = 2
|
||||||
|
MinPetName = 2
|
||||||
CharactersCreatingDisabled = 0
|
CharactersCreatingDisabled = 0
|
||||||
CharactersPerAccount = 50
|
CharactersPerAccount = 50
|
||||||
CharactersPerRealm = 10
|
CharactersPerRealm = 10
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8125"
|
#define REVISION_NR "8126"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue