AzeorthCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
ObjectMgr.cpp File Reference
#include "ObjectMgr.h"
#include "AccountMgr.h"
#include "AchievementMgr.h"
#include "ArenaTeamMgr.h"
#include "CharacterCache.h"
#include "Chat.h"
#include "Common.h"
#include "CreatureAIFactory.h"
#include "Config.h"
#include "Containers.h"
#include "DatabaseEnv.h"
#include "DisableMgr.h"
#include "GameObjectAIFactory.h"
#include "GameEventMgr.h"
#include "GameTime.h"
#include "GossipDef.h"
#include "GroupMgr.h"
#include "GuildMgr.h"
#include "LFGMgr.h"
#include "Language.h"
#include "Log.h"
#include "MapMgr.h"
#include "Pet.h"
#include "PoolMgr.h"
#include "ReputationMgr.h"
#include "ScriptMgr.h"
#include "Spell.h"
#include "SpellAuras.h"
#include "SpellMgr.h"
#include "SpellScript.h"
#include "Transport.h"
#include "Unit.h"
#include "UpdateMask.h"
#include "Util.h"
#include "Vehicle.h"
#include "World.h"
#include "StringConvert.h"
#include "Tokenize.h"

Go to the source code of this file.

Enumerations

enum  LanguageType {
  LT_BASIC_LATIN = 0x0000 ,
  LT_EXTENDEN_LATIN = 0x0001 ,
  LT_CYRILLIC = 0x0002 ,
  LT_EAST_ASIA = 0x0004 ,
  LT_ANY = 0xFFFF
}
 

Functions

std::string GetScriptsTableNameByType (ScriptsType type)
 
ScriptMapMapGetScriptsMapByType (ScriptsType type)
 
std::string GetScriptCommandName (ScriptCommands command)
 
bool normalizePlayerName (std::string &name)
 
LanguageDesc const * GetLanguageDescByID (uint32 lang)
 
void CheckGOLockId (GameObjectTemplate const *goInfo, uint32 dataN, uint32 N)
 
void CheckGOLinkedTrapId (GameObjectTemplate const *goInfo, uint32 dataN, uint32 N)
 
void CheckGOSpellId (GameObjectTemplate const *goInfo, uint32 dataN, uint32 N)
 
void CheckAndFixGOChairHeightId (GameObjectTemplate const *goInfo, uint32 const &dataN, uint32 N)
 
void CheckGONoDamageImmuneId (GameObjectTemplate *goTemplate, uint32 dataN, uint32 N)
 
void CheckGOConsumable (GameObjectTemplate const *goInfo, uint32 dataN, uint32 N)
 
static LanguageType GetRealmLanguageType (bool create)
 
bool isValidString (std::wstring wstr, uint32 strictMask, bool numericOrSpace, bool create=false)
 
SkillRangeType GetSkillRangeType (SkillRaceClassInfoEntry const *rcEntry)
 

Variables

ScriptMapMap sSpellScripts
 
ScriptMapMap sEventScripts
 
ScriptMapMap sWaypointScripts
 
LanguageDesc lang_description [LANGUAGES_COUNT]
 

Enumeration Type Documentation

◆ LanguageType

Enumerator
LT_BASIC_LATIN 
LT_EXTENDEN_LATIN 
LT_CYRILLIC 
LT_EAST_ASIA 
LT_ANY 
8096{
8097 LT_BASIC_LATIN = 0x0000,
8098 LT_EXTENDEN_LATIN = 0x0001,
8099 LT_CYRILLIC = 0x0002,
8100 LT_EAST_ASIA = 0x0004,
8101 LT_ANY = 0xFFFF
8102};
@ LT_ANY
Definition: ObjectMgr.cpp:8101
@ LT_EXTENDEN_LATIN
Definition: ObjectMgr.cpp:8098
@ LT_EAST_ASIA
Definition: ObjectMgr.cpp:8100
@ LT_BASIC_LATIN
Definition: ObjectMgr.cpp:8097
@ LT_CYRILLIC
Definition: ObjectMgr.cpp:8099

Function Documentation

◆ CheckAndFixGOChairHeightId()

void CheckAndFixGOChairHeightId ( GameObjectTemplate const *  goInfo,
uint32 const &  dataN,
uint32  N 
)
inline
7026{
7028 return;
7029
7030 LOG_ERROR("sql.sql", "Gameobject (Entry: {} GoType: {}) have data{}={} but correct chair height in range 0..{}.",
7031 goInfo->entry, goInfo->type, N, dataN, UNIT_STAND_STATE_SIT_HIGH_CHAIR - UNIT_STAND_STATE_SIT_LOW_CHAIR);
7032
7033 // prevent client and server unexpected work
7034 const_cast<uint32&>(dataN) = 0;
7035}
std::uint32_t uint32
Definition: Define.h:108
#define LOG_ERROR(filterType__,...)
Definition: Log.h:159
@ UNIT_STAND_STATE_SIT_HIGH_CHAIR
Definition: Unit.h:59
@ UNIT_STAND_STATE_SIT_LOW_CHAIR
Definition: Unit.h:57

References GameObjectTemplate::entry, LOG_ERROR, GameObjectTemplate::type, UNIT_STAND_STATE_SIT_HIGH_CHAIR, and UNIT_STAND_STATE_SIT_LOW_CHAIR.

Referenced by ObjectMgr::LoadGameObjectTemplate().

◆ CheckGOConsumable()

void CheckGOConsumable ( GameObjectTemplate const *  goInfo,
uint32  dataN,
uint32  N 
)
inline
7047{
7048 // 0/1 correct values
7049 if (dataN <= 1)
7050 return;
7051
7052 LOG_ERROR("sql.sql", "Gameobject (Entry: {} GoType: {}) have data{}={} but expected boolean (0/1) consumable field value.",
7053 goInfo->entry, goInfo->type, N, dataN);
7054}

References GameObjectTemplate::entry, LOG_ERROR, and GameObjectTemplate::type.

Referenced by ObjectMgr::LoadGameObjectTemplate().

◆ CheckGOLinkedTrapId()

void CheckGOLinkedTrapId ( GameObjectTemplate const *  goInfo,
uint32  dataN,
uint32  N 
)
inline
7007{
7008 if (GameObjectTemplate const* trapInfo = sObjectMgr->GetGameObjectTemplate(dataN))
7009 {
7010 if (trapInfo->type != GAMEOBJECT_TYPE_TRAP)
7011 LOG_ERROR("sql.sql", "Gameobject (Entry: {} GoType: {}) have data{}={} but GO (Entry {}) have not GAMEOBJECT_TYPE_TRAP ({}) type.",
7012 goInfo->entry, goInfo->type, N, dataN, dataN, GAMEOBJECT_TYPE_TRAP);
7013 }
7014}
#define sObjectMgr
Definition: ObjectMgr.h:1612
@ GAMEOBJECT_TYPE_TRAP
Definition: SharedDefines.h:1538
Definition: GameObject.h:41

References GameObjectTemplate::entry, GAMEOBJECT_TYPE_TRAP, LOG_ERROR, sObjectMgr, and GameObjectTemplate::type.

Referenced by ObjectMgr::LoadGameObjectTemplate().

◆ CheckGOLockId()

void CheckGOLockId ( GameObjectTemplate const *  goInfo,
uint32  dataN,
uint32  N 
)
inline
6998{
6999 if (sLockStore.LookupEntry(dataN))
7000 return;
7001
7002 LOG_ERROR("sql.sql", "Gameobject (Entry: {} GoType: {}) have data{}={} but lock (Id: {}) not found.",
7003 goInfo->entry, goInfo->type, N, goInfo->door.lockId, goInfo->door.lockId);
7004}
DBCStorage< LockEntry > sLockStore(LockEntryfmt)

References GameObjectTemplate::door, GameObjectTemplate::entry, GameObjectTemplate::lockId, LOG_ERROR, sLockStore, and GameObjectTemplate::type.

Referenced by ObjectMgr::LoadGameObjectTemplate().

◆ CheckGONoDamageImmuneId()

void CheckGONoDamageImmuneId ( GameObjectTemplate goTemplate,
uint32  dataN,
uint32  N 
)
inline
7038{
7039 // 0/1 correct values
7040 if (dataN <= 1)
7041 return;
7042
7043 LOG_ERROR("sql.sql", "Gameobject (Entry: {} GoType: {}) have data{}={} but expected boolean (0/1) noDamageImmune field value.", goTemplate->entry, goTemplate->type, N, dataN);
7044}
uint32 type
Definition: GameObject.h:43
uint32 entry
Definition: GameObject.h:42

References GameObjectTemplate::entry, LOG_ERROR, and GameObjectTemplate::type.

Referenced by ObjectMgr::LoadGameObjectTemplate().

◆ CheckGOSpellId()

void CheckGOSpellId ( GameObjectTemplate const *  goInfo,
uint32  dataN,
uint32  N 
)
inline
7017{
7018 if (sSpellMgr->GetSpellInfo(dataN))
7019 return;
7020
7021 LOG_ERROR("sql.sql", "Gameobject (Entry: {} GoType: {}) have data{}={} but Spell (Entry {}) not exist.",
7022 goInfo->entry, goInfo->type, N, dataN, dataN);
7023}
#define sSpellMgr
Definition: SpellMgr.h:803

References GameObjectTemplate::entry, LOG_ERROR, sSpellMgr, and GameObjectTemplate::type.

Referenced by ObjectMgr::LoadGameObjectTemplate().

◆ GetLanguageDescByID()

LanguageDesc const * GetLanguageDescByID ( uint32  lang)
252{
253 for (uint8 i = 0; i < LANGUAGES_COUNT; ++i)
254 {
255 if (uint32(lang_description[i].lang_id) == lang)
256 return &lang_description[i];
257 }
258
259 return nullptr;
260}
std::uint8_t uint8
Definition: Define.h:110
LanguageDesc lang_description[LANGUAGES_COUNT]
Definition: ObjectMgr.cpp:228
#define LANGUAGES_COUNT
Definition: SharedDefines.h:728

References lang_description, and LANGUAGES_COUNT.

Referenced by WorldSession::HandleMessagechatOpcode(), ObjectMgr::LoadBroadcastTexts(), and CreatureTextMgr::LoadCreatureTexts().

◆ GetRealmLanguageType()

static LanguageType GetRealmLanguageType ( bool  create)
static
8105{
8106 switch (sWorld->getIntConfig(CONFIG_REALM_ZONE))
8107 {
8108 case REALM_ZONE_UNKNOWN: // any language
8112 return LT_ANY;
8113 case REALM_ZONE_UNITED_STATES: // extended-Latin
8114 case REALM_ZONE_OCEANIC:
8116 case REALM_ZONE_ENGLISH:
8117 case REALM_ZONE_GERMAN:
8118 case REALM_ZONE_FRENCH:
8119 case REALM_ZONE_SPANISH:
8120 return LT_EXTENDEN_LATIN;
8121 case REALM_ZONE_KOREA: // East-Asian
8122 case REALM_ZONE_TAIWAN:
8123 case REALM_ZONE_CHINA:
8124 return LT_EAST_ASIA;
8125 case REALM_ZONE_RUSSIAN: // Cyrillic
8126 return LT_CYRILLIC;
8127 default:
8128 return create ? LT_BASIC_LATIN : LT_ANY; // basic-Latin at create, any at login
8129 }
8130}
@ CONFIG_REALM_ZONE
Definition: IWorld.h:224
#define sWorld
Definition: World.h:458
@ REALM_ZONE_TEST_SERVER
Definition: World.h:118
@ REALM_ZONE_LATIN_AMERICA
Definition: World.h:96
@ REALM_ZONE_SPANISH
Definition: World.h:103
@ REALM_ZONE_OCEANIC
Definition: World.h:95
@ REALM_ZONE_KOREA
Definition: World.h:98
@ REALM_ZONE_UNKNOWN
Definition: World.h:92
@ REALM_ZONE_UNITED_STATES
Definition: World.h:94
@ REALM_ZONE_ENGLISH
Definition: World.h:100
@ REALM_ZONE_FRENCH
Definition: World.h:102
@ REALM_ZONE_QA_SERVER
Definition: World.h:120
@ REALM_ZONE_CHINA
Definition: World.h:108
@ REALM_ZONE_RUSSIAN
Definition: World.h:104
@ REALM_ZONE_DEVELOPMENT
Definition: World.h:93
@ REALM_ZONE_TAIWAN
Definition: World.h:106
@ REALM_ZONE_GERMAN
Definition: World.h:101

References CONFIG_REALM_ZONE, LT_ANY, LT_BASIC_LATIN, LT_CYRILLIC, LT_EAST_ASIA, LT_EXTENDEN_LATIN, REALM_ZONE_CHINA, REALM_ZONE_DEVELOPMENT, REALM_ZONE_ENGLISH, REALM_ZONE_FRENCH, REALM_ZONE_GERMAN, REALM_ZONE_KOREA, REALM_ZONE_LATIN_AMERICA, REALM_ZONE_OCEANIC, REALM_ZONE_QA_SERVER, REALM_ZONE_RUSSIAN, REALM_ZONE_SPANISH, REALM_ZONE_TAIWAN, REALM_ZONE_TEST_SERVER, REALM_ZONE_UNITED_STATES, REALM_ZONE_UNKNOWN, and sWorld.

Referenced by isValidString().

◆ GetScriptCommandName()

std::string GetScriptCommandName ( ScriptCommands  command)
102{
103 std::string res = "";
104 switch (command)
105 {
107 res = "SCRIPT_COMMAND_TALK";
108 break;
110 res = "SCRIPT_COMMAND_EMOTE";
111 break;
113 res = "SCRIPT_COMMAND_FIELD_SET";
114 break;
116 res = "SCRIPT_COMMAND_MOVE_TO";
117 break;
119 res = "SCRIPT_COMMAND_FLAG_SET";
120 break;
122 res = "SCRIPT_COMMAND_FLAG_REMOVE";
123 break;
125 res = "SCRIPT_COMMAND_TELEPORT_TO";
126 break;
128 res = "SCRIPT_COMMAND_QUEST_EXPLORED";
129 break;
131 res = "SCRIPT_COMMAND_KILL_CREDIT";
132 break;
134 res = "SCRIPT_COMMAND_RESPAWN_GAMEOBJECT";
135 break;
137 res = "SCRIPT_COMMAND_TEMP_SUMMON_CREATURE";
138 break;
140 res = "SCRIPT_COMMAND_OPEN_DOOR";
141 break;
143 res = "SCRIPT_COMMAND_CLOSE_DOOR";
144 break;
146 res = "SCRIPT_COMMAND_ACTIVATE_OBJECT";
147 break;
149 res = "SCRIPT_COMMAND_REMOVE_AURA";
150 break;
152 res = "SCRIPT_COMMAND_CAST_SPELL";
153 break;
155 res = "SCRIPT_COMMAND_PLAY_SOUND";
156 break;
158 res = "SCRIPT_COMMAND_CREATE_ITEM";
159 break;
161 res = "SCRIPT_COMMAND_DESPAWN_SELF";
162 break;
164 res = "SCRIPT_COMMAND_LOAD_PATH";
165 break;
167 res = "SCRIPT_COMMAND_CALLSCRIPT_TO_UNIT";
168 break;
170 res = "SCRIPT_COMMAND_KILL";
171 break;
172 // AzerothCore only
174 res = "SCRIPT_COMMAND_ORIENTATION";
175 break;
177 res = "SCRIPT_COMMAND_EQUIP";
178 break;
180 res = "SCRIPT_COMMAND_MODEL";
181 break;
183 res = "SCRIPT_COMMAND_CLOSE_GOSSIP";
184 break;
186 res = "SCRIPT_COMMAND_PLAYMOVIE";
187 break;
188 default:
189 {
190 char sz[32];
191 sprintf(sz, "Unknown command: %d", command);
192 res = sz;
193 break;
194 }
195 }
196 return res;
197}
@ SCRIPT_COMMAND_EMOTE
Definition: ObjectMgr.h:96
@ SCRIPT_COMMAND_CREATE_ITEM
Definition: ObjectMgr.h:112
@ SCRIPT_COMMAND_DESPAWN_SELF
Definition: ObjectMgr.h:113
@ SCRIPT_COMMAND_CLOSE_DOOR
Definition: ObjectMgr.h:107
@ SCRIPT_COMMAND_CAST_SPELL
Definition: ObjectMgr.h:110
@ SCRIPT_COMMAND_RESPAWN_GAMEOBJECT
Definition: ObjectMgr.h:104
@ SCRIPT_COMMAND_QUEST_EXPLORED
Definition: ObjectMgr.h:102
@ SCRIPT_COMMAND_ACTIVATE_OBJECT
Definition: ObjectMgr.h:108
@ SCRIPT_COMMAND_TALK
Definition: ObjectMgr.h:95
@ SCRIPT_COMMAND_OPEN_DOOR
Definition: ObjectMgr.h:106
@ SCRIPT_COMMAND_EQUIP
Definition: ObjectMgr.h:121
@ SCRIPT_COMMAND_FIELD_SET
Definition: ObjectMgr.h:97
@ SCRIPT_COMMAND_PLAYMOVIE
Definition: ObjectMgr.h:124
@ SCRIPT_COMMAND_CALLSCRIPT_TO_UNIT
Definition: ObjectMgr.h:116
@ SCRIPT_COMMAND_TELEPORT_TO
Definition: ObjectMgr.h:101
@ SCRIPT_COMMAND_MOVE_TO
Definition: ObjectMgr.h:98
@ SCRIPT_COMMAND_FLAG_SET
Definition: ObjectMgr.h:99
@ SCRIPT_COMMAND_TEMP_SUMMON_CREATURE
Definition: ObjectMgr.h:105
@ SCRIPT_COMMAND_KILL_CREDIT
Definition: ObjectMgr.h:103
@ SCRIPT_COMMAND_KILL
Definition: ObjectMgr.h:117
@ SCRIPT_COMMAND_LOAD_PATH
Definition: ObjectMgr.h:115
@ SCRIPT_COMMAND_ORIENTATION
Definition: ObjectMgr.h:120
@ SCRIPT_COMMAND_PLAY_SOUND
Definition: ObjectMgr.h:111
@ SCRIPT_COMMAND_MODEL
Definition: ObjectMgr.h:122
@ SCRIPT_COMMAND_CLOSE_GOSSIP
Definition: ObjectMgr.h:123
@ SCRIPT_COMMAND_REMOVE_AURA
Definition: ObjectMgr.h:109
@ SCRIPT_COMMAND_FLAG_REMOVE
Definition: ObjectMgr.h:100

References SCRIPT_COMMAND_ACTIVATE_OBJECT, SCRIPT_COMMAND_CALLSCRIPT_TO_UNIT, SCRIPT_COMMAND_CAST_SPELL, SCRIPT_COMMAND_CLOSE_DOOR, SCRIPT_COMMAND_CLOSE_GOSSIP, SCRIPT_COMMAND_CREATE_ITEM, SCRIPT_COMMAND_DESPAWN_SELF, SCRIPT_COMMAND_EMOTE, SCRIPT_COMMAND_EQUIP, SCRIPT_COMMAND_FIELD_SET, SCRIPT_COMMAND_FLAG_REMOVE, SCRIPT_COMMAND_FLAG_SET, SCRIPT_COMMAND_KILL, SCRIPT_COMMAND_KILL_CREDIT, SCRIPT_COMMAND_LOAD_PATH, SCRIPT_COMMAND_MODEL, SCRIPT_COMMAND_MOVE_TO, SCRIPT_COMMAND_OPEN_DOOR, SCRIPT_COMMAND_ORIENTATION, SCRIPT_COMMAND_PLAY_SOUND, SCRIPT_COMMAND_PLAYMOVIE, SCRIPT_COMMAND_QUEST_EXPLORED, SCRIPT_COMMAND_REMOVE_AURA, SCRIPT_COMMAND_RESPAWN_GAMEOBJECT, SCRIPT_COMMAND_TALK, SCRIPT_COMMAND_TELEPORT_TO, and SCRIPT_COMMAND_TEMP_SUMMON_CREATURE.

Referenced by ScriptInfo::GetDebugInfo(), and ObjectMgr::LoadScripts().

◆ GetScriptsMapByType()

ScriptMapMap * GetScriptsMapByType ( ScriptsType  type)
82{
83 ScriptMapMap* res = nullptr;
84 switch (type)
85 {
86 case SCRIPTS_SPELL:
87 res = &sSpellScripts;
88 break;
89 case SCRIPTS_EVENT:
90 res = &sEventScripts;
91 break;
93 res = &sWaypointScripts;
94 break;
95 default:
96 break;
97 }
98 return res;
99}
ScriptMapMap sSpellScripts
Definition: ObjectMgr.cpp:57
ScriptMapMap sEventScripts
Definition: ObjectMgr.cpp:58
ScriptMapMap sWaypointScripts
Definition: ObjectMgr.cpp:59
std::map< uint32, ScriptMap > ScriptMapMap
Definition: ObjectMgr.h:387
@ SCRIPTS_WAYPOINT
Definition: ObjectMgr.h:153
@ SCRIPTS_EVENT
Definition: ObjectMgr.h:152
@ SCRIPTS_SPELL
Definition: ObjectMgr.h:151

References SCRIPTS_EVENT, SCRIPTS_SPELL, SCRIPTS_WAYPOINT, sEventScripts, sSpellScripts, and sWaypointScripts.

Referenced by ObjectMgr::LoadScripts(), and Map::ScriptsProcess().

◆ GetScriptsTableNameByType()

std::string GetScriptsTableNameByType ( ScriptsType  type)
62{
63 std::string res = "";
64 switch (type)
65 {
66 case SCRIPTS_SPELL:
67 res = "spell_scripts";
68 break;
69 case SCRIPTS_EVENT:
70 res = "event_scripts";
71 break;
73 res = "waypoint_scripts";
74 break;
75 default:
76 break;
77 }
78 return res;
79}

References SCRIPTS_EVENT, SCRIPTS_SPELL, and SCRIPTS_WAYPOINT.

Referenced by ScriptInfo::GetDebugInfo(), and ObjectMgr::LoadScripts().

◆ GetSkillRangeType()

SkillRangeType GetSkillRangeType ( SkillRaceClassInfoEntry const *  rcEntry)
8478{
8479 SkillLineEntry const* skill = sSkillLineStore.LookupEntry(rcEntry->SkillID);
8480 if (!skill)
8481 {
8482 return SKILL_RANGE_NONE;
8483 }
8484
8485 if (sSkillTiersStore.LookupEntry(rcEntry->SkillTierID))
8486 {
8487 return SKILL_RANGE_RANK;
8488 }
8489
8490 if (rcEntry->SkillID == SKILL_RUNEFORGING)
8491 {
8492 return SKILL_RANGE_MONO;
8493 }
8494
8495 switch (skill->categoryId)
8496 {
8498 return SKILL_RANGE_MONO;
8500 return SKILL_RANGE_LANGUAGE;
8501 }
8502
8503 return SKILL_RANGE_LEVEL;
8504}
DBCStorage< SkillTiersEntry > sSkillTiersStore(SkillTiersfmt)
DBCStorage< SkillLineEntry > sSkillLineStore(SkillLinefmt)
@ SKILL_RANGE_MONO
Definition: ObjectMgr.h:685
@ SKILL_RANGE_NONE
Definition: ObjectMgr.h:687
@ SKILL_RANGE_LANGUAGE
Definition: ObjectMgr.h:683
@ SKILL_RANGE_RANK
Definition: ObjectMgr.h:686
@ SKILL_RANGE_LEVEL
Definition: ObjectMgr.h:684
@ SKILL_CATEGORY_ARMOR
Definition: SharedDefines.h:3047
@ SKILL_CATEGORY_LANGUAGES
Definition: SharedDefines.h:3049
@ SKILL_RUNEFORGING
Definition: SharedDefines.h:2976
Definition: DBCStructure.h:1542
int32 categoryId
Definition: DBCStructure.h:1544

References SkillLineEntry::categoryId, SKILL_CATEGORY_ARMOR, SKILL_CATEGORY_LANGUAGES, SKILL_RANGE_LANGUAGE, SKILL_RANGE_LEVEL, SKILL_RANGE_MONO, SKILL_RANGE_NONE, SKILL_RANGE_RANK, SKILL_RUNEFORGING, SkillRaceClassInfoEntry::SkillID, SkillRaceClassInfoEntry::SkillTierID, sSkillLineStore, and sSkillTiersStore.

Referenced by Player::_LoadSkills(), Player::LearnDefaultSkill(), and Player::UpdateSkillsForLevel().

◆ isValidString()

bool isValidString ( std::wstring  wstr,
uint32  strictMask,
bool  numericOrSpace,
bool  create = false 
)
8133{
8134 if (strictMask == 0) // any language, ignore realm
8135 {
8136 if (isExtendedLatinString(wstr, numericOrSpace))
8137 return true;
8138 if (isCyrillicString(wstr, numericOrSpace))
8139 return true;
8140 if (isEastAsianString(wstr, numericOrSpace))
8141 return true;
8142 return false;
8143 }
8144
8145 if (strictMask & 0x2) // realm zone specific
8146 {
8148 if (lt & LT_EXTENDEN_LATIN)
8149 if (isExtendedLatinString(wstr, numericOrSpace))
8150 return true;
8151 if (lt & LT_CYRILLIC)
8152 if (isCyrillicString(wstr, numericOrSpace))
8153 return true;
8154 if (lt & LT_EAST_ASIA)
8155 if (isEastAsianString(wstr, numericOrSpace))
8156 return true;
8157 }
8158
8159 if (strictMask & 0x1) // basic Latin
8160 {
8161 if (isBasicLatinString(wstr, numericOrSpace))
8162 return true;
8163 }
8164
8165 return false;
8166}
bool isCyrillicString(std::wstring_view wstr, bool numericOrSpace)
Definition: Util.h:250
bool isBasicLatinString(std::wstring_view wstr, bool numericOrSpace)
Definition: Util.h:230
bool isEastAsianString(std::wstring_view wstr, bool numericOrSpace)
Definition: Util.h:260
bool isExtendedLatinString(std::wstring_view wstr, bool numericOrSpace)
Definition: Util.h:240
static LanguageType GetRealmLanguageType(bool create)
Definition: ObjectMgr.cpp:8104
LanguageType
Definition: ObjectMgr.cpp:8096

References GetRealmLanguageType(), isBasicLatinString(), isCyrillicString(), isEastAsianString(), isExtendedLatinString(), LT_CYRILLIC, LT_EAST_ASIA, and LT_EXTENDEN_LATIN.

Referenced by ObjectMgr::CheckPetName(), ObjectMgr::CheckPlayerName(), ObjectMgr::IsValidChannelName(), and ObjectMgr::IsValidCharterName().

◆ normalizePlayerName()

bool normalizePlayerName ( std::string &  name)
207{
208 if (name.empty())
209 return false;
210
211 if (name.find(" ") != std::string::npos)
212 return false;
213
214 std::wstring tmp;
215 if (!Utf8toWStr(name, tmp))
216 return false;
217
218 wstrToLower(tmp);
219 if (!tmp.empty())
220 tmp[0] = wcharToUpper(tmp[0]);
221
222 if (!WStrToUtf8(tmp, name))
223 return false;
224
225 return true;
226}
bool WStrToUtf8(wchar_t const *wstr, size_t size, std::string &utf8str)
Definition: Util.cpp:334
void wstrToLower(std::wstring &str)
Definition: Util.cpp:383
bool Utf8toWStr(char const *utf8str, size_t csize, wchar_t *wstr, size_t &wsize)
Definition: Util.cpp:282
wchar_t wcharToUpper(wchar_t wchar)
Definition: Util.h:273

References Utf8toWStr(), wcharToUpper(), wstrToLower(), and WStrToUtf8().

Referenced by ChatHandler::extractLowGuidFromLink(), ChatHandler::extractPlayerNameFromLink(), PlayerNameMapHolder::Find(), character_commandscript::GetDeletedCharacterInfoList(), ChatHandler::GetPlayerGroupAndGUIDByName(), WorldSession::HandleAddFriendOpcode(), WorldSession::HandleAddIgnoreOpcode(), WorldSession::HandleArenaTeamInviteOpcode(), WorldSession::HandleArenaTeamLeaderOpcode(), WorldSession::HandleArenaTeamRemoveOpcode(), ban_commandscript::HandleBanCharacterCommand(), ban_commandscript::HandleBanHelper(), WorldSession::HandleChannelBan(), WorldSession::HandleChannelInvite(), WorldSession::HandleChannelKick(), WorldSession::HandleChannelModerator(), WorldSession::HandleChannelMute(), WorldSession::HandleChannelSetOwner(), WorldSession::HandleChannelUnban(), WorldSession::HandleChannelUnmoderator(), WorldSession::HandleChannelUnmute(), character_commandscript::HandleCharacterRenameCommand(), WorldSession::HandleCharCreateOpcode(), WorldSession::HandleCharCustomizeCallback(), WorldSession::HandleCharFactionOrRaceChangeCallback(), WorldSession::HandleCharRenameOpcode(), deserter_commandscript::HandleDeserterAdd(), ticket_commandscript::HandleGMTicketAssignToCommand(), ticket_commandscript::HandleGMTicketGetByNameCommand(), WorldSession::HandleGroupInviteOpcode(), WorldSession::HandleGroupSwapSubGroupOpcode(), WorldSession::HandleGroupUninviteOpcode(), WorldSession::HandleGuildDemoteOpcode(), WorldSession::HandleGuildInviteOpcode(), WorldSession::HandleGuildLeaderOpcode(), WorldSession::HandleGuildPromoteOpcode(), WorldSession::HandleGuildRemoveOpcode(), WorldSession::HandleGuildSetOfficerNoteOpcode(), WorldSession::HandleGuildSetPublicNoteOpcode(), WorldSession::HandleMessagechatOpcode(), WorldSession::HandleSendMail(), WorldSession::HandleSetPlayerDeclinedNames(), ban_commandscript::HandleUnBanCharacterCommand(), ban_commandscript::HandleUnBanHelper(), message_commandscript::HandleWhispersCommand(), WorldSession::HandleWhoisOpcode(), PlayerDumpReader::LoadDump(), Acore::ChatCommands::PlayerIdentifier::TryConsume(), and character_commandscript::ValidatePDumpTarget().

Variable Documentation

◆ lang_description

LanguageDesc lang_description[LANGUAGES_COUNT]
Initial value:
=
{
{ LANG_ADDON, 0, 0 },
{ LANG_UNIVERSAL, 0, 0 },
{ LANG_ZOMBIE, 0, 0 },
}
@ LANG_TITAN
Definition: SharedDefines.h:714
@ LANG_GNOMISH_BINARY
Definition: SharedDefines.h:723
@ LANG_UNIVERSAL
Definition: SharedDefines.h:707
@ LANG_GNOMISH
Definition: SharedDefines.h:718
@ LANG_GOBLIN_BINARY
Definition: SharedDefines.h:724
@ LANG_DEMONIC
Definition: SharedDefines.h:713
@ LANG_DRAENEI
Definition: SharedDefines.h:721
@ LANG_THALASSIAN
Definition: SharedDefines.h:715
@ LANG_DRACONIC
Definition: SharedDefines.h:716
@ LANG_TROLL
Definition: SharedDefines.h:719
@ LANG_TAURAHE
Definition: SharedDefines.h:710
@ LANG_KALIMAG
Definition: SharedDefines.h:717
@ LANG_ZOMBIE
Definition: SharedDefines.h:722
@ LANG_ADDON
Definition: SharedDefines.h:725
@ LANG_DWARVISH
Definition: SharedDefines.h:711
@ LANG_GUTTERSPEAK
Definition: SharedDefines.h:720
@ LANG_COMMON
Definition: SharedDefines.h:712
@ LANG_ORCISH
Definition: SharedDefines.h:708
@ LANG_DARNASSIAN
Definition: SharedDefines.h:709
@ SKILL_LANG_GNOMISH
Definition: SharedDefines.h:2924
@ SKILL_LANG_COMMON
Definition: SharedDefines.h:2854
@ SKILL_LANG_DRAENEI
Definition: SharedDefines.h:2960
@ SKILL_LANG_ORCISH
Definition: SharedDefines.h:2856
@ SKILL_LANG_TROLL
Definition: SharedDefines.h:2925
@ SKILL_LANG_GUTTERSPEAK
Definition: SharedDefines.h:2952
@ SKILL_LANG_OLD_TONGUE
Definition: SharedDefines.h:2871
@ SKILL_LANG_TAURAHE
Definition: SharedDefines.h:2859
@ SKILL_LANG_TITAN
Definition: SharedDefines.h:2870
@ SKILL_LANG_DARNASSIAN
Definition: SharedDefines.h:2858
@ SKILL_LANG_DEMON_TONGUE
Definition: SharedDefines.h:2869
@ SKILL_LANG_DWARVEN
Definition: SharedDefines.h:2857
@ SKILL_LANG_THALASSIAN
Definition: SharedDefines.h:2867
@ SKILL_LANG_DRACONIC
Definition: SharedDefines.h:2868

Referenced by GetLanguageDescByID(), and learn_commandscript::HandleLearnAllLangCommand().

◆ sEventScripts

◆ sSpellScripts

◆ sWaypointScripts