refactor(Core/ObjectMgr): Handle Profanity & Reserved Names in load (#19259)

* refactor(Core/ObjectMgr): Handle Profanity & Reserved Names in load

* closes https://github.com/azerothcore/azerothcore-wotlk/issues/18556

* Update ObjectMgr.cpp

* Update ObjectMgr.cpp

* I swear I am not drunk

* We already check all of these

* fix build

* Forgot we dont send the responsecode in senderrormessage

* last commit I swear
This commit is contained in:
Kitzunu
2024-07-03 00:23:32 +02:00
committed by GitHub
parent f96d4c8670
commit 0a8175ef03
11 changed files with 117 additions and 166 deletions
+5 -5
View File
@@ -691,8 +691,6 @@ SkillRangeType GetSkillRangeType(SkillRaceClassInfoEntry const* rcEntry);
#define MAX_CHARTER_NAME 24 // max allowed by client name length
#define MAX_CHANNEL_NAME 50 // pussywizard
bool ReservedNames(std::wstring& name);
bool ProfanityNames(std::wstring& name);
bool normalizePlayerName(std::string& name);
struct LanguageDesc
@@ -1334,12 +1332,14 @@ public:
uint32 AddCreData(uint32 entry, uint32 map, float x, float y, float z, float o, uint32 spawntimedelay = 0);
// reserved names
void LoadReservedPlayersNames();
void LoadReservedPlayerNamesDB();
void LoadReservedPlayerNamesDBC();
[[nodiscard]] bool IsReservedName(std::string_view name) const;
void AddReservedPlayerName(std::string const& name);
// profanity names
void LoadProfanityPlayersNames();
void LoadProfanityNamesFromDB();
void LoadProfanityNamesFromDBC();
[[nodiscard]] bool IsProfanityName(std::string_view name) const;
void AddProfanityPlayerName(std::string const& name);
@@ -1508,7 +1508,7 @@ private:
//character profanity names
typedef std::set<std::wstring> ProfanityNamesContainer;
ReservedNamesContainer _profanityNamesStore;
ProfanityNamesContainer _profanityNamesStore;
GameTeleContainer _gameTeleStore;