231 ObjectGuid guid = ObjectGuid::Create<HighGuid::Player>((*result)[0].GetUInt32());
236 if (!(*result)[23].GetUInt32())
240 sCharacterCache->AddCharacterCacheEntry(guid,
GetAccountId(), (*result)[1].GetString(), (*result)[4].GetUInt8(), (*result)[2].GetUInt8(), (*result)[3].GetUInt8(), (*result)[10].GetUInt8());
277 bool disabled =
false;
282 disabled = (mask & (1 << 0)) != 0;
285 disabled = (mask & (1 << 1)) != 0;
300 TC_LOG_ERROR(
"network",
"Class ({}) not found in DBC while creating new char for account (ID: {}): wrong DBC files or cheater?", charCreate.
CreateInfo->Class,
GetAccountId());
308 TC_LOG_ERROR(
"network",
"Race ({}) not found in DBC while creating new char for account (ID: {}): wrong DBC files or cheater?", charCreate.
CreateInfo->Race,
GetAccountId());
333 TC_LOG_ERROR(
"network",
"Race ({}) was not playable but requested while creating new char for account (ID: {}): wrong DBC files or cheater?", charCreate.
CreateInfo->Race,
GetAccountId());
339 if ((1 << (charCreate.
CreateInfo->Race - 1)) & raceMaskDisabled)
349 if ((1 << (charCreate.
CreateInfo->Class - 1)) & classMaskDisabled)
359 TC_LOG_ERROR(
"entities.player.cheat",
"Account:[{}] but tried to Create character with empty [name] ",
GetAccountId());
395 std::shared_ptr<WorldPackets::Character::CharacterCreateInfo> createInfo = charCreate.
CreateInfo;
404 SendCharCreate(CHAR_CREATE_NAME_IN_USE);
417 Field* fields = result->Fetch();
418 acctCharCount =
uint64(fields[0].GetDouble());
435 Field* fields = result->Fetch();
436 createInfo->CharCount =
uint8(fields[0].GetUInt64());
450 bool haveSameRace =
false;
452 bool hasDeathKnightReqLevel = (deathKnightReqLevel == 0);
462 Field* field = result->Fetch();
465 if (checkDeathKnightReqs)
470 if (freeDeathKnightSlots > 0)
471 --freeDeathKnightSlots;
473 if (freeDeathKnightSlots == 0)
480 if (!hasDeathKnightReqLevel)
483 if (accLevel >= deathKnightReqLevel)
484 hasDeathKnightReqLevel =
true;
490 if (!allowTwoSideAccounts)
505 while ((skipCinematics == 1 && !haveSameRace) || createInfo->Class ==
CLASS_DEATH_KNIGHT)
507 if (!result->NextRow())
510 field = result->Fetch();
514 haveSameRace = createInfo->Race == accRace;
516 if (checkDeathKnightReqs)
521 if (freeDeathKnightSlots > 0)
522 --freeDeathKnightSlots;
524 if (freeDeathKnightSlots == 0)
531 if (!hasDeathKnightReqLevel)
534 if (acc_level >= deathKnightReqLevel)
535 hasDeathKnightReqLevel =
true;
541 if (checkDeathKnightReqs && !hasDeathKnightReqLevel)
554 std::shared_ptr<Player> newChar(
new Player(
this), [](
Player* ptr)
559 newChar->GetMotionMaster()->Initialize();
567 if ((haveSameRace && skipCinematics == 1) || skipCinematics == 2)
568 newChar->setCinematic(1);
576 newChar->SaveToDB(characterTransaction,
true);
577 createInfo->CharCount += 1;
580 stmt->
setUInt32(0, createInfo->CharCount);
585 AddTransactionCallback(
CharacterDatabase.AsyncCommitTransaction(characterTransaction)).AfterComplete([
this, newChar = std::move(newChar), trans](
bool success)
591 TC_LOG_INFO(
"entities.player.character",
"Account: {} (IP: {}) Create Character: {} {}", GetAccountId(), GetRemoteAddress(), newChar->GetName(), newChar->GetGUID().ToString());
593 sCharacterCache->AddCharacterCacheEntry(newChar->GetGUID(), GetAccountId(), newChar->GetName(), newChar->GetNativeGender(), newChar->GetRace(), newChar->GetClass(), newChar->GetLevel());
602 if (allowTwoSideAccounts && !skipCinematics && createInfo->Class !=
CLASS_DEATH_KNIGHT)
655 name = characterInfo->
Name;
656 level = characterInfo->
Level;
659 if (accountId != initAccountId)
689 KickPlayer(
"WorldSession::HandlePlayerLoginOpcode Another client logging in");
696 recvData >> playerGuid;
701 KickPlayer(
"WorldSession::HandlePlayerLoginOpcode Trying to login with a character of another account");
705 std::shared_ptr<LoginQueryHolder> holder = std::make_shared<LoginQueryHolder>(
GetAccountId(), playerGuid);
706 if (!holder->Initialize())
727 if (!pCurrChar->
LoadFromDB(playerGuid, holder))
730 KickPlayer(
"WorldSession::HandlePlayerLogin Player::LoadFromDB failed");
766 Field* fields = resultGuild->Fetch();
779 guild->SendLoginInfo(
this);
802 if (cEntry->CinematicSequenceID)
808 if (!
sWorld->GetNewCharString().empty())
842 group->ResetMaxEnchantingLevel();
843 if (group->GetLeaderGUID() == pCurrChar->
GetGUID())
844 group->StopLeaderOfflineTimer();
893 pCurrChar->
CastSpell(pCurrChar, spellId,
true);
966 if (
sWorld->IsShuttingDown())
967 sWorld->ShutdownMsg(
true, pCurrChar);
975 TC_LOG_INFO(
"entities.player.character",
"Account: {} (IP: {}) Login Character:[{}] {} Level: {}, XP: {}/{} ({} left)",
994 sScriptMgr->OnPlayerLogin(pCurrChar, firstLogin);
1009 TC_LOG_DEBUG(
"network",
"WORLD: Received CMSG_SET_FACTION_ATWAR");
1014 recvData >> repListID;
1023 TC_LOG_ERROR(
"network",
"WORLD SESSION: HandleSetFactionCheat, not expected call, please report.");
1036 uint32 value = (data % 32);
1039 flag |= (1 << value);
1057 TC_LOG_DEBUG(
"network",
"WORLD: Received CMSG_SET_WATCHED_FACTION");
1065 TC_LOG_DEBUG(
"network",
"WORLD: Received CMSG_SET_FACTION_INACTIVE");
1068 recvData >> replistid >> inactive;
1093 TC_LOG_ERROR(
"network",
"Account {}, IP: {} tried to rename character {}, but it does not belong to their account!",
1095 KickPlayer(
"WorldSession::HandleCharRenameOpcode rename character from a different account");
1130 HandleCharRenameCallBack(std::move(renameInfo), std::move(result));
1142 Field* fields = result->Fetch();
1144 std::string oldName = fields[0].
GetString();
1153 atLoginFlags &= ~AT_LOGIN_RENAME;
1160 stmt->
setString(0, renameInfo->NewName);
1162 stmt->
setUInt32(2, renameInfo->Guid.GetCounter());
1169 stmt->
setUInt32(0, renameInfo->Guid.GetCounter());
1173 TC_LOG_INFO(
"entities.player.character",
"Account: {} (IP: {}) Character:[{}] ({}) Changed name to: {}",
GetAccountId(),
GetRemoteAddress(), oldName, renameInfo->Guid.ToString(), renameInfo->NewName);
1177 sCharacterCache->UpdateCharacterData(renameInfo->Guid, renameInfo->NewName);
1220 recvData >> declinedname.
name[i];
1241 trans->Append(stmt);
1246 for (
uint8 i = 0; i < 5; i++)
1249 trans->Append(stmt);
1260 uint32 Hair, Color, FacialHair, SkinColor;
1261 recvData >> Hair >> Color >> FacialHair >> SkinColor;
1330 TC_LOG_DEBUG(
"network",
"Client sent wrong glyph slot number in opcode CMSG_REMOVE_GLYPH {}", slot);
1349 TC_LOG_ERROR(
"entities.player.cheat",
"Account {}, IP: {} tried to customise {}, but it does not belong to their account!",
1351 KickPlayer(
"WorldSession::HandleCharCustomize Trying to customise character of another account");
1361 HandleCharCustomizeCallback(std::move(customizeInfo), std::move(result));
1373 Field* fields = result->Fetch();
1374 std::string oldName = fields[0].
GetString();
1380 if (!
Player::ValidateAppearance(plrRace, plrClass, plrGender, customizeInfo->HairStyleID, customizeInfo->HairColorID, customizeInfo->FaceID, customizeInfo->FacialHairStyleID, customizeInfo->SkinID,
true))
1392 atLoginFlags &= ~AT_LOGIN_CUSTOMIZE;
1426 if (newGuid != customizeInfo->CharGUID)
1442 stmt->
setUInt8(0, customizeInfo->SexID);
1443 stmt->
setUInt8(1, customizeInfo->SkinID);
1444 stmt->
setUInt8(2, customizeInfo->FaceID);
1445 stmt->
setUInt8(3, customizeInfo->HairStyleID);
1446 stmt->
setUInt8(4, customizeInfo->HairColorID);
1447 stmt->
setUInt8(5, customizeInfo->FacialHairStyleID);
1448 stmt->
setUInt32(6, customizeInfo->CharGUID.GetCounter());
1450 trans->Append(stmt);
1456 stmt->
setString(0, customizeInfo->CharName);
1460 trans->Append(stmt);
1465 trans->Append(stmt);
1470 sCharacterCache->UpdateCharacterData(customizeInfo->CharGUID, customizeInfo->CharName, customizeInfo->SexID);
1474 TC_LOG_INFO(
"entities.player.character",
"Account: {} (IP: {}), Character[{}] ({}) Customized to: {}",
1493 std::string iconName;
1494 recvData >> iconName;
1497 eqData.
Guid = setGuid;
1498 eqData.
SetID = index;
1521 if (!item || item->
GetGUID() != itemGuid)
1524 eqData.
Pieces[i] = itemGuid;
1549 uint8 srcbag, srcslot;
1550 recvData >> srcbag >> srcslot;
1552 TC_LOG_DEBUG(
"entities.player.items",
"{}: srcbag {}, srcslot {}", itemGuid.
ToString(), srcbag, srcslot);
1588 if (item->
GetPos() == dstpos)
1606 TC_LOG_ERROR(
"entities.player.cheat",
"Account {}, IP: {} tried to factionchange character {}, but it does not belong to their account!",
1608 KickPlayer(
"WorldSession::HandleCharRaceOrFactionChange Trying to change faction of character of another account");
1618 HandleCharRaceOrFactionChangeCallback(std::move(factionChangeInfo), std::move(result));
1643 if (!
sObjectMgr->GetPlayerInfo(factionChangeInfo->RaceID, playerClass))
1649 Field* fields = result->Fetch();
1651 std::string knownTitlesStr = fields[1].
GetString();
1656 if (!(atLoginFlags & usedLoginFlag))
1684 if ((1 << (factionChangeInfo->RaceID - 1)) & raceMaskDisabled)
1723 if (newGuid != factionChangeInfo->Guid)
1730 if (
sArenaTeamMgr->GetArenaTeamByCaptain(factionChangeInfo->Guid))
1750 stmt->
setString(0, factionChangeInfo->Name);
1753 trans->Append(stmt);
1757 trans->Append(stmt);
1764 stmt->
setUInt8(0, factionChangeInfo->SexID);
1765 stmt->
setUInt8(1, factionChangeInfo->SkinID);
1766 stmt->
setUInt8(2, factionChangeInfo->FaceID);
1767 stmt->
setUInt8(3, factionChangeInfo->HairStyleID);
1768 stmt->
setUInt8(4, factionChangeInfo->HairColorID);
1769 stmt->
setUInt8(5, factionChangeInfo->FacialHairStyleID);
1770 stmt->
setUInt32(6, factionChangeInfo->Guid.GetCounter());
1772 trans->Append(stmt);
1778 stmt->
setUInt8(0, factionChangeInfo->RaceID);
1781 trans->Append(stmt);
1784 sCharacterCache->UpdateCharacterData(factionChangeInfo->Guid, factionChangeInfo->Name, factionChangeInfo->SexID, factionChangeInfo->RaceID);
1786 if (oldRace != factionChangeInfo->RaceID)
1792 trans->Append(stmt);
1799 if (newTeam ==
HORDE)
1804 trans->Append(stmt);
1807 if (factionChangeInfo->RaceID !=
RACE_ORC && factionChangeInfo->RaceID !=
RACE_HUMAN)
1812 switch (factionChangeInfo->RaceID)
1840 trans->Append(stmt);
1843 if (factionChangeInfo->FactionChange)
1848 trans->Append(stmt);
1854 std::ostringstream taximaskstream;
1855 uint32 numFullTaximasks = level / 7;
1856 if (numFullTaximasks > 11)
1857 numFullTaximasks = 11;
1860 for (
uint8 i = 0; i < numFullTaximasks; ++i)
1863 taximaskstream <<
uint32(factionMask[i] | deathKnightExtraNode) <<
' ';
1866 uint32 numEmptyTaximasks = 11 - numFullTaximasks;
1867 for (
uint8 i = 0; i < numEmptyTaximasks; ++i)
1868 taximaskstream <<
"0 ";
1869 taximaskstream <<
'0';
1872 stmt->
setString(0, taximaskstream.str());
1874 trans->Append(stmt);
1881 guild->DeleteMember(trans, factionChangeInfo->Guid,
false,
false);
1889 group->RemoveMember(factionChangeInfo->Guid);
1897 trans->Append(stmt);
1901 trans->Append(stmt);
1907 trans->Append(stmt);
1930 trans->Append(stmt);
1935 for (std::map<uint32, uint32>::const_iterator it =
sObjectMgr->FactionChangeAchievements.begin(); it !=
sObjectMgr->FactionChangeAchievements.end(); ++it)
1937 uint32 achiev_alliance = it->first;
1938 uint32 achiev_horde = it->second;
1943 trans->Append(stmt);
1949 trans->Append(stmt);
1953 for (std::map<uint32, uint32>::const_iterator it =
sObjectMgr->FactionChangeItems.begin(); it !=
sObjectMgr->FactionChangeItems.end(); ++it)
1955 uint32 item_alliance = it->first;
1956 uint32 item_horde = it->second;
1962 trans->Append(stmt);
1968 trans->Append(stmt);
1971 for (std::map<uint32, uint32>::const_iterator it =
sObjectMgr->FactionChangeQuests.begin(); it !=
sObjectMgr->FactionChangeQuests.end(); ++it)
1973 uint32 quest_alliance = it->first;
1974 uint32 quest_horde = it->second;
1979 trans->Append(stmt);
1985 trans->Append(stmt);
1991 trans->Append(stmt);
1996 for (
auto const& [questId, quest] : questTemplates)
1999 if (quest->GetAllowableRaces() && !(quest->GetAllowableRaces() & newRaceMask))
2004 trans->Append(stmt);
2010 for (std::map<uint32, uint32>::const_iterator it =
sObjectMgr->FactionChangeSpells.begin(); it !=
sObjectMgr->FactionChangeSpells.end(); ++it)
2012 uint32 spell_alliance = it->first;
2013 uint32 spell_horde = it->second;
2018 trans->Append(stmt);
2024 trans->Append(stmt);
2028 for (std::map<uint32, uint32>::const_iterator it =
sObjectMgr->FactionChangeReputation.begin(); it !=
sObjectMgr->FactionChangeReputation.end(); ++it)
2030 uint32 reputation_alliance = it->first;
2031 uint32 reputation_horde = it->second;
2032 uint32 newReputation = (newTeam ==
ALLIANCE) ? reputation_alliance : reputation_horde;
2033 uint32 oldReputation = (newTeam ==
ALLIANCE) ? reputation_horde : reputation_alliance;
2042 fields = reputationResult->Fetch();
2047 int32 oldBaseRep =
sObjectMgr->GetBaseReputationOf(factionEntry, oldRace, playerClass);
2053 int32 FinalRep = oldDBRep + oldBaseRep;
2054 int32 newDBRep = FinalRep - newBaseRep;
2059 trans->Append(stmt);
2066 trans->Append(stmt);
2071 if (!knownTitlesStr.empty())
2073 std::vector<std::string_view> tokens =
Trinity::Tokenize(knownTitlesStr,
' ',
false);
2074 std::array<uint32, KNOWN_TITLES_SIZE * 2> knownTitles;
2076 for (
uint32 index = 0; index < knownTitles.size(); ++index)
2079 if (index < tokens.size())
2080 thisMask = Trinity::StringTo<uint32>(tokens[index]);
2083 knownTitles[index] = *thisMask;
2086 TC_LOG_WARN(
"entities.player",
"{} has invalid title data '{}' at index {} - skipped, this may result in titles being lost",
2087 GetPlayerInfo(), (index < tokens.size()) ? std::string(tokens[index]) :
"<none>", index);
2088 knownTitles[index] = 0;
2092 for (std::map<uint32, uint32>::const_iterator it =
sObjectMgr->FactionChangeTitles.begin(); it !=
sObjectMgr->FactionChangeTitles.end(); ++it)
2094 uint32 title_alliance = it->first;
2095 uint32 title_horde = it->second;
2103 uint32 index = bitIndex / 32;
2104 uint32 old_flag = 1 << (bitIndex % 32);
2106 if (knownTitles[index] & old_flag)
2108 knownTitles[index] &= ~old_flag;
2110 knownTitles[atitleInfo->
MaskID / 32] |= new_flag;
2116 uint32 index = bitIndex / 32;
2117 uint32 old_flag = 1 << (bitIndex % 32);
2119 if (knownTitles[index] & old_flag)
2121 knownTitles[index] &= ~old_flag;
2123 knownTitles[htitleInfo->
MaskID / 32] |= new_flag;
2127 std::ostringstream ss;
2128 for (
uint32 mask : knownTitles)
2134 trans->Append(stmt);
2139 trans->Append(stmt);
2155 response.
Code = result;
2163 response.
Code = result;
2181 response.
Code = result;
2190 response.
Result = result;
2219 if (classEntry->CinematicSequenceID)
@ CHAR_SEL_CHARACTER_ACTIONS
@ CHAR_SEL_CHAR_CUSTOMIZE_INFO
@ CHAR_DEL_CHAR_SOCIAL_BY_FRIEND
@ CHAR_UPD_CHAR_INVENTORY_FACTION_CHANGE
@ CHAR_DEL_CHAR_QUESTSTATUS_REWARDED_BY_QUEST
@ CHAR_SEL_CHARACTER_QUESTSTATUSREW
@ CHAR_SEL_PLAYER_ACCOUNT_DATA
@ CHAR_UPD_CHAR_QUESTSTATUS_REWARDED_FACTION_CHANGE
@ CHAR_DEL_CHAR_SKILL_LANGUAGES
@ CHAR_SEL_CHARACTER_AURAS
@ CHAR_UPD_CHAR_ACHIEVEMENT
@ CHAR_DEL_CHAR_DECLINED_NAME
@ CHAR_SEL_CHAR_RACE_OR_FACTION_CHANGE_INFOS
@ CHAR_SEL_CHARACTER_QUESTSTATUS_MONTHLY
@ CHAR_INS_PLAYER_HOMEBIND
@ CHAR_INS_CHAR_SKILL_LANGUAGE
@ CHAR_SEL_CHARACTER_BGDATA
@ CHAR_SEL_CHARACTER_SOCIALLIST
@ CHAR_UPD_CHAR_SPELL_FACTION_CHANGE
@ CHAR_UPD_CHAR_TAXI_PATH
@ CHAR_SEL_CHARACTER_QUESTSTATUS_WEEKLY
@ CHAR_DEL_PLAYER_HOMEBIND
@ CHAR_SEL_CHAR_REP_BY_FACTION
@ CHAR_SEL_CHARACTER_HOMEBIND
@ CHAR_DEL_CHAR_SPELL_BY_SPELL
@ CHAR_SEL_CHAR_CREATE_INFO
@ CHAR_SEL_CHARACTER_INVENTORY
@ CHAR_UPD_CHAR_QUESTSTATUS_REWARDED_ACTIVE_BY_QUEST
@ CHAR_SEL_CHARACTER_INSTANCE
@ CHAR_SEL_CHARACTER_QUESTSTATUS
@ CHAR_DEL_CHAR_ACHIEVEMENT_BY_ACHIEVEMENT
@ CHAR_SEL_CHARACTER_TALENTS
@ CHAR_SEL_CORPSE_LOCATION
@ CHAR_SEL_CHARACTER_CRITERIAPROGRESS
@ CHAR_SEL_CHARACTER_GLYPHS
@ CHAR_SEL_CHARACTER_REPUTATION
@ CHAR_DEL_CHAR_QUESTSTATUS
@ CHAR_SEL_CHARACTER_SPELL
@ CHAR_UPD_GENDER_AND_APPEARANCE
@ CHAR_UPD_CHAR_REP_FACTION_CHANGE
@ CHAR_SEL_CHARACTER_QUESTSTATUS_SEASONAL
@ CHAR_SEL_CHARACTER_RANDOMBG
@ CHAR_SEL_CHARACTER_EQUIPMENTSETS
@ CHAR_SEL_CHARACTER_SKILLS
@ CHAR_SEL_CHARACTER_QUESTSTATUS_DAILY
@ CHAR_UPD_CHAR_TITLES_FACTION_CHANGE
@ CHAR_DEL_CHAR_REP_BY_FACTION
@ CHAR_SEL_ENUM_DECLINED_NAME
@ CHAR_SEL_CHARACTER_SPELLCOOLDOWNS
@ CHAR_RES_CHAR_TITLES_FACTION_CHANGE
@ CHAR_UPD_CHAR_QUESTSTATUS_REWARDED_ACTIVE
@ CHAR_DEL_CHAR_SOCIAL_BY_GUID
@ CHAR_SEL_CHARACTER_ACHIEVEMENTS
@ CHAR_SEL_CHARACTER_DECLINEDNAMES
@ CHAR_SEL_CHARACTER_ARENAINFO
@ CHAR_UPD_CHAR_NAME_AT_LOGIN
@ CHAR_INS_CHAR_DECLINED_NAME
@ CHAR_SEL_CHARACTER_BANNED
#define MAX_ACCOUNT_TUTORIAL_VALUES
@ ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP
@ ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_AT_BARBER
@ ACHIEVEMENT_CRITERIA_TYPE_ON_LOGIN
DBCStorage< CharTitlesEntry > sCharTitlesStore(CharTitlesEntryfmt)
DBCStorage< FactionEntry > sFactionStore(FactionEntryfmt)
TaxiMask sAllianceTaxiNodesMask
DBCStorage< BarberShopStyleEntry > sBarberShopStyleStore(BarberShopStyleEntryfmt)
DBCStorage< ChrRacesEntry > sChrRacesStore(ChrRacesEntryfmt)
TaxiMask sDeathKnightTaxiNodesMask
DBCStorage< GlyphPropertiesEntry > sGlyphPropertiesStore(GlyphPropertiesfmt)
DBCStorage< ChrClassesEntry > sChrClassesStore(ChrClassesEntryfmt)
TaxiMask sHordeTaxiNodesMask
@ CHRRACES_FLAGS_NOT_PLAYABLE
@ CHRRACES_ALLIANCE_TYPE_NOT_PLAYABLE
SQLTransaction< CharacterDatabaseConnection > CharacterDatabaseTransaction
SQLTransaction< LoginDatabaseConnection > LoginDatabaseTransaction
std::shared_ptr< PreparedResultSet > PreparedQueryResult
DatabaseWorkerPool< LoginDatabaseConnection > LoginDatabase
Accessor to the realm/login database.
DatabaseWorkerPool< CharacterDatabaseConnection > CharacterDatabase
Accessor to the character database.
#define MAX_EQUIPMENT_SET_INDEX
#define TC_LOG_WARN(filterType__,...)
#define TC_LOG_DEBUG(filterType__,...)
#define TC_LOG_ERROR(filterType__,...)
#define TC_LOG_INFO(filterType__,...)
@ LOGIN_REP_REALM_CHARACTERS
@ LOGIN_SEL_SUM_REALM_CHARACTERS
@ LOGIN_UPD_ACCOUNT_ONLINE
#define TC_METRIC_EVENT(category, title, description)
bool normalizePlayerName(std::string &name)
std::optional< T > Optional
Optional helper class to wrap optional values within.
@ EQUIPMENT_SLOT_MAINHAND
std::vector< ItemPosCount > ItemPosCountVec
@ PLAYER_EXTRA_HAS_RACE_CHANGED
@ PLAYER_FLAGS_HIDE_CLOAK
@ PLAYER_FLAGS_CONTESTED_PVP
@ AT_LOGIN_RESET_PET_TALENTS
@ AT_LOGIN_CHANGE_FACTION
#define INVENTORY_SLOT_BAG_0
#define PLAYER_EXPLORED_ZONES_SIZE
@ PLAYER_LOGIN_QUERY_LOAD_SPELL_COOLDOWNS
@ PLAYER_LOGIN_QUERY_LOAD_GLYPHS
@ PLAYER_LOGIN_QUERY_LOAD_DECLINED_NAMES
@ PLAYER_LOGIN_QUERY_LOAD_QUEST_STATUS_REW
@ PLAYER_LOGIN_QUERY_LOAD_DAILY_QUEST_STATUS
@ PLAYER_LOGIN_QUERY_LOAD_SEASONAL_QUEST_STATUS
@ PLAYER_LOGIN_QUERY_LOAD_SOCIAL_LIST
@ PLAYER_LOGIN_QUERY_LOAD_ACTIONS
@ PLAYER_LOGIN_QUERY_LOAD_SKILLS
@ PLAYER_LOGIN_QUERY_LOAD_BG_DATA
@ PLAYER_LOGIN_QUERY_LOAD_ACCOUNT_DATA
@ PLAYER_LOGIN_QUERY_LOAD_MAIL_ITEMS
@ PLAYER_LOGIN_QUERY_LOAD_PET_SLOTS
@ PLAYER_LOGIN_QUERY_LOAD_INVENTORY
@ PLAYER_LOGIN_QUERY_LOAD_REPUTATION
@ PLAYER_LOGIN_QUERY_LOAD_FROM
@ PLAYER_LOGIN_QUERY_LOAD_QUEST_STATUS
@ PLAYER_LOGIN_QUERY_LOAD_WEEKLY_QUEST_STATUS
@ PLAYER_LOGIN_QUERY_LOAD_MONTHLY_QUEST_STATUS
@ PLAYER_LOGIN_QUERY_LOAD_GUILD
@ PLAYER_LOGIN_QUERY_LOAD_EQUIPMENT_SETS
@ PLAYER_LOGIN_QUERY_LOAD_MAILS
@ PLAYER_LOGIN_QUERY_LOAD_AURAS
@ PLAYER_LOGIN_QUERY_LOAD_TALENTS
@ PLAYER_LOGIN_QUERY_LOAD_BANNED
@ PLAYER_LOGIN_QUERY_LOAD_ARENA_INFO
@ PLAYER_LOGIN_QUERY_LOAD_GROUP
@ PLAYER_LOGIN_QUERY_LOAD_CRITERIA_PROGRESS
@ PLAYER_LOGIN_QUERY_LOAD_HOME_BIND
@ PLAYER_LOGIN_QUERY_LOAD_CORPSE_LOCATION
@ PLAYER_LOGIN_QUERY_LOAD_SPELLS
@ PLAYER_LOGIN_QUERY_LOAD_BOUND_INSTANCES
@ PLAYER_LOGIN_QUERY_LOAD_RANDOM_BG
@ PLAYER_LOGIN_QUERY_LOAD_ACHIEVEMENTS
Role Based Access Control related classes definition.
@ GAMEOBJECT_TYPE_BARBER_CHAIR
@ CHAR_CREATE_CHARACTER_ARENA_LEADER
@ CHAR_CREATE_RESTRICTED_RACECLASS
@ CHAR_CREATE_LEVEL_REQUIREMENT
@ CHAR_DELETE_FAILED_GUILD_LEADER
@ CHAR_DELETE_FAILED_ARENA_CAPTAIN
@ CHAR_CREATE_NAME_IN_USE
@ CHAR_CREATE_CHARACTER_SWAP_FACTION
@ CHAR_CREATE_SERVER_LIMIT
@ CHAR_CREATE_EXPANSION_CLASS
@ CHAR_CREATE_CHARACTER_RACE_ONLY
@ CHAR_CREATE_PVP_TEAMS_VIOLATION
@ CHAR_CREATE_ACCOUNT_LIMIT
@ CHAR_CREATE_UNIQUE_CLASS_LIMIT
#define MAX_GLYPH_SLOT_INDEX
#define RACEMASK_ALLIANCE
@ COMPLAINT_ENABLED_WITH_AUTO_IGNORE
@ UNIT_STAND_STATE_SIT_LOW_CHAIR
#define MAX_DECLINED_NAME_CASES
@ UNIT_BYTE2_FLAG_FFA_PVP
@ PLAYER_EXPLORED_ZONES_1
@ PLAYER_FIELD_WATCHED_FACTION_INDEX
bool Utf8toWStr(char const *utf8str, size_t csize, wchar_t *wstr, size_t &wsize)
bool isCyrillicCharacter(wchar_t wchar)
T & AddCallback(T &&query)
void put(std::size_t pos, T value)
void readPackGUID(uint64 &guid)
void PSendSysMessage(char const *fmt, Args &&... args)
Class used to access individual fields of database query result.
std::string GetString() const
GameObjectTemplate const * GetGOInfo() const
LoginQueryHolder(uint32 accountId, ObjectGuid guid)
ObjectGuid GetGuid() const
uint32 GetAccountId() const
virtual bool AddPlayerToMap(Player *)
LowType GetCounter() const
uint64 GetRawValue() const
std::string ToString() const
PackedGuidReader ReadAsPacked()
static bool CheckDeclinedNames(const std::wstring &w_ownname, DeclinedName const &names)
static ResponseCodes CheckPlayerName(std::string_view name, LocaleConstant locale, bool create=false)
std::unordered_map< uint32, Trinity::unique_trackable_ptr< Quest > > QuestContainer
uint32 GetUInt32Value(uint16 index) const
void SetFlag(uint16 index, uint32 newFlag)
void RemoveFlag(uint16 index, uint32 oldFlag)
bool HasFlag(uint16 index, uint32 flag) const
static ObjectGuid GetGUID(Object const *o)
void SetUInt32Value(uint16 index, uint32 value)
static void resetTalentsForAllPetsOf(Player *owner, Pet *online_pet=nullptr, bool involuntarily=false)
void ContinueTaxiFlight() const
void SendInitialPacketsAfterAddToMap()
InventoryResult CanUnequipItem(uint16 src, bool swap) const
void RemoveAtLoginFlag(AtLoginFlags flags, bool persist=false)
void SetHairStyleId(uint8 hairStyle)
void ResetSpells(bool myClassOnly=false)
void SendTalentsInfoData(bool pet)
void SetEquipmentSet(EquipmentSetInfo::EquipmentSetData const &eqset)
InventoryResult CanEquipItem(uint8 slot, uint16 &dest, Item *pItem, bool swap, bool not_loading=true) const
Gender GetNativeGender() const override
InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &dest, Item *pItem, bool swap=false) const
void SetHairColorId(uint8 hairColor)
void CleanupsBeforeDelete(bool finalCleanup=true) override
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1=0, uint32 miscValue2=0, WorldObject *ref=nullptr)
static void OfflineResurrect(ObjectGuid const &guid, CharacterDatabaseTransaction trans)
bool ModifyMoney(int32 amount, bool sendError=true)
void SendDungeonDifficulty(bool IsInGroup) const
void SendInitialPacketsBeforeAddToMap()
static void SavePositionInDB(WorldLocation const &loc, uint16 zoneId, ObjectGuid guid, CharacterDatabaseTransaction trans)
void SetFacialStyle(uint8 facialStyle)
void SwapItem(uint16 src, uint16 dst)
Item * StoreItem(ItemPosCountVec const &pos, Item *pItem, bool update)
WorldSession * GetSession() const
void DeleteEquipmentSet(uint64 setGuid)
Item * GetItemByPos(uint16 pos) const
static uint32 TeamForRace(uint8 race)
bool HasEnoughMoney(uint32 amount) const
void SetInGuild(ObjectGuid::LowType guildId)
ObjectGuid::LowType GetGuildId() const
bool IsGameMaster() const
void SetGuildRank(uint8 rankId)
void LoadCorpse(PreparedQueryResult result)
static void DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRealmChars=true, bool deleteFinally=false)
void SendCinematicStart(uint32 CinematicSequenceId) const
void SetGlyph(uint8 slot, uint32 glyph)
uint8 getCinematic() const
bool TeleportTo(uint32 mapid, float x, float y, float z, float orientation, uint32 options=0)
uint32 GetXPForNextLevel() const
bool ResetTalents(bool involuntarily=false)
uint8 GetActiveTalentGroup() const
bool LoadFromDB(ObjectGuid guid, CharacterDatabaseQueryHolder const &holder)
void SendEquipError(InventoryResult msg, Item *pItem, Item *pItem2=nullptr, uint32 itemid=0) const
void SetSkinId(uint8 skin)
static bool BuildEnumData(PreparedQueryResult result, WorldPacket *data)
uint32 GetGlyph(uint8 group, uint8 slot) const
bool HasAtLoginFlag(AtLoginFlags f) const
static void LeaveAllArenaTeams(ObjectGuid guid)
void RemoveItem(uint8 bag, uint8 slot, bool update)
void SetTaxiCheater(bool on)
void SetContestedPvP(Player *attackedPlayer=nullptr)
Item * GetItemByGuid(ObjectGuid guid) const
static bool ValidateAppearance(uint8 race, uint8 class_, uint8 gender, uint8 hairID, uint8 hairColor, uint8 faceID, uint8 facialHair, uint8 skinColor, bool create=false)
void SetInGameTime(uint32 time)
void setCinematic(uint8 cine)
ReputationMgr & GetReputationMgr()
uint32 GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair, BarberShopStyleEntry const *newSkin=nullptr) const
void setUInt16(uint8 index, uint16 value)
void setUInt32(uint8 index, uint32 value)
void setFloat(uint8 index, float value)
void setInt32(uint8 index, int32 value)
void setUInt8(uint8 index, uint8 value)
void setString(uint8 index, std::string const &value)
void SetNextQuery(QueryCallback &&next)
QueryCallback && WithPreparedCallback(std::function< void(PreparedQueryResult)> &&callback)
void SetAtWar(RepListID repListID, bool on)
void SendState(FactionState const *faction)
bool SetOneFactionReputation(FactionEntry const *factionEntry, int32 standing, bool incremental)
Public for chat command needs.
void SetInactive(RepListID repListID, bool on)
void SetSize(size_t size)
PreparedQueryResult GetPreparedResult(size_t index) const
void AfterComplete(std::function< void(SQLQueryHolderBase const &)> callback) &
bool SetPreparedQuery(size_t index, PreparedStatement< T > *stmt)
MotionMaster * GetMotionMaster()
bool IsStandState() const
void SetPvpFlag(UnitPVPStateFlags flags)
void RemoveAurasDueToSpell(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, uint8 reqEffMask=0, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
DeathState getDeathState() const
bool HasUnitState(const uint32 f) const
void SetStandState(UnitStandStateType state)
UnitStandStateType GetStandState() const
bool SetWaterWalking(bool enable)
void WorldRelocate(WorldLocation const &loc)
GameObject * FindNearestGameObjectOfType(GameobjectTypes type, float range) const
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
std::string const & GetName() const
WorldPacket const * Write() override
CharCustomizeInfo const * CustomizeInfo
std::shared_ptr< CharCustomizeInfo > CustomizeInfo
ObjectGuid Guid
Guid of the character to delete.
CharRaceOrFactionChangeInfo const * RaceOrFactionChangeInfo
WorldPacket const * Write() override
std::shared_ptr< CharRaceOrFactionChangeInfo > RaceOrFactionChangeInfo
std::shared_ptr< CharacterRenameInfo > RenameInfo
WorldPacket const * Write() override
WorldPacket const * Write() override
std::shared_ptr< CharacterCreateInfo > CreateInfo
WorldPacket const * Write() override
TaggedPosition< Position::XYZO > Pos
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
std::vector< std::string > const * Text
void SetPlayer(Player *player)
void HandleOpeningCinematic(WorldPackets::Misc::OpeningCinematic &packet)
void HandleEquipmentSetUse(WorldPacket &recvData)
void HandlePlayerLoginOpcode(WorldPacket &recvPacket)
void HandleAlterAppearance(WorldPacket &recvData)
void HandleCharRaceOrFactionChangeCallback(std::shared_ptr< WorldPackets::Character::CharRaceOrFactionChangeInfo > factionChangeInfo, PreparedQueryResult result)
void HandleSetFactionAtWar(WorldPacket &recvData)
void HandleCharEnumOpcode(WorldPacket &recvPacket)
void SendPacket(WorldPacket const *packet)
Send a packet to the client.
void SendNotification(const char *format,...) ATTR_PRINTF(2
QueryCallbackProcessor _queryProcessor
void HandleSetWatchedFactionOpcode(WorldPacket &recvData)
void HandleSetFactionInactiveOpcode(WorldPacket &recvData)
void LoadAccountData(PreparedQueryResult result, uint32 mask)
void SendCharDelete(ResponseCodes result)
void HandleShowingCloakOpcode(WorldPackets::Character::ShowingCloak &packet)
LocaleConstant GetSessionDbcLocale() const
void HandleTutorialFlag(WorldPacket &recvData)
std::string GetPlayerInfo() const
void KickPlayer(std::string const &reason)
Kick a player out of the World.
void HandleSetFactionCheat(WorldPacket &recvData)
Player * GetPlayer() const
bool PlayerLoading() const
void HandleCharRenameOpcode(WorldPackets::Character::CharacterRenameRequest &request)
void HandleEquipmentSetDelete(WorldPacket &recvData)
void HandleCharDeleteOpcode(WorldPackets::Character::CharDelete &charDelete)
void HandleCharCreateOpcode(WorldPackets::Character::CreateCharacter &charCreate)
void SendSetPlayerDeclinedNamesResult(DeclinedNameResult result, ObjectGuid guid)
void SendBarberShopResult(BarberShopResult result)
void HandleCharRenameCallBack(std::shared_ptr< WorldPackets::Character::CharacterRenameInfo > renameInfo, PreparedQueryResult result)
SQLQueryHolderCallback & AddQueryHolderCallback(SQLQueryHolderCallback &&callback)
bool IsLegitCharacterForAccount(ObjectGuid lowGUID)
std::string const & GetRemoteAddress() const
void HandlePlayerLogin(LoginQueryHolder const &holder)
void HandleCharEnum(PreparedQueryResult result)
bool HasPermission(uint32 permissionId)
void HandleCharCustomize(WorldPackets::Character::CharCustomize &packet)
uint32 GetAccountId() const
void SendCharCustomize(ResponseCodes result, WorldPackets::Character::CharCustomizeInfo const *customizeInfo)
uint32 GetTutorialInt(uint8 index) const
void SendCharRename(ResponseCodes result, WorldPackets::Character::CharacterRenameInfo const *renameInfo)
void SendFeatureSystemStatus()
void HandleEquipmentSetSave(WorldPacket &recvData)
void HandleRemoveGlyph(WorldPacket &recvData)
void HandleSetPlayerDeclinedNames(WorldPacket &recvData)
void SendAccountDataTimes(uint32 mask)
void HandleTutorialReset(WorldPacket &recvData)
void SendCharFactionChange(ResponseCodes result, WorldPackets::Character::CharRaceOrFactionChangeInfo const *factionChangeInfo)
void SendCharCreate(ResponseCodes result)
void HandleCharCustomizeCallback(std::shared_ptr< WorldPackets::Character::CharCustomizeInfo > customizeInfo, PreparedQueryResult result)
void SetTutorialInt(uint8 index, uint32 value)
void HandleShowingHelmOpcode(WorldPackets::Character::ShowingHelm &packet)
void HandleCharRaceOrFactionChange(WorldPackets::Character::CharRaceOrFactionChange &packet)
void HandleTutorialClear(WorldPacket &recvData)
uint32 constexpr MAX_CHARACTERS_PER_REALM
#define PER_CHARACTER_CACHE_MASK
@ SMSG_SET_PLAYER_DECLINED_NAMES_RESULT
@ SMSG_LEARNED_DANCE_MOVES
@ SMSG_BARBER_SHOP_RESULT
@ SMSG_EQUIPMENT_SET_USE_RESULT
@ BARBER_SHOP_RESULT_SUCCESS
@ BARBER_SHOP_RESULT_NO_MONEY
@ BARBER_SHOP_RESULT_NOT_ON_CHAIR
@ DECLINED_NAMES_RESULT_SUCCESS
@ DECLINED_NAMES_RESULT_ERROR
@ CONFIG_CHARACTER_CREATING_DISABLED_CLASSMASK
@ CONFIG_CHARACTER_CREATING_DISABLED
@ CONFIG_CHARACTER_CREATING_DISABLED_RACEMASK
@ CONFIG_DEATH_KNIGHTS_PER_REALM
@ CONFIG_ENABLE_SINFO_LOGIN
@ CONFIG_MAX_PLAYER_LEVEL
@ CONFIG_CHARACTERS_PER_ACCOUNT
@ CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_DEATH_KNIGHT
@ CONFIG_CHARACTERS_PER_REALM
@ CONFIG_DECLINED_NAMES_USED
@ CONFIG_PREVENT_RENAME_CUSTOMIZATION
@ CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP
@ CONFIG_START_ALL_EXPLORED
@ CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD
TC_COMMON_API char const * GetFullVersion()
void AddObject(T *object)
TC_GAME_API Player * FindPlayer(ObjectGuid const &)
TC_COMMON_API std::vector< std::string_view > Tokenize(std::string_view str, char sep, bool keepEmpty)
@ RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_TEAMMASK
@ RBAC_PERM_TWO_SIDE_CHARACTER_CREATION
@ RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_RESERVEDNAME
@ RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_RACEMASK
@ RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_DEATH_KNIGHT
@ RBAC_PERM_SKIP_CHECK_CHARACTER_CREATION_CLASSMASK
@ RBAC_PERM_TWO_SIDE_ADD_FRIEND
ObjectGuid::LowType GuildId
bool HasFlag(ChrRacesFlags flag) const
std::string name[MAX_DECLINED_NAME_CASES]
Data sent in EquipmentSet related packets.
std::array< ObjectGuid, EQUIPMENT_SET_SLOTS > Pieces
uint32 IgnoreMask
Mask of EquipmentSlot.
uint64 Guid
Set Identifier.
struct GameObjectTemplate::@191::@219 barberChair
PlayerCreateInfoSpells castSpells
float GetPositionZ() const
float GetOrientation() const
float GetPositionX() const
void GetPosition(float &x, float &y) const
float GetPositionY() const