From 6976043e228b35687125e66f19933c44ebc561ba Mon Sep 17 00:00:00 2001 From: megamage Date: Fri, 10 Jul 2009 08:25:33 +0800 Subject: [8126] Improvemets in player/pet/charter name checks. Author: VladimirMangos * 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) --HG-- branch : trunk --- src/game/ObjectMgr.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/game/ObjectMgr.h') diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h index 037ba4a78f2..4c83e584421 100644 --- a/src/game/ObjectMgr.h +++ b/src/game/ObjectMgr.h @@ -312,8 +312,10 @@ struct GM_Ticket typedef std::list GmTicketList; 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_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); @@ -759,9 +761,9 @@ class ObjectMgr bool IsReservedName(const std::string& name) const; // 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 IsValidPetName( const std::string& name ); static bool CheckDeclinedNames(std::wstring mainpart, DeclinedName const& names); -- cgit v1.2.3