TrinityCore
Loading...
Searching...
No Matches
WorldSession Class Reference

Player session in the World. More...

#include <WorldSession.h>

Classes

union  ConnectToKey
 
class  DosProtection
 

Public Member Functions

 WorldSession (uint32 id, std::string &&name, uint32 battlenetAccountId, std::shared_ptr< WorldSocket > sock, AccountTypes sec, uint8 expansion, time_t mute_time, std::string os, LocaleConstant locale, uint32 recruiter, bool isARecruiter)
 WorldSession constructor. More...
 
 ~WorldSession ()
 WorldSession destructor. More...
 
bool PlayerLoading () const
 
bool PlayerLogout () const
 
bool PlayerLogoutWithSave () const
 
bool PlayerRecentlyLoggedOut () const
 
bool PlayerDisconnected () const
 
bool IsAddonRegistered (std::string_view prefix) const
 
void SendPacket (WorldPacket const *packet, bool forced=false)
 Send a packet to the client. More...
 
void AddInstanceConnection (std::shared_ptr< WorldSocket > sock)
 
void SendNotification (char const *format,...) ATTR_PRINTF(2
 
void void SendNotification (uint32 stringId,...)
 
void SendPetNameInvalid (uint32 error, std::string const &name, Optional< DeclinedName > const &declinedName)
 
void SendPartyResult (PartyOperation operation, std::string const &member, PartyResult res, uint32 val=0)
 
void SendQueryTimeResponse ()
 
void SendAuthResponse (uint32 code, bool queued, uint32 queuePos=0)
 
void SendClientCacheVersion (uint32 version)
 
void SendAvailableHotfixes ()
 
void InitializeSession ()
 
void InitializeSessionCallback (LoginDatabaseQueryHolder const &holder, CharacterDatabaseQueryHolder const &realmHolder)
 
rbac::RBACDataGetRBACData ()
 
bool HasPermission (uint32 permissionId)
 
void LoadPermissions ()
 
QueryCallback LoadPermissionsAsync ()
 
void InvalidateRBACData ()
 
AccountTypes GetSecurity () const
 
uint32 GetAccountId () const
 
ObjectGuid GetAccountGUID () const
 
std::string const & GetAccountName () const
 
uint32 GetBattlenetAccountId () const
 
ObjectGuid GetBattlenetAccountGUID () const
 
PlayerGetPlayer () const
 
std::string const & GetPlayerName () const
 
std::string GetPlayerInfo () const
 
void SetSecurity (AccountTypes security)
 
std::string const & GetRemoteAddress () const
 
void SetPlayer (Player *player)
 
uint8 GetAccountExpansion () const
 
uint8 GetExpansion () const
 
std::string const & GetOS () const
 
bool CanAccessAlliedRaces () const
 
WardenGetWarden ()
 
Warden const * GetWarden () const
 
void InitWarden (SessionKey const &k)
 
void SetInQueue (bool state)
 Session in auth.queue currently. More...
 
bool isLogingOut () const
 Is the user engaged in a log out process? More...
 
void SetLogoutStartTime (time_t requestTime)
 Engage the logout process for the user. More...
 
bool ShouldLogOut (time_t currTime) const
 Is logout cooldown expired? More...
 
void LogoutPlayer (bool save)
 Log the player out More...
 
void KickPlayer (std::string const &reason)
 Kick a player out of the World. More...
 
bool ValidateHyperlinksAndMaybeKick (std::string const &str)
 
bool DisallowHyperlinksAndMaybeKick (std::string const &str)
 
void QueuePacket (WorldPacket *new_packet)
 Add an incoming packet to the queue. More...
 
bool Update (uint32 diff, PacketFilter &updater)
 Update the WorldSession (triggered by World update) More...
 
void SendAuthWaitQueue (uint32 position)
 Handle the authentication waiting queue (to be completed) More...
 
void SendSetTimeZoneInformation ()
 
void SendFeatureSystemStatus ()
 
void SendFeatureSystemStatusGlueScreen ()
 
void BuildNameQueryData (ObjectGuid guid, WorldPackets::Query::NameCacheLookupResult &lookupData)
 
void SendTrainerList (Creature *npc, uint32 trainerId)
 
void SendListInventory (ObjectGuid guid)
 
void SendShowBank (ObjectGuid guid)
 
bool CanOpenMailBox (ObjectGuid guid)
 
void SendShowMailBox (ObjectGuid guid)
 
void SendTabardVendorActivate (ObjectGuid guid)
 
void SendSpiritResurrect ()
 
void SendBindPoint (Creature *npc)
 
void SendOpenTransmogrifier (ObjectGuid const &guid)
 
void SendAttackStop (Unit const *enemy)
 
void SendTradeStatus (WorldPackets::Trade::TradeStatus &status)
 
void SendUpdateTrade (bool trader_data=true)
 
void SendCancelTrade ()
 
void SendPetitionQueryOpcode (ObjectGuid petitionguid)
 
void SendQueryPetNameResponse (ObjectGuid guid)
 
void SendStablePet (ObjectGuid guid)
 
void SendPetStableResult (StableResult result)
 
bool CheckStableMaster (ObjectGuid guid)
 
AccountData const * GetAccountData (AccountDataType type) const
 
void SetAccountData (AccountDataType type, time_t time, std::string const &data)
 
void SendAccountDataTimes (ObjectGuid playerGuid, uint32 mask)
 
void LoadAccountData (PreparedQueryResult result, uint32 mask)
 
void LoadTutorialsData (PreparedQueryResult result)
 
void SendTutorialsData ()
 
void SaveTutorialsData (CharacterDatabaseTransaction trans)
 
uint32 GetTutorialInt (uint8 index) const
 
void SetTutorialInt (uint8 index, uint32 value)
 
void SendAuctionHello (ObjectGuid guid, Creature *unit)
 
void SendAuctionCommandResult (uint32 auctionId, AuctionCommand command, AuctionResult errorCode, Milliseconds delayForNextAction, InventoryResult bagError=InventoryResult(0))
 Notifies the client of the result of his last auction operation. It is called when the player bids, creates, or deletes an auction. More...
 
void SendAuctionClosedNotification (AuctionPosting const *auction, float mailDelay, bool sold)
 
void SendAuctionOwnerBidNotification (AuctionPosting const *auction)
 
void SendBlackMarketOpenResult (ObjectGuid guid, Creature *auctioneer)
 
void SendBlackMarketBidOnItemResult (int32 result, int32 marketId, WorldPackets::Item::ItemInstance &item)
 
void SendBlackMarketWonNotification (BlackMarketEntry const *entry, Item const *item)
 
void SendBlackMarketOutbidNotification (BlackMarketTemplate const *templ)
 
void SendEnchantmentLog (ObjectGuid owner, ObjectGuid caster, ObjectGuid itemGuid, uint32 itemId, uint32 enchantId, uint32 enchantSlot)
 
void SendItemEnchantTimeUpdate (ObjectGuid Playerguid, ObjectGuid Itemguid, uint32 slot, uint32 Duration)
 
void SendTaxiStatus (ObjectGuid guid)
 
void SendTaxiMenu (Creature *unit)
 
void SendDoFlight (uint32 mountDisplayId, uint32 path, uint32 pathNode=0)
 
bool SendLearnNewTaxiNode (Creature *unit)
 
void SendDiscoverNewTaxiNode (uint32 nodeid)
 
void SendPetitionShowList (ObjectGuid guid)
 
void DoLootRelease (Loot *loot)
 
void DoLootReleaseAll ()
 
bool CanSpeak () const
 
LocaleConstant GetSessionDbcLocale () const
 
LocaleConstant GetSessionDbLocaleIndex () const
 
char const * GetTrinityString (uint32 entry) const
 
uint32 GetLatency () const
 
void SetLatency (uint32 latency)
 
void ResetTimeOutTime (bool onlyActive)
 
bool IsConnectionIdle () const
 
uint32 GetRecruiterId () const
 
bool IsARecruiter () const
 
void ResetTimeSync ()
 
void SendTimeSync ()
 
uint32 AdjustClientMovementTime (uint32 time) const
 
time_t GetCalendarEventCreationCooldown () const
 
void SetCalendarEventCreationCooldown (time_t cooldown)
 
BattlePets::BattlePetMgrGetBattlePetMgr () const
 
CollectionMgrGetCollectionMgr () const
 
void Handle_NULL (WorldPackets::Null &null)
 
void Handle_EarlyProccess (WorldPackets::Null &null)
 
void LogUnprocessedTail (WorldPacket const *packet)
 Logging helper for unexpected opcodes. More...
 
void HandleCharEnum (CharacterDatabaseQueryHolder const &holder)
 
void HandleCharEnumOpcode (WorldPackets::Character::EnumCharacters &)
 
void HandleCharUndeleteEnumOpcode (WorldPackets::Character::EnumCharacters &)
 
void HandleCharDeleteOpcode (WorldPackets::Character::CharDelete &charDelete)
 
void HandleCharCreateOpcode (WorldPackets::Character::CreateCharacter &charCreate)
 
void HandlePlayerLoginOpcode (WorldPackets::Character::PlayerLogin &playerLogin)
 
void SendConnectToInstance (WorldPackets::Auth::ConnectToSerial serial)
 
void HandleContinuePlayerLogin ()
 
void AbortLogin (WorldPackets::Character::LoginFailureReason reason)
 
void HandleLoadScreenOpcode (WorldPackets::Character::LoadingScreenNotify &loadingScreenNotify)
 
void HandlePlayerLogin (LoginQueryHolder const &holder)
 
void HandleCheckCharacterNameAvailability (WorldPackets::Character::CheckCharacterNameAvailability &checkCharacterNameAvailability)
 
void HandleCharRenameOpcode (WorldPackets::Character::CharacterRenameRequest &request)
 
void HandleCharRenameCallBack (std::shared_ptr< WorldPackets::Character::CharacterRenameInfo > renameInfo, PreparedQueryResult result)
 
void HandleSetPlayerDeclinedNames (WorldPackets::Character::SetPlayerDeclinedNames &packet)
 
void HandleAlterAppearance (WorldPackets::Character::AlterApperance &packet)
 
void HandleCharCustomizeOpcode (WorldPackets::Character::CharCustomize &packet)
 
void HandleCharCustomizeCallback (std::shared_ptr< WorldPackets::Character::CharCustomizeInfo > customizeInfo, PreparedQueryResult result)
 
void HandleCharRaceOrFactionChangeOpcode (WorldPackets::Character::CharRaceOrFactionChange &packet)
 
void HandleCharRaceOrFactionChangeCallback (std::shared_ptr< WorldPackets::Character::CharRaceOrFactionChangeInfo > factionChangeInfo, PreparedQueryResult result)
 
void HandleRandomizeCharNameOpcode (WorldPackets::Character::GenerateRandomCharacterName &packet)
 
void HandleReorderCharacters (WorldPackets::Character::ReorderCharacters &reorderChars)
 
void HandleOpeningCinematic (WorldPackets::Misc::OpeningCinematic &packet)
 
void HandleGetUndeleteCooldownStatus (WorldPackets::Character::GetUndeleteCharacterCooldownStatus &)
 
void HandleUndeleteCooldownStatusCallback (PreparedQueryResult result)
 
void HandleCharUndeleteOpcode (WorldPackets::Character::UndeleteCharacter &undeleteInfo)
 
bool MeetsChrCustomizationReq (ChrCustomizationReqEntry const *req, Classes playerClass, bool checkRequiredDependentChoices, Trinity::IteratorPair< UF::ChrCustomizationChoice const * > selectedChoices) const
 
bool ValidateAppearance (Races race, Classes playerClass, Gender gender, Trinity::IteratorPair< UF::ChrCustomizationChoice const * > customizations)
 
void SendCharCreate (ResponseCodes result, ObjectGuid const &guid=ObjectGuid::Empty)
 
void SendCharDelete (ResponseCodes result)
 
void SendCharRename (ResponseCodes result, WorldPackets::Character::CharacterRenameInfo const *renameInfo)
 
void SendCharCustomize (ResponseCodes result, WorldPackets::Character::CharCustomizeInfo const *customizeInfo)
 
void SendCharFactionChange (ResponseCodes result, WorldPackets::Character::CharRaceOrFactionChangeInfo const *factionChangeInfo)
 
void SendSetPlayerDeclinedNamesResult (DeclinedNameResult result, ObjectGuid guid)
 
void SendUndeleteCooldownStatusResponse (uint32 currentCooldown, uint32 maxCooldown)
 
void SendUndeleteCharacterResponse (CharacterUndeleteResult result, WorldPackets::Character::CharacterUndeleteInfo const *undeleteInfo)
 
void HandlePlayedTime (WorldPackets::Character::RequestPlayedTime &packet)
 
void HandlePortGraveyard (WorldPackets::Misc::PortGraveyard &packet)
 
void HandleRequestCemeteryList (WorldPackets::Misc::RequestCemeteryList &packet)
 
void HandleInspectOpcode (WorldPackets::Inspect::Inspect &inspect)
 
void HandleQueryInspectAchievements (WorldPackets::Inspect::QueryInspectAchievements &inspect)
 
void HandleMountSpecialAnimOpcode (WorldPackets::Misc::MountSpecial &mountSpecial)
 
void HandleRepairItemOpcode (WorldPackets::Item::RepairItem &packet)
 
void HandleMoveKnockBackAck (WorldPackets::Movement::MoveKnockBackAck &movementAck)
 
void HandleMoveTeleportAck (WorldPackets::Movement::MoveTeleportAck &packet)
 
void HandleForceSpeedChangeAck (WorldPackets::Movement::MovementSpeedAck &packet)
 
void HandleSetCollisionHeightAck (WorldPackets::Movement::MoveSetCollisionHeightAck &setCollisionHeightAck)
 
void HandleMoveApplyMovementForceAck (WorldPackets::Movement::MoveApplyMovementForceAck &moveApplyMovementForceAck)
 
void HandleMoveRemoveMovementForceAck (WorldPackets::Movement::MoveRemoveMovementForceAck &moveRemoveMovementForceAck)
 
void HandleMoveSetModMovementForceMagnitudeAck (WorldPackets::Movement::MovementSpeedAck &setModMovementForceMagnitudeAck)
 
void HandleRepopRequest (WorldPackets::Misc::RepopRequest &packet)
 
void HandleAutostoreLootItemOpcode (WorldPackets::Loot::LootItem &packet)
 
void HandleLootMoneyOpcode (WorldPackets::Loot::LootMoney &packet)
 
void HandleLootOpcode (WorldPackets::Loot::LootUnit &packet)
 
void HandleLootReleaseOpcode (WorldPackets::Loot::LootRelease &packet)
 
void HandleLootMasterGiveOpcode (WorldPackets::Loot::MasterLootItem &masterLootItem)
 
void HandleSetLootSpecialization (WorldPackets::Loot::SetLootSpecialization &packet)
 
void HandleWhoOpcode (WorldPackets::Who::WhoRequestPkt &whoRequest)
 
void HandleLogoutRequestOpcode (WorldPackets::Character::LogoutRequest &logoutRequest)
 
void HandleLogoutCancelOpcode (WorldPackets::Character::LogoutCancel &logoutCancel)
 
void HandleGMTicketGetCaseStatusOpcode (WorldPackets::Ticket::GMTicketGetCaseStatus &packet)
 
void HandleGMTicketSystemStatusOpcode (WorldPackets::Ticket::GMTicketGetSystemStatus &packet)
 
void HandleSubmitUserFeedback (WorldPackets::Ticket::SubmitUserFeedback &userFeedback)
 
void HandleSupportTicketSubmitComplaint (WorldPackets::Ticket::SupportTicketSubmitComplaint &packet)
 
void HandleBugReportOpcode (WorldPackets::Ticket::BugReport &bugReport)
 
void HandleComplaint (WorldPackets::Ticket::Complaint &packet)
 
void HandleTogglePvP (WorldPackets::Misc::TogglePvP &packet)
 
void HandleSetPvP (WorldPackets::Misc::SetPvP &packet)
 
void HandleSetWarMode (WorldPackets::Misc::SetWarMode &packet)
 
void HandleSetSelectionOpcode (WorldPackets::Misc::SetSelection &packet)
 
void HandleStandStateChangeOpcode (WorldPackets::Misc::StandStateChange &packet)
 
void HandleEmoteOpcode (WorldPackets::Chat::EmoteClient &packet)
 
void HandleContactListOpcode (WorldPackets::Social::SendContactList &packet)
 
void HandleAddFriendOpcode (WorldPackets::Social::AddFriend &packet)
 
void HandleDelFriendOpcode (WorldPackets::Social::DelFriend &packet)
 
void HandleAddIgnoreOpcode (WorldPackets::Social::AddIgnore &packet)
 
void HandleDelIgnoreOpcode (WorldPackets::Social::DelIgnore &packet)
 
void HandleSetContactNotesOpcode (WorldPackets::Social::SetContactNotes &packet)
 
void HandleAreaTriggerOpcode (WorldPackets::AreaTrigger::AreaTrigger &packet)
 
void HandleSetFactionAtWar (WorldPackets::Character::SetFactionAtWar &packet)
 
void HandleSetFactionNotAtWar (WorldPackets::Character::SetFactionNotAtWar &packet)
 
void HandleSetFactionCheat (WorldPacket &recvData)
 
void HandleSetWatchedFactionOpcode (WorldPackets::Character::SetWatchedFaction &packet)
 
void HandleSetFactionInactiveOpcode (WorldPackets::Character::SetFactionInactive &packet)
 
void HandleRequestForcedReactionsOpcode (WorldPackets::Reputation::RequestForcedReactions &requestForcedReactions)
 
void HandleUpdateAccountData (WorldPackets::ClientConfig::UserClientUpdateAccountData &packet)
 
void HandleRequestAccountData (WorldPackets::ClientConfig::RequestAccountData &request)
 
void HandleSetAdvancedCombatLogging (WorldPackets::ClientConfig::SetAdvancedCombatLogging &setAdvancedCombatLogging)
 
void HandleSetActionButtonOpcode (WorldPackets::Spells::SetActionButton &packet)
 
void HandleGameObjectUseOpcode (WorldPackets::GameObject::GameObjUse &packet)
 
void HandleGameobjectReportUse (WorldPackets::GameObject::GameObjReportUse &packet)
 
void HandleQueryPlayerNames (WorldPackets::Query::QueryPlayerNames &queryPlayerNames)
 
void HandleQueryTimeOpcode (WorldPackets::Query::QueryTime &queryTime)
 
void HandleCreatureQuery (WorldPackets::Query::QueryCreature &packet)
 Only static data is sent in this packet !!! More...
 
void HandleGameObjectQueryOpcode (WorldPackets::Query::QueryGameObject &packet)
 Only static data is sent in this packet !!! More...
 
void HandleDBQueryBulk (WorldPackets::Hotfix::DBQueryBulk &dbQuery)
 
void HandleHotfixRequest (WorldPackets::Hotfix::HotfixRequest &hotfixQuery)
 
void HandleMoveWorldportAckOpcode (WorldPackets::Movement::WorldPortResponse &packet)
 
void HandleMoveWorldportAck ()
 
void HandleSuspendTokenResponse (WorldPackets::Movement::SuspendTokenResponse &suspendTokenResponse)
 
void HandleMovementOpcodes (WorldPackets::Movement::ClientPlayerMovement &packet)
 
void HandleMovementOpcode (OpcodeClient opcode, MovementInfo &movementInfo)
 
void HandleSetActiveMoverOpcode (WorldPackets::Movement::SetActiveMover &packet)
 
void HandleMoveDismissVehicle (WorldPackets::Vehicle::MoveDismissVehicle &moveDismissVehicle)
 
void HandleRequestVehiclePrevSeat (WorldPackets::Vehicle::RequestVehiclePrevSeat &requestVehiclePrevSeat)
 
void HandleRequestVehicleNextSeat (WorldPackets::Vehicle::RequestVehicleNextSeat &requestVehicleNextSeat)
 
void HandleMoveChangeVehicleSeats (WorldPackets::Vehicle::MoveChangeVehicleSeats &moveChangeVehicleSeats)
 
void HandleRequestVehicleSwitchSeat (WorldPackets::Vehicle::RequestVehicleSwitchSeat &requestVehicleSwitchSeat)
 
void HandleRideVehicleInteract (WorldPackets::Vehicle::RideVehicleInteract &rideVehicleInteract)
 
void HandleEjectPassenger (WorldPackets::Vehicle::EjectPassenger &ejectPassenger)
 
void HandleRequestVehicleExit (WorldPackets::Vehicle::RequestVehicleExit &requestVehicleExit)
 
void HandleMoveSetVehicleRecAck (WorldPackets::Vehicle::MoveSetVehicleRecIdAck &setVehicleRecIdAck)
 
void HandleMoveTimeSkippedOpcode (WorldPackets::Movement::MoveTimeSkipped &moveTimeSkipped)
 
void HandleMovementAckMessage (WorldPackets::Movement::MovementAckMessage &movementAck)
 
void HandleMoveInitActiveMoverComplete (WorldPackets::Movement::MoveInitActiveMoverComplete &moveInitActiveMoverComplete)
 
void HandleRequestRaidInfoOpcode (WorldPackets::Party::RequestRaidInfo &packet)
 
void HandlePartyInviteOpcode (WorldPackets::Party::PartyInviteClient &packet)
 
void HandlePartyInviteResponseOpcode (WorldPackets::Party::PartyInviteResponse &packet)
 
void HandlePartyUninviteOpcode (WorldPackets::Party::PartyUninvite &packet)
 
void HandleSetPartyLeaderOpcode (WorldPackets::Party::SetPartyLeader &packet)
 
void HandleSetRoleOpcode (WorldPackets::Party::SetRole &packet)
 
void HandleLeaveGroupOpcode (WorldPackets::Party::LeaveGroup &packet)
 
void HandleOptOutOfLootOpcode (WorldPackets::Party::OptOutOfLoot &packet)
 
void HandleSetLootMethodOpcode (WorldPackets::Party::SetLootMethod &packet)
 
void HandleLootRoll (WorldPackets::Loot::LootRoll &packet)
 
void HandleRequestPartyMemberStatsOpcode (WorldPackets::Party::RequestPartyMemberStats &packet)
 
void HandleUpdateRaidTargetOpcode (WorldPackets::Party::UpdateRaidTarget &packet)
 
void HandleDoReadyCheckOpcode (WorldPackets::Party::DoReadyCheck &packet)
 
void HandleReadyCheckResponseOpcode (WorldPackets::Party::ReadyCheckResponseClient &packet)
 
void HandleConvertRaidOpcode (WorldPackets::Party::ConvertRaid &packet)
 
void HandleRequestPartyJoinUpdates (WorldPackets::Party::RequestPartyJoinUpdates &packet)
 
void HandleChangeSubGroupOpcode (WorldPackets::Party::ChangeSubGroup &packet)
 
void HandleSwapSubGroupsOpcode (WorldPackets::Party::SwapSubGroups &packet)
 
void HandleSetAssistantLeaderOpcode (WorldPackets::Party::SetAssistantLeader &packet)
 
void HandleSetPartyAssignment (WorldPackets::Party::SetPartyAssignment &packet)
 
void HandleInitiateRolePoll (WorldPackets::Party::InitiateRolePoll &packet)
 
void HandleSetEveryoneIsAssistant (WorldPackets::Party::SetEveryoneIsAssistant &packet)
 
void HandleClearRaidMarker (WorldPackets::Party::ClearRaidMarker &packet)
 
void HandlePetitionBuy (WorldPackets::Petition::PetitionBuy &packet)
 
void HandlePetitionShowSignatures (WorldPackets::Petition::PetitionShowSignatures &packet)
 
void SendPetitionSigns (Petition const *petition, Player *sendTo)
 
void HandleQueryPetition (WorldPackets::Petition::QueryPetition &packet)
 
void HandlePetitionRenameGuild (WorldPackets::Petition::PetitionRenameGuild &packet)
 
void HandleSignPetition (WorldPackets::Petition::SignPetition &packet)
 
void HandleDeclinePetition (WorldPackets::Petition::DeclinePetition &packet)
 
void HandleOfferPetition (WorldPackets::Petition::OfferPetition &packet)
 
void HandleTurnInPetition (WorldPackets::Petition::TurnInPetition &packet)
 
void HandleGuildQueryOpcode (WorldPackets::Guild::QueryGuildInfo &query)
 
void HandleGuildInviteByName (WorldPackets::Guild::GuildInviteByName &packet)
 
void HandleGuildOfficerRemoveMember (WorldPackets::Guild::GuildOfficerRemoveMember &packet)
 
void HandleGuildAcceptInvite (WorldPackets::Guild::AcceptGuildInvite &invite)
 
void HandleGuildDeclineInvitation (WorldPackets::Guild::GuildDeclineInvitation &decline)
 
void HandleGuildEventLogQuery (WorldPackets::Guild::GuildEventLogQuery &packet)
 
void HandleGuildGetRoster (WorldPackets::Guild::GuildGetRoster &packet)
 
void HandleRequestGuildRewardsList (WorldPackets::Guild::RequestGuildRewardsList &packet)
 
void HandleGuildPromoteMember (WorldPackets::Guild::GuildPromoteMember &promote)
 
void HandleGuildDemoteMember (WorldPackets::Guild::GuildDemoteMember &demote)
 
void HandleGuildAssignRank (WorldPackets::Guild::GuildAssignMemberRank &packet)
 
void HandleGuildLeave (WorldPackets::Guild::GuildLeave &leave)
 
void HandleGuildDelete (WorldPackets::Guild::GuildDelete &packet)
 
void HandleGuildReplaceGuildMaster (WorldPackets::Guild::GuildReplaceGuildMaster &replaceGuildMaster)
 
void HandleGuildSetAchievementTracking (WorldPackets::Guild::GuildSetAchievementTracking &packet)
 
void HandleGuildGetAchievementMembers (WorldPackets::Achievement::GuildGetAchievementMembers &getAchievementMembers)
 
void HandleGuildSetGuildMaster (WorldPackets::Guild::GuildSetGuildMaster &packet)
 
void HandleGuildUpdateMotdText (WorldPackets::Guild::GuildUpdateMotdText &packet)
 
void HandleGuildNewsUpdateSticky (WorldPackets::Guild::GuildNewsUpdateSticky &packet)
 
void HandleGuildSetMemberNote (WorldPackets::Guild::GuildSetMemberNote &packet)
 
void HandleGuildGetRanks (WorldPackets::Guild::GuildGetRanks &packet)
 
void HandleGuildQueryNews (WorldPackets::Guild::GuildQueryNews &newsQuery)
 
void HandleGuildSetRankPermissions (WorldPackets::Guild::GuildSetRankPermissions &packet)
 
void HandleGuildAddRank (WorldPackets::Guild::GuildAddRank &packet)
 
void HandleGuildDeleteRank (WorldPackets::Guild::GuildDeleteRank &packet)
 
void HandleGuildShiftRank (WorldPackets::Guild::GuildShiftRank &shiftRank)
 
void HandleGuildUpdateInfoText (WorldPackets::Guild::GuildUpdateInfoText &packet)
 
void HandleSaveGuildEmblem (WorldPackets::Guild::SaveGuildEmblem &packet)
 
void HandleGuildRequestPartyState (WorldPackets::Guild::RequestGuildPartyState &packet)
 
void HandleGuildChallengeUpdateRequest (WorldPackets::Guild::GuildChallengeUpdateRequest &packet)
 
void HandleDeclineGuildInvites (WorldPackets::Guild::DeclineGuildInvites &packet)
 
void HandleEnableTaxiNodeOpcode (WorldPackets::Taxi::EnableTaxiNode &enableTaxiNode)
 
void HandleTaxiNodeStatusQueryOpcode (WorldPackets::Taxi::TaxiNodeStatusQuery &taxiNodeStatusQuery)
 
void HandleTaxiQueryAvailableNodesOpcode (WorldPackets::Taxi::TaxiQueryAvailableNodes &taxiQueryAvailableNodes)
 
void HandleActivateTaxiOpcode (WorldPackets::Taxi::ActivateTaxi &activateTaxi)
 
void HandleMoveSplineDoneOpcode (WorldPackets::Movement::MoveSplineDone &moveSplineDone)
 
void SendActivateTaxiReply (ActivateTaxiReply reply)
 
void HandleTaxiRequestEarlyLanding (WorldPackets::Taxi::TaxiRequestEarlyLanding &taxiRequestEarlyLanding)
 
void HandleTabardVendorActivateOpcode (WorldPackets::NPC::Hello &packet)
 
void HandleBankerActivateOpcode (WorldPackets::NPC::Hello &packet)
 
void HandleTrainerListOpcode (WorldPackets::NPC::Hello &packet)
 
void HandleTrainerBuySpellOpcode (WorldPackets::NPC::TrainerBuySpell &packet)
 
void HandlePetitionShowList (WorldPackets::Petition::PetitionShowList &packet)
 
void HandleGossipHelloOpcode (WorldPackets::NPC::Hello &packet)
 
void HandleGossipSelectOptionOpcode (WorldPackets::NPC::GossipSelectOption &packet)
 
void HandleSpiritHealerActivate (WorldPackets::NPC::SpiritHealerActivate &packet)
 
void HandleNpcTextQueryOpcode (WorldPackets::Query::QueryNPCText &packet)
 
void HandleBinderActivateOpcode (WorldPackets::NPC::Hello &packet)
 
void HandleRequestStabledPets (WorldPackets::NPC::RequestStabledPets &packet)
 
void HandleSetPetSlot (WorldPackets::NPC::SetPetSlot &setPetSlot)
 
void HandleCanDuel (WorldPackets::Duel::CanDuel &packet)
 
void HandleDuelResponseOpcode (WorldPackets::Duel::DuelResponse &duelResponse)
 
void HandleDuelAccepted (ObjectGuid arbiterGuid)
 
void HandleDuelCancelled ()
 
void HandleAcceptTradeOpcode (WorldPackets::Trade::AcceptTrade &acceptTrade)
 
void HandleBeginTradeOpcode (WorldPackets::Trade::BeginTrade &beginTrade)
 
void HandleBusyTradeOpcode (WorldPackets::Trade::BusyTrade &busyTrade)
 
void HandleCancelTradeOpcode (WorldPackets::Trade::CancelTrade &cancelTrade)
 
void HandleClearTradeItemOpcode (WorldPackets::Trade::ClearTradeItem &clearTradeItem)
 
void HandleIgnoreTradeOpcode (WorldPackets::Trade::IgnoreTrade &ignoreTrade)
 
void HandleInitiateTradeOpcode (WorldPackets::Trade::InitiateTrade &initiateTrade)
 
void HandleSetTradeCurrencyOpcode (WorldPackets::Trade::SetTradeCurrency &setTradeCurrency)
 
void HandleSetTradeGoldOpcode (WorldPackets::Trade::SetTradeGold &setTradeGold)
 
void HandleSetTradeItemOpcode (WorldPackets::Trade::SetTradeItem &setTradeItem)
 
void HandleUnacceptTradeOpcode (WorldPackets::Trade::UnacceptTrade &unacceptTrade)
 
void HandleAuctionBrowseQuery (WorldPackets::AuctionHouse::AuctionBrowseQuery &browseQuery)
 
void HandleAuctionCancelCommoditiesPurchase (WorldPackets::AuctionHouse::AuctionCancelCommoditiesPurchase &cancelCommoditiesPurchase)
 
void HandleAuctionConfirmCommoditiesPurchase (WorldPackets::AuctionHouse::AuctionConfirmCommoditiesPurchase &confirmCommoditiesPurchase)
 
void HandleAuctionGetCommodityQuote (WorldPackets::AuctionHouse::AuctionGetCommodityQuote &startCommoditiesPurchase)
 
void HandleAuctionHelloOpcode (WorldPackets::AuctionHouse::AuctionHelloRequest &hello)
 
void HandleAuctionListBiddedItems (WorldPackets::AuctionHouse::AuctionListBiddedItems &listBiddedItems)
 
void HandleAuctionListBucketsByBucketKeys (WorldPackets::AuctionHouse::AuctionListBucketsByBucketKeys &listBucketsByBucketKeys)
 
void HandleAuctionListItemsByBucketKey (WorldPackets::AuctionHouse::AuctionListItemsByBucketKey &listItemsByBucketKey)
 
void HandleAuctionListItemsByItemID (WorldPackets::AuctionHouse::AuctionListItemsByItemID &listItemsByItemID)
 
void HandleAuctionListOwnedItems (WorldPackets::AuctionHouse::AuctionListOwnedItems &listOwnedItems)
 
void HandleAuctionPlaceBid (WorldPackets::AuctionHouse::AuctionPlaceBid &placeBid)
 
void HandleAuctionRemoveItem (WorldPackets::AuctionHouse::AuctionRemoveItem &removeItem)
 
void HandleAuctionReplicateItems (WorldPackets::AuctionHouse::AuctionReplicateItems &replicateItems)
 
void HandleAuctionRequestFavoriteList (WorldPackets::AuctionHouse::AuctionRequestFavoriteList &requestFavoriteList)
 
void HandleAuctionSellCommodity (WorldPackets::AuctionHouse::AuctionSellCommodity &sellCommodity)
 
void HandleAuctionSellItem (WorldPackets::AuctionHouse::AuctionSellItem &sellItem)
 
void HandleAuctionSetFavoriteItem (WorldPackets::AuctionHouse::AuctionSetFavoriteItem &setFavoriteItem)
 
void HandleAutoBankItemOpcode (WorldPackets::Bank::AutoBankItem &packet)
 
void HandleAutoStoreBankItemOpcode (WorldPackets::Bank::AutoStoreBankItem &packet)
 
void HandleBuyBankSlotOpcode (WorldPackets::Bank::BuyBankSlot &packet)
 
void HandleBuyReagentBankOpcode (WorldPackets::Bank::ReagentBank &reagentBank)
 
void HandleAutoBankReagentOpcode (WorldPackets::Bank::AutoBankReagent &autoBankRegent)
 
void HandleAutoStoreBankReagentOpcode (WorldPackets::Bank::AutoStoreBankReagent &autoStoreBankReagent)
 
void HandleReagentBankDepositOpcode (WorldPackets::Bank::ReagentBank &reagentBank)
 
void HandleBlackMarketOpen (WorldPackets::BlackMarket::BlackMarketOpen &blackMarketOpen)
 
void HandleBlackMarketRequestItems (WorldPackets::BlackMarket::BlackMarketRequestItems &blackMarketRequestItems)
 
void HandleBlackMarketBidOnItem (WorldPackets::BlackMarket::BlackMarketBidOnItem &blackMarketBidOnItem)
 
void HandleGetMailList (WorldPackets::Mail::MailGetList &getList)
 
void HandleSendMail (WorldPackets::Mail::SendMail &sendMail)
 
void HandleMailTakeMoney (WorldPackets::Mail::MailTakeMoney &takeMoney)
 
void HandleMailTakeItem (WorldPackets::Mail::MailTakeItem &takeItem)
 
void HandleMailMarkAsRead (WorldPackets::Mail::MailMarkAsRead &markAsRead)
 
void HandleMailReturnToSender (WorldPackets::Mail::MailReturnToSender &returnToSender)
 
void HandleMailDelete (WorldPackets::Mail::MailDelete &mailDelete)
 
void HandleItemTextQuery (WorldPackets::Query::ItemTextQuery &itemTextQuery)
 
void HandleMailCreateTextItem (WorldPackets::Mail::MailCreateTextItem &createTextItem)
 
void HandleQueryNextMailTime (WorldPackets::Mail::MailQueryNextMailTime &queryNextMailTime)
 
void HandleCancelChanneling (WorldPackets::Spells::CancelChannelling &cancelChanneling)
 
void HandleSplitItemOpcode (WorldPackets::Item::SplitItem &splitItem)
 
void HandleSwapInvItemOpcode (WorldPackets::Item::SwapInvItem &swapInvItem)
 
void HandleDestroyItemOpcode (WorldPackets::Item::DestroyItem &destroyItem)
 
void HandleAutoEquipItemOpcode (WorldPackets::Item::AutoEquipItem &autoEquipItem)
 
void HandleSellItemOpcode (WorldPackets::Item::SellItem &packet)
 
void HandleBuyItemOpcode (WorldPackets::Item::BuyItem &packet)
 
void HandleListInventoryOpcode (WorldPackets::NPC::Hello &packet)
 
void HandleAutoStoreBagItemOpcode (WorldPackets::Item::AutoStoreBagItem &packet)
 
void HandleReadItem (WorldPackets::Item::ReadItem &readItem)
 
void HandleAutoEquipItemSlotOpcode (WorldPackets::Item::AutoEquipItemSlot &autoEquipItemSlot)
 
void HandleSwapItem (WorldPackets::Item::SwapItem &swapItem)
 
void HandleBuybackItem (WorldPackets::Item::BuyBackItem &packet)
 
void HandleWrapItem (WorldPackets::Item::WrapItem &packet)
 
void HandleUseCritterItem (WorldPackets::Item::UseCritterItem &packet)
 
void HandleAttackSwingOpcode (WorldPackets::Combat::AttackSwing &packet)
 
void HandleAttackStopOpcode (WorldPackets::Combat::AttackStop &packet)
 
void HandleSetSheathedOpcode (WorldPackets::Combat::SetSheathed &packet)
 
void HandleUseItemOpcode (WorldPackets::Spells::UseItem &packet)
 
void HandleOpenItemOpcode (WorldPackets::Spells::OpenItem &packet)
 
void HandleOpenWrappedItemCallback (uint16 pos, ObjectGuid itemGuid, PreparedQueryResult result)
 
void HandleCastSpellOpcode (WorldPackets::Spells::CastSpell &castRequest)
 
void HandleCancelCastOpcode (WorldPackets::Spells::CancelCast &packet)
 
void HandleCancelAuraOpcode (WorldPackets::Spells::CancelAura &cancelAura)
 
void HandleCancelGrowthAuraOpcode (WorldPackets::Spells::CancelGrowthAura &cancelGrowthAura)
 
void HandleCancelMountAuraOpcode (WorldPackets::Spells::CancelMountAura &cancelMountAura)
 
void HandleCancelModSpeedNoControlAuras (WorldPackets::Spells::CancelModSpeedNoControlAuras &cancelModSpeedNoControlAuras)
 
void HandleCancelAutoRepeatSpellOpcode (WorldPackets::Spells::CancelAutoRepeatSpell &cancelAutoRepeatSpell)
 
void HandleMissileTrajectoryCollision (WorldPackets::Spells::MissileTrajectoryCollision &packet)
 
void HandleUpdateMissileTrajectory (WorldPackets::Spells::UpdateMissileTrajectory &packet)
 
void HandleLearnPvpTalentsOpcode (WorldPackets::Talent::LearnPvpTalents &packet)
 
void HandleLearnTalentsOpcode (WorldPackets::Talent::LearnTalents &packet)
 
void HandleConfirmRespecWipeOpcode (WorldPackets::Talent::ConfirmRespecWipe &confirmRespecWipe)
 
void HandleUnlearnSkillOpcode (WorldPackets::Spells::UnlearnSkill &packet)
 
void HandleTradeSkillSetFavorite (WorldPackets::Spells::TradeSkillSetFavorite const &tradeSkillSetFavorite)
 
void HandleTraitsCommitConfig (WorldPackets::Traits::TraitsCommitConfig const &traitsCommitConfig)
 
void HandleClassTalentsRequestNewConfig (WorldPackets::Traits::ClassTalentsRequestNewConfig &classTalentsRequestNewConfig)
 
void HandleClassTalentsRenameConfig (WorldPackets::Traits::ClassTalentsRenameConfig &classTalentsRenameConfig)
 
void HandleClassTalentsDeleteConfig (WorldPackets::Traits::ClassTalentsDeleteConfig const &classTalentsDeleteConfig)
 
void HandleClassTalentsSetStarterBuildActive (WorldPackets::Traits::ClassTalentsSetStarterBuildActive const &classTalentsSetStarterBuildActive)
 
void HandleClassTalentsSetUsesSharedActionBars (WorldPackets::Traits::ClassTalentsSetUsesSharedActionBars const &classTalentsSetUsesSharedActionBars)
 
void HandleQuestgiverStatusQueryOpcode (WorldPackets::Quest::QuestGiverStatusQuery &packet)
 
void HandleQuestgiverStatusMultipleQuery (WorldPackets::Quest::QuestGiverStatusMultipleQuery &packet)
 
void HandleQuestgiverStatusTrackedQueryOpcode (WorldPackets::Quest::QuestGiverStatusTrackedQuery &questGiverStatusTrackedQuery)
 
void HandleQuestgiverHelloOpcode (WorldPackets::Quest::QuestGiverHello &packet)
 
void HandleQuestgiverAcceptQuestOpcode (WorldPackets::Quest::QuestGiverAcceptQuest &packet)
 
void HandleQuestgiverQueryQuestOpcode (WorldPackets::Quest::QuestGiverQueryQuest &packet)
 
void HandleQuestgiverChooseRewardOpcode (WorldPackets::Quest::QuestGiverChooseReward &packet)
 
void HandleQuestgiverRequestRewardOpcode (WorldPackets::Quest::QuestGiverRequestReward &packet)
 
void HandleQuestQueryOpcode (WorldPackets::Quest::QueryQuestInfo &packet)
 
void HandleQuestLogRemoveQuest (WorldPackets::Quest::QuestLogRemoveQuest &packet)
 
void HandleQuestConfirmAccept (WorldPackets::Quest::QuestConfirmAccept &packet)
 
void HandleQuestgiverCompleteQuest (WorldPackets::Quest::QuestGiverCompleteQuest &packet)
 
void HandleQuestgiverCloseQuest (WorldPackets::Quest::QuestGiverCloseQuest &questGiverCloseQuest)
 
void HandlePushQuestToParty (WorldPackets::Quest::PushQuestToParty &packet)
 
void HandleQuestPushResult (WorldPackets::Quest::QuestPushResult &packet)
 
void HandleRequestWorldQuestUpdate (WorldPackets::Quest::RequestWorldQuestUpdate &packet)
 
void HandlePlayerChoiceResponse (WorldPackets::Quest::ChoiceResponse &choiceResponse)
 
void HandleChatMessageOpcode (WorldPackets::Chat::ChatMessage &chatMessage)
 
void HandleChatMessageWhisperOpcode (WorldPackets::Chat::ChatMessageWhisper &chatMessageWhisper)
 
void HandleChatMessageChannelOpcode (WorldPackets::Chat::ChatMessageChannel &chatMessageChannel)
 
void HandleChatMessage (ChatMsg type, Language lang, std::string msg, std::string target="", Optional< ObjectGuid > channelGuid={})
 
void HandleChatAddonMessageOpcode (WorldPackets::Chat::ChatAddonMessage &chatAddonMessage)
 
void HandleChatAddonMessageTargetedOpcode (WorldPackets::Chat::ChatAddonMessageTargeted &chatAddonMessageTargeted)
 
void HandleChatAddonMessage (ChatMsg type, std::string prefix, std::string text, bool isLogged, std::string target="", Optional< ObjectGuid > channelGuid={})
 
void HandleChatMessageAFKOpcode (WorldPackets::Chat::ChatMessageAFK &chatMessageAFK)
 
void HandleChatMessageDNDOpcode (WorldPackets::Chat::ChatMessageDND &chatMessageDND)
 
void HandleChatMessageEmoteOpcode (WorldPackets::Chat::ChatMessageEmote &chatMessageEmote)
 
void SendChatPlayerNotfoundNotice (std::string const &name)
 
void SendPlayerAmbiguousNotice (std::string const &name)
 
void SendChatRestricted (ChatRestrictionType restriction)
 
void HandleTextEmoteOpcode (WorldPackets::Chat::CTextEmote &packet)
 
void HandleChatIgnoredOpcode (WorldPackets::Chat::ChatReportIgnored &chatReportIgnored)
 
void HandleUnregisterAllAddonPrefixesOpcode (WorldPackets::Chat::ChatUnregisterAllAddonPrefixes &packet)
 
void HandleAddonRegisteredPrefixesOpcode (WorldPackets::Chat::ChatRegisterAddonPrefixes &packet)
 
void HandleReclaimCorpse (WorldPackets::Misc::ReclaimCorpse &packet)
 
void HandleQueryCorpseLocation (WorldPackets::Query::QueryCorpseLocationFromClient &packet)
 
void HandleQueryCorpseTransport (WorldPackets::Query::QueryCorpseTransport &packet)
 
void HandleResurrectResponse (WorldPackets::Misc::ResurrectResponse &packet)
 
void HandleSummonResponseOpcode (WorldPackets::Movement::SummonResponse &packet)
 
void HandleJoinChannel (WorldPackets::Channel::JoinChannel &packet)
 
void HandleLeaveChannel (WorldPackets::Channel::LeaveChannel &packet)
 
void HandleChannelCommand (WorldPackets::Channel::ChannelCommand &packet)
 
void HandleChannelPlayerCommand (WorldPackets::Channel::ChannelPlayerCommand &packet)
 
void HandleChannelPassword (WorldPackets::Channel::ChannelPassword &channelPassword)
 
void HandleCompleteCinematic (WorldPackets::Misc::CompleteCinematic &packet)
 
void HandleNextCinematicCamera (WorldPackets::Misc::NextCinematicCamera &packet)
 
void HandleCompleteMovie (WorldPackets::Misc::CompleteMovie &packet)
 
void HandleQueryPageText (WorldPackets::Query::QueryPageText &packet)
 Only static data is sent in this packet !!! More...
 
void HandleTutorialFlag (WorldPackets::Misc::TutorialSetFlag &packet)
 
void HandlePetAction (WorldPackets::Pet::PetAction &packet)
 
void HandlePetStopAttack (WorldPackets::Pet::PetStopAttack &packet)
 
void HandlePetActionHelper (Unit *pet, ObjectGuid guid1, uint32 spellid, uint16 flag, ObjectGuid guid2, Position const &pos)
 
void HandleQueryPetName (WorldPackets::Query::QueryPetName &packet)
 
void HandlePetSetAction (WorldPackets::Pet::PetSetAction &packet)
 
void HandlePetAbandon (WorldPackets::Pet::PetAbandon &packet)
 
void HandlePetRename (WorldPackets::Pet::PetRename &packet)
 
void HandlePetCancelAuraOpcode (WorldPackets::Spells::PetCancelAura &packet)
 
void HandlePetSpellAutocastOpcode (WorldPackets::Pet::PetSpellAutocast &packet)
 
void HandlePetCastSpellOpcode (WorldPackets::Spells::PetCastSpell &petCastSpell)
 
void HandleSetActionBarToggles (WorldPackets::Character::SetActionBarToggles &packet)
 
void HandleTotemDestroyed (WorldPackets::Totem::TotemDestroyed &totemDestroyed)
 
void HandleDismissCritter (WorldPackets::Pet::DismissCritter &dismissCritter)
 
void HandleBattlemasterHelloOpcode (WorldPackets::NPC::Hello &hello)
 
void HandleBattlemasterJoinOpcode (WorldPackets::Battleground::BattlemasterJoin &battlemasterJoin)
 
void HandlePVPLogDataOpcode (WorldPackets::Battleground::PVPLogDataRequest &pvpLogDataRequest)
 
void HandleBattleFieldPortOpcode (WorldPackets::Battleground::BattlefieldPort &battlefieldPort)
 
void HandleBattlefieldListOpcode (WorldPackets::Battleground::BattlefieldListRequest &battlefieldList)
 
void HandleBattlefieldLeaveOpcode (WorldPackets::Battleground::BattlefieldLeave &battlefieldLeave)
 
void HandleBattlemasterJoinArena (WorldPackets::Battleground::BattlemasterJoinArena &packet)
 
void HandleReportPvPAFK (WorldPackets::Battleground::ReportPvPPlayerAFK &reportPvPPlayerAFK)
 
void HandleRequestRatedPvpInfo (WorldPackets::Battleground::RequestRatedPvpInfo &packet)
 
void HandleGetPVPOptionsEnabled (WorldPackets::Battleground::GetPVPOptionsEnabled &getPvPOptionsEnabled)
 
void HandleRequestPvpReward (WorldPackets::Battleground::RequestPVPRewards &packet)
 
void HandleAreaSpiritHealerQueryOpcode (WorldPackets::Battleground::AreaSpiritHealerQuery &areaSpiritHealerQuery)
 
void HandleAreaSpiritHealerQueueOpcode (WorldPackets::Battleground::AreaSpiritHealerQueue &areaSpiritHealerQueue)
 
void HandleHearthAndResurrect (WorldPackets::Battleground::HearthAndResurrect &hearthAndResurrect)
 
void HandleRequestBattlefieldStatusOpcode (WorldPackets::Battleground::RequestBattlefieldStatus &requestBattlefieldStatus)
 
void HandleMinimapPingOpcode (WorldPackets::Party::MinimapPingClient &packet)
 
void HandleRandomRollOpcode (WorldPackets::Misc::RandomRollClient &packet)
 
void HandleFarSightOpcode (WorldPackets::Misc::FarSight &packet)
 
void HandleSetDungeonDifficultyOpcode (WorldPackets::Misc::SetDungeonDifficulty &setDungeonDifficulty)
 
void HandleSetRaidDifficultyOpcode (WorldPackets::Misc::SetRaidDifficulty &setRaidDifficulty)
 
void HandleSetTitleOpcode (WorldPackets::Character::SetTitle &packet)
 
void HandleTimeSyncResponse (WorldPackets::Misc::TimeSyncResponse &timeSyncResponse)
 
void HandleWhoIsOpcode (WorldPackets::Who::WhoIsRequest &packet)
 
void HandleResetInstancesOpcode (WorldPackets::Instance::ResetInstances &packet)
 
void HandleInstanceLockResponse (WorldPackets::Instance::InstanceLockResponse &packet)
 
void SendLfgPlayerLockInfo ()
 
void SendLfgPartyLockInfo ()
 
void HandleLfgJoinOpcode (WorldPackets::LFG::DFJoin &dfJoin)
 
void HandleLfgLeaveOpcode (WorldPackets::LFG::DFLeave &dfLeave)
 
void HandleLfgProposalResultOpcode (WorldPackets::LFG::DFProposalResponse &dfProposalResponse)
 
void HandleLfgSetRolesOpcode (WorldPackets::LFG::DFSetRoles &dfSetRoles)
 
void HandleLfgSetBootVoteOpcode (WorldPackets::LFG::DFBootPlayerVote &dfBootPlayerVote)
 
void HandleLfgTeleportOpcode (WorldPackets::LFG::DFTeleport &dfTeleport)
 
void HandleDFGetSystemInfo (WorldPackets::LFG::DFGetSystemInfo &dfGetSystemInfo)
 
void HandleDFGetJoinStatus (WorldPackets::LFG::DFGetJoinStatus &dfGetJoinStatus)
 
void SendLfgUpdateStatus (lfg::LfgUpdateData const &updateData, bool party)
 
void SendLfgRoleChosen (ObjectGuid guid, uint8 roles)
 
void SendLfgRoleCheckUpdate (lfg::LfgRoleCheck const &pRoleCheck)
 
void SendLfgJoinResult (lfg::LfgJoinResultData const &joinData)
 
void SendLfgQueueStatus (lfg::LfgQueueStatusData const &queueData)
 
void SendLfgPlayerReward (lfg::LfgPlayerRewardData const &lfgPlayerRewardData)
 
void SendLfgBootProposalUpdate (lfg::LfgPlayerBoot const &boot)
 
void SendLfgUpdateProposal (lfg::LfgProposal const &proposal)
 
void SendLfgDisabled ()
 
void SendLfgOfferContinue (uint32 dungeonEntry)
 
void SendLfgTeleportError (lfg::LfgTeleportResult err)
 
void HandleSelfResOpcode (WorldPackets::Spells::SelfRes &selfRes)
 
void HandleRequestPetInfo (WorldPackets::Pet::RequestPetInfo &requestPetInfo)
 
void HandleSocketGems (WorldPackets::Item::SocketGems &socketGems)
 
void HandleSortBags (WorldPackets::Item::SortBags &sortBags)
 
void HandleSortBankBags (WorldPackets::Item::SortBankBags &sortBankBags)
 
void HandleSortReagentBankBags (WorldPackets::Item::SortReagentBankBags &sortReagentBankBags)
 
void HandleRemoveNewItem (WorldPackets::Item::RemoveNewItem &removeNewItem)
 
void HandleCancelTempEnchantmentOpcode (WorldPackets::Item::CancelTempEnchantment &cancelTempEnchantment)
 
void HandleGetItemPurchaseData (WorldPackets::Item::GetItemPurchaseData &packet)
 
void HandleItemRefund (WorldPackets::Item::ItemPurchaseRefund &packet)
 
void HandleSetTaxiBenchmark (WorldPackets::Misc::SetTaxiBenchmarkMode &packet)
 
void HandleGuildPermissionsQuery (WorldPackets::Guild::GuildPermissionsQuery &packet)
 
void HandleGuildBankMoneyWithdrawn (WorldPackets::Guild::GuildBankRemainingWithdrawMoneyQuery &packet)
 
void HandleGuildBankActivate (WorldPackets::Guild::GuildBankActivate &packet)
 
void HandleGuildBankQueryTab (WorldPackets::Guild::GuildBankQueryTab &packet)
 
void HandleGuildBankLogQuery (WorldPackets::Guild::GuildBankLogQuery &packet)
 
void HandleGuildBankDepositMoney (WorldPackets::Guild::GuildBankDepositMoney &packet)
 
void HandleGuildBankWithdrawMoney (WorldPackets::Guild::GuildBankWithdrawMoney &packet)
 
void HandleAutoGuildBankItem (WorldPackets::Guild::AutoGuildBankItem &autoGuildBankItem)
 
void HandleStoreGuildBankItem (WorldPackets::Guild::StoreGuildBankItem &storeGuildBankItem)
 
void HandleSwapItemWithGuildBankItem (WorldPackets::Guild::SwapItemWithGuildBankItem &swapItemWithGuildBankItem)
 
void HandleSwapGuildBankItemWithGuildBankItem (WorldPackets::Guild::SwapGuildBankItemWithGuildBankItem &swapGuildBankItemWithGuildBankItem)
 
void HandleMoveGuildBankItem (WorldPackets::Guild::MoveGuildBankItem &moveGuildBankItem)
 
void HandleMergeItemWithGuildBankItem (WorldPackets::Guild::MergeItemWithGuildBankItem &mergeItemWithGuildBankItem)
 
void HandleSplitItemToGuildBank (WorldPackets::Guild::SplitItemToGuildBank &splitItemToGuildBank)
 
void HandleMergeGuildBankItemWithItem (WorldPackets::Guild::MergeGuildBankItemWithItem &mergeGuildBankItemWithItem)
 
void HandleSplitGuildBankItemToInventory (WorldPackets::Guild::SplitGuildBankItemToInventory &splitGuildBankItemToInventory)
 
void HandleAutoStoreGuildBankItem (WorldPackets::Guild::AutoStoreGuildBankItem &autoStoreGuildBankItem)
 
void HandleMergeGuildBankItemWithGuildBankItem (WorldPackets::Guild::MergeGuildBankItemWithGuildBankItem &mergeGuildBankItemWithGuildBankItem)
 
void HandleSplitGuildBankItem (WorldPackets::Guild::SplitGuildBankItem &splitGuildBankItem)
 
void HandleGuildBankUpdateTab (WorldPackets::Guild::GuildBankUpdateTab &packet)
 
void HandleGuildBankBuyTab (WorldPackets::Guild::GuildBankBuyTab &packet)
 
void HandleGuildBankTextQuery (WorldPackets::Guild::GuildBankTextQuery &packet)
 
void HandleGuildBankSetTabText (WorldPackets::Guild::GuildBankSetTabText &packet)
 
void HandleCalendarGetCalendar (WorldPackets::Calendar::CalendarGetCalendar &calendarGetCalendar)
 
void HandleCalendarGetEvent (WorldPackets::Calendar::CalendarGetEvent &calendarGetEvent)
 
void HandleCalendarCommunityInvite (WorldPackets::Calendar::CalendarCommunityInviteRequest &calendarCommunityInvite)
 
void HandleCalendarAddEvent (WorldPackets::Calendar::CalendarAddEvent &calendarAddEvent)
 
void HandleCalendarUpdateEvent (WorldPackets::Calendar::CalendarUpdateEvent &calendarUpdateEvent)
 
void HandleCalendarRemoveEvent (WorldPackets::Calendar::CalendarRemoveEvent &calendarRemoveEvent)
 
void HandleCalendarCopyEvent (WorldPackets::Calendar::CalendarCopyEvent &calendarCopyEvent)
 
void HandleCalendarInvite (WorldPackets::Calendar::CalendarInvite &calendarEventInvite)
 
void HandleCalendarRsvp (WorldPackets::Calendar::CalendarRSVP &calendarRSVP)
 
void HandleCalendarEventRemoveInvite (WorldPackets::Calendar::CalendarRemoveInvite &calendarRemoveInvite)
 
void HandleCalendarStatus (WorldPackets::Calendar::CalendarStatus &calendarStatus)
 
void HandleCalendarModeratorStatus (WorldPackets::Calendar::CalendarModeratorStatusQuery &calendarModeratorStatus)
 
void HandleCalendarComplain (WorldPackets::Calendar::CalendarComplain &calendarComplain)
 
void HandleCalendarGetNumPending (WorldPackets::Calendar::CalendarGetNumPending &calendarGetNumPending)
 
void HandleCalendarEventSignup (WorldPackets::Calendar::CalendarEventSignUp &calendarEventSignUp)
 
void SendCalendarRaidLockoutAdded (InstanceLock const *lock)
 
void SendCalendarRaidLockoutRemoved (InstanceLock const *lock)
 
void HandleSetSavedInstanceExtend (WorldPackets::Calendar::SetSavedInstanceExtend &setSavedInstanceExtend)
 
void HandleVoidStorageUnlock (WorldPackets::VoidStorage::UnlockVoidStorage &unlockVoidStorage)
 
void HandleVoidStorageQuery (WorldPackets::VoidStorage::QueryVoidStorage &queryVoidStorage)
 
void HandleVoidStorageTransfer (WorldPackets::VoidStorage::VoidStorageTransfer &voidStorageTransfer)
 
void HandleVoidSwapItem (WorldPackets::VoidStorage::SwapVoidItem &swapVoidItem)
 
void SendVoidStorageTransferResult (VoidTransferError result)
 
void HandleCollectionItemSetFavorite (WorldPackets::Collections::CollectionItemSetFavorite &collectionItemSetFavorite)
 
void HandleTransmogrifyItems (WorldPackets::Transmogrification::TransmogrifyItems &transmogrifyItems)
 
void HandleSpellClick (WorldPackets::Spells::SpellClick &spellClick)
 
void HandleMirrorImageDataRequest (WorldPackets::Spells::GetMirrorImageData &getMirrorImageData)
 
void HandleGuildSetFocusedAchievement (WorldPackets::Achievement::GuildSetFocusedAchievement &setFocusedAchievement)
 
void HandleEquipmentSetSave (WorldPackets::EquipmentSet::SaveEquipmentSet &saveEquipmentSet)
 
void HandleDeleteEquipmentSet (WorldPackets::EquipmentSet::DeleteEquipmentSet &deleteEquipmentSet)
 
void HandleUseEquipmentSet (WorldPackets::EquipmentSet::UseEquipmentSet &useEquipmentSet)
 
void HandleServerTimeOffsetRequest (WorldPackets::Misc::ServerTimeOffsetRequest &)
 
void HandleQueryQuestCompletionNPCs (WorldPackets::Query::QueryQuestCompletionNPCs &queryQuestCompletionNPCs)
 
void HandleQuestPOIQuery (WorldPackets::Query::QuestPOIQuery &questPoiQuery)
 
void HandleViolenceLevel (WorldPackets::Misc::ViolenceLevel &violenceLevel)
 
void HandleObjectUpdateFailedOpcode (WorldPackets::Misc::ObjectUpdateFailed &objectUpdateFailed)
 
void HandleObjectUpdateRescuedOpcode (WorldPackets::Misc::ObjectUpdateRescued &objectUpdateRescued)
 
void HandleRequestCategoryCooldowns (WorldPackets::Spells::RequestCategoryCooldowns &requestCategoryCooldowns)
 
void HandleCloseInteraction (WorldPackets::Misc::CloseInteraction &closeInteraction)
 
void HandleConversationLineStarted (WorldPackets::Misc::ConversationLineStarted &conversationLineStarted)
 
void HandleKeyboundOverride (WorldPackets::Spells::KeyboundOverride &keyboundOverride)
 
void HandleAdventureJournalOpenQuest (WorldPackets::AdventureJournal::AdventureJournalOpenQuest &openQuest)
 
void HandleAdventureJournalUpdateSuggestions (WorldPackets::AdventureJournal::AdventureJournalUpdateSuggestions &updateSuggestions)
 
void HandleAdventureMapStartQuest (WorldPackets::AdventureMap::AdventureMapStartQuest &startQuest)
 
void HandleAddToy (WorldPackets::Toy::AddToy &packet)
 
void HandleUseToy (WorldPackets::Toy::UseToy &packet)
 
void HandleToyClearFanfare (WorldPackets::Toy::ToyClearFanfare &toyClearFanfare)
 
void HandleMountSetFavorite (WorldPackets::Misc::MountSetFavorite &mountSetFavorite)
 
void HandleSceneTriggerEvent (WorldPackets::Scenes::SceneTriggerEvent &sceneTriggerEvent)
 
void HandleScenePlaybackComplete (WorldPackets::Scenes::ScenePlaybackComplete &scenePlaybackComplete)
 
void HandleScenePlaybackCanceled (WorldPackets::Scenes::ScenePlaybackCanceled &scenePlaybackCanceled)
 
void HandleCommerceTokenGetLog (WorldPackets::Token::CommerceTokenGetLog &updateListedAuctionableTokens)
 
void HandleCommerceTokenGetMarketPrice (WorldPackets::Token::CommerceTokenGetMarketPrice &requestWowTokenMarketPrice)
 
void HandleSaveCUFProfiles (WorldPackets::Misc::SaveCUFProfiles &packet)
 
void SendLoadCUFProfiles ()
 
void HandleGetGarrisonInfo (WorldPackets::Garrison::GetGarrisonInfo &getGarrisonInfo)
 
void HandleGarrisonPurchaseBuilding (WorldPackets::Garrison::GarrisonPurchaseBuilding &garrisonPurchaseBuilding)
 
void HandleGarrisonCancelConstruction (WorldPackets::Garrison::GarrisonCancelConstruction &garrisonCancelConstruction)
 
void HandleGarrisonRequestBlueprintAndSpecializationData (WorldPackets::Garrison::GarrisonRequestBlueprintAndSpecializationData &garrisonRequestBlueprintAndSpecializationData)
 
void HandleGarrisonGetMapData (WorldPackets::Garrison::GarrisonGetMapData &garrisonGetMapData)
 
void HandleBattlePetRequestJournal (WorldPackets::BattlePet::BattlePetRequestJournal &battlePetRequestJournal)
 
void HandleBattlePetRequestJournalLock (WorldPackets::BattlePet::BattlePetRequestJournalLock &battlePetRequestJournalLock)
 
void HandleBattlePetSetBattleSlot (WorldPackets::BattlePet::BattlePetSetBattleSlot &battlePetSetBattleSlot)
 
void HandleBattlePetModifyName (WorldPackets::BattlePet::BattlePetModifyName &battlePetModifyName)
 
void HandleQueryBattlePetName (WorldPackets::BattlePet::QueryBattlePetName &queryBattlePetName)
 
void HandleBattlePetDeletePet (WorldPackets::BattlePet::BattlePetDeletePet &battlePetDeletePet)
 
void HandleBattlePetSetFlags (WorldPackets::BattlePet::BattlePetSetFlags &battlePetSetFlags)
 
void HandleBattlePetClearFanfare (WorldPackets::BattlePet::BattlePetClearFanfare &battlePetClearFanfare)
 
void HandleBattlePetSummon (WorldPackets::BattlePet::BattlePetSummon &battlePetSummon)
 
void HandleBattlePetUpdateNotify (WorldPackets::BattlePet::BattlePetUpdateNotify &battlePetUpdateNotify)
 
void HandleCageBattlePet (WorldPackets::BattlePet::CageBattlePet &cageBattlePet)
 
void HandleWardenData (WorldPackets::Warden::WardenData &packet)
 
void HandleBattlenetChangeRealmTicket (WorldPackets::Battlenet::ChangeRealmTicket &changeRealmTicket)
 
void HandleBattlenetRequest (WorldPackets::Battlenet::Request &request)
 
void SendBattlenetResponse (uint32 serviceHash, uint32 methodId, uint32 token, pb::Message const *response)
 
void SendBattlenetResponse (uint32 serviceHash, uint32 methodId, uint32 token, uint32 status)
 
void SendBattlenetRequest (uint32 serviceHash, uint32 methodId, pb::Message const *request, std::function< void(MessageBuffer)> callback)
 
void SendBattlenetRequest (uint32 serviceHash, uint32 methodId, pb::Message const *request)
 
std::array< uint8, 32 > const & GetRealmListSecret () const
 
void SetRealmListSecret (std::array< uint8, 32 > const &secret)
 
std::unordered_map< uint32, uint8 > const & GetRealmCharacterCounts () const
 
void HandleQueryRealmName (WorldPackets::Query::QueryRealmName &queryRealmName)
 
void HandleArtifactAddPower (WorldPackets::Artifact::ArtifactAddPower &artifactAddPower)
 
void HandleArtifactSetAppearance (WorldPackets::Artifact::ArtifactSetAppearance &artifactSetAppearance)
 
void HandleConfirmArtifactRespec (WorldPackets::Artifact::ConfirmArtifactRespec &confirmArtifactRespec)
 
void HandleQueryScenarioPOI (WorldPackets::Scenario::QueryScenarioPOI &queryScenarioPOI)
 
void HandleAzeriteEssenceUnlockMilestone (WorldPackets::Azerite::AzeriteEssenceUnlockMilestone &azeriteEssenceUnlockMilestone)
 
void HandleAzeriteEssenceActivateEssence (WorldPackets::Azerite::AzeriteEssenceActivateEssence &azeriteEssenceActivateEssence)
 
void HandleAzeriteEmpoweredItemViewed (WorldPackets::Azerite::AzeriteEmpoweredItemViewed &azeriteEmpoweredItemViewed)
 
void HandleAzeriteEmpoweredItemSelectPower (WorldPackets::Azerite::AzeriteEmpoweredItemSelectPower &azeriteEmpoweredItemSelectPower)
 
void SendAzeriteRespecNPC (ObjectGuid npc)
 
void HandleRequestLatestSplashScreen (WorldPackets::Misc::RequestLatestSplashScreen &requestLatestSplashScreen)
 
void HandleSocialContractRequest (WorldPackets::Social::SocialContractRequest &socialContractRequest)
 
uint64 GetConnectToInstanceKey () const
 
QueryCallbackProcessorGetQueryProcessor ()
 
TransactionCallbackAddTransactionCallback (TransactionCallback &&callback)
 
SQLQueryHolderCallbackAddQueryHolderCallback (SQLQueryHolderCallback &&callback)
 

Public Attributes

time_t m_muteTime
 
std::atomic< time_t > m_timeOutTime
 

Protected Attributes

class WorldSession::DosProtection AntiDOS
 

Private Member Functions

void ProcessQueryCallbacks ()
 
void moveItems (Item *myItems[], Item *hisItems[])
 
bool CanUseBank (ObjectGuid bankerGUID=ObjectGuid::Empty) const
 
void LogUnexpectedOpcode (WorldPacket *packet, char const *status, const char *reason)
 Logging helper for unexpected opcodes. More...
 
bool IsLegitCharacterForAccount (ObjectGuid lowGUID)
 
void ComputeNewClockDelta ()
 
 WorldSession (WorldSession const &right)=delete
 
WorldSessionoperator= (WorldSession const &right)=delete
 

Private Attributes

QueryCallbackProcessor _queryProcessor
 
AsyncCallbackProcessor< TransactionCallback_transactionCallbacks
 
AsyncCallbackProcessor< SQLQueryHolderCallback_queryHolderProcessor
 
GuidSet _legitCharacters
 
ObjectGuid::LowType m_GUIDLow
 
Player_player
 
std::shared_ptr< WorldSocketm_Socket [MAX_CONNECTION_TYPES]
 
std::string m_Address
 
AccountTypes _security
 
uint32 _accountId
 
std::string _accountName
 
uint32 _battlenetAccountId
 
uint8 m_accountExpansion
 
uint8 m_expansion
 
std::string _os
 
std::array< uint8, 32 > _realmListSecret
 
std::unordered_map< uint32, uint8_realmCharacterCounts
 
std::unordered_map< uint32, std::function< void(MessageBuffer)> > _battlenetResponseCallbacks
 
uint32 _battlenetRequestToken
 
std::unique_ptr< Warden_warden
 
time_t _logoutTime
 
bool m_inQueue
 
ObjectGuid m_playerLoading
 
bool m_playerLogout
 
bool m_playerRecentlyLogout
 
bool m_playerSave
 
LocaleConstant m_sessionDbcLocale
 
LocaleConstant m_sessionDbLocaleIndex
 
std::atomic< uint32m_latency
 
AccountData _accountData [NUM_ACCOUNT_DATA_TYPES]
 
uint32 _tutorials [MAX_ACCOUNT_TUTORIAL_VALUES]
 
uint8 _tutorialsChanged
 
std::vector< std::string > _registeredAddonPrefixes
 
bool _filterAddonMessages
 
uint32 recruiterId
 
bool isRecruiter
 
LockedQueue< WorldPacket * > _recvQueue
 
rbac::RBACData_RBACData
 
uint32 expireTime
 
bool forceExit
 
std::unique_ptr< boost::circular_buffer< std::pair< int64, uint32 > > > _timeSyncClockDeltaQueue
 
int64 _timeSyncClockDelta
 
std::map< uint32, uint32_pendingTimeSyncRequests
 
uint32 _timeSyncNextCounter
 
uint32 _timeSyncTimer
 
time_t _calendarEventCreationCooldown
 
std::unique_ptr< BattlePets::BattlePetMgr_battlePetMgr
 
std::unique_ptr< CollectionMgr_collectionMgr
 
ConnectToKey _instanceConnectKey
 

Friends

class World
 

Detailed Description

Player session in the World.

Constructor & Destructor Documentation

◆ WorldSession() [1/2]

WorldSession::WorldSession ( uint32  id,
std::string &&  name,
uint32  battlenetAccountId,
std::shared_ptr< WorldSocket sock,
AccountTypes  sec,
uint8  expansion,
time_t  mute_time,
std::string  os,
LocaleConstant  locale,
uint32  recruiter,
bool  isARecruiter 
)

WorldSession constructor.

109 :
110 m_muteTime(mute_time),
111 m_timeOutTime(0),
112 AntiDOS(this),
113 m_GUIDLow(UI64LIT(0)),
114 _player(nullptr),
115 _security(sec),
116 _accountId(id),
117 _accountName(std::move(name)),
118 _battlenetAccountId(battlenetAccountId),
119 m_accountExpansion(expansion),
120 m_expansion(std::min<uint8>(expansion, sWorld->getIntConfig(CONFIG_EXPANSION))),
121 _os(os),
123 _logoutTime(0),
124 m_inQueue(false),
125 m_playerLogout(false),
127 m_playerSave(false),
128 m_sessionDbcLocale(sWorld->GetAvailableDbcLocale(locale)),
130 m_latency(0),
133 recruiterId(recruiter),
134 isRecruiter(isARecruiter),
135 _RBACData(nullptr),
136 expireTime(60000), // 1 min after socket loss, session is deleted
137 forceExit(false),
138 _timeSyncClockDeltaQueue(std::make_unique<boost::circular_buffer<std::pair<int64, uint32>>>(6)),
144 _battlePetMgr(std::make_unique<BattlePets::BattlePetMgr>(this)),
145 _collectionMgr(std::make_unique<CollectionMgr>(this))
146{
147 memset(_tutorials, 0, sizeof(_tutorials));
148
149 if (sock)
150 {
151 m_Address = sock->GetRemoteIpAddress().to_string();
152 ResetTimeOutTime(false);
153 LoginDatabase.PExecute("UPDATE account SET online = 1 WHERE id = {};", GetAccountId()); // One-time query
154 }
155
158}
DatabaseWorkerPool< LoginDatabaseConnection > LoginDatabase
Accessor to the realm/login database.
Definition: DatabaseEnv.cpp:22
#define UI64LIT(N)
Definition: Define.h:128
bool m_playerRecentlyLogout
Definition: WorldSession.h:1926
uint8 _tutorialsChanged
Definition: WorldSession.h:1933
bool isRecruiter
Definition: WorldSession.h:1937
std::string m_Address
Definition: WorldSession.h:1903
bool m_playerSave
Definition: WorldSession.h:1927
LocaleConstant m_sessionDbLocaleIndex
Definition: WorldSession.h:1929
time_t _logoutTime
Definition: WorldSession.h:1922
uint32 _tutorials[MAX_ACCOUNT_TUTORIAL_VALUES]
Definition: WorldSession.h:1932
int64 _timeSyncClockDelta
Definition: WorldSession.h:1944
std::map< uint32, uint32 > _pendingTimeSyncRequests
Definition: WorldSession.h:1947
time_t _calendarEventCreationCooldown
Definition: WorldSession.h:1952
class WorldSession::DosProtection AntiDOS
std::atomic< time_t > m_timeOutTime
Definition: WorldSession.h:1145
uint32 _timeSyncTimer
Definition: WorldSession.h:1949
std::string _os
Definition: WorldSession.h:1912
rbac::RBACData * _RBACData
Definition: WorldSession.h:1939
std::unique_ptr< CollectionMgr > _collectionMgr
Definition: WorldSession.h:1956
std::string _accountName
Definition: WorldSession.h:1908
uint32 _timeSyncNextCounter
Definition: WorldSession.h:1948
uint32 recruiterId
Definition: WorldSession.h:1936
bool m_playerLogout
Definition: WorldSession.h:1925
uint32 _accountId
Definition: WorldSession.h:1907
ObjectGuid::LowType m_GUIDLow
Definition: WorldSession.h:1900
uint32 GetAccountId() const
Definition: WorldSession.h:990
ConnectToKey _instanceConnectKey
Definition: WorldSession.h:1958
Player * _player
Definition: WorldSession.h:1901
uint32 _battlenetRequestToken
Definition: WorldSession.h:1917
AccountTypes _security
Definition: WorldSession.h:1906
uint32 _battlenetAccountId
Definition: WorldSession.h:1909
std::shared_ptr< WorldSocket > m_Socket[MAX_CONNECTION_TYPES]
Definition: WorldSession.h:1902
bool forceExit
Definition: WorldSession.h:1941
uint8 m_accountExpansion
Definition: WorldSession.h:1910
bool m_inQueue
Definition: WorldSession.h:1923
uint32 expireTime
Definition: WorldSession.h:1940
LocaleConstant m_sessionDbcLocale
Definition: WorldSession.h:1928
std::unique_ptr< boost::circular_buffer< std::pair< int64, uint32 > > > _timeSyncClockDeltaQueue
Definition: WorldSession.h:1943
time_t m_muteTime
Definition: WorldSession.h:1135
std::atomic< uint32 > m_latency
Definition: WorldSession.h:1930
void ResetTimeOutTime(bool onlyActive)
Definition: WorldSession.cpp:779
uint8 m_expansion
Definition: WorldSession.h:1911
std::unique_ptr< BattlePets::BattlePetMgr > _battlePetMgr
Definition: WorldSession.h:1954
bool _filterAddonMessages
Definition: WorldSession.h:1935
@ CONNECTION_TYPE_REALM
Definition: Opcodes.h:30
@ TUTORIALS_FLAG_NONE
Definition: WorldSession.h:897
#define sWorld
Definition: World.h:961
@ CONFIG_EXPANSION
Definition: World.h:305
uint64 Raw
Definition: WorldSession.h:1834
+ Here is the call graph for this function:

◆ ~WorldSession()

WorldSession::~WorldSession ( )

WorldSession destructor.

  • unload player if not unloaded
  • If have unclosed socket, close it
  • empty incoming packet queue
162{
164 if (_player)
165 LogoutPlayer (true);
166
168 for (uint8 i = 0; i < 2; ++i)
169 {
170 if (m_Socket[i])
171 {
172 m_Socket[i]->CloseSocket();
173 m_Socket[i].reset();
174 }
175 }
176
177 delete _RBACData;
178
180 WorldPacket* packet = nullptr;
181 while (_recvQueue.next(packet))
182 delete packet;
183
184 LoginDatabase.PExecute("UPDATE account SET online = 0 WHERE id = {};", GetAccountId()); // One-time query
185}
uint8_t uint8
Definition: Define.h:145
bool next(T &result)
Gets the next result in the queue, if any.
Definition: LockedQueue.h:68
Definition: WorldPacket.h:26
void LogoutPlayer(bool save)
Log the player out
Definition: WorldSession.cpp:543
LockedQueue< WorldPacket * > _recvQueue
Definition: WorldSession.h:1938
+ Here is the call graph for this function:

◆ WorldSession() [2/2]

WorldSession::WorldSession ( WorldSession const &  right)
privatedelete

Member Function Documentation

◆ AbortLogin()

void WorldSession::AbortLogin ( WorldPackets::Character::LoginFailureReason  reason)
1110{
1111 if (!PlayerLoading() || GetPlayer())
1112 {
1113 KickPlayer("WorldSession::AbortLogin incorrect player state when logging in");
1114 return;
1115 }
1116
1119}
void Clear()
Definition: ObjectGuid.h:276
Definition: CharacterPackets.h:514
void KickPlayer(std::string const &reason)
Kick a player out of the World.
Definition: WorldSession.cpp:695
Player * GetPlayer() const
Definition: WorldSession.h:995
bool PlayerLoading() const
Definition: WorldSession.h:959
ObjectGuid m_playerLoading
Definition: WorldSession.h:1924
void SendPacket(WorldPacket const *packet, bool forced=false)
Send a packet to the client.
Definition: WorldSession.cpp:214
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddInstanceConnection()

void WorldSession::AddInstanceConnection ( std::shared_ptr< WorldSocket sock)
inline
@ CONNECTION_TYPE_INSTANCE
Definition: Opcodes.h:31
+ Here is the caller graph for this function:

◆ AddQueryHolderCallback()

SQLQueryHolderCallback & WorldSession::AddQueryHolderCallback ( SQLQueryHolderCallback &&  callback)
997{
998 return _queryHolderProcessor.AddCallback(std::move(callback));
999}
T & AddCallback(T &&query)
Definition: AsyncCallbackProcessor.h:34
AsyncCallbackProcessor< SQLQueryHolderCallback > _queryHolderProcessor
Definition: WorldSession.h:1849
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddTransactionCallback()

TransactionCallback & WorldSession::AddTransactionCallback ( TransactionCallback &&  callback)
992{
993 return _transactionCallbacks.AddCallback(std::move(callback));
994}
AsyncCallbackProcessor< TransactionCallback > _transactionCallbacks
Definition: WorldSession.h:1848
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AdjustClientMovementTime()

uint32 WorldSession::AdjustClientMovementTime ( uint32  time) const
1564{
1565 int64 movementTime = int64(time) + _timeSyncClockDelta;
1566 if (_timeSyncClockDelta == 0 || movementTime < 0 || movementTime > 0xFFFFFFFF)
1567 {
1568 TC_LOG_WARN("misc", "The computed movement time using clockDelta is erronous. Using fallback instead");
1569 return GameTime::GetGameTimeMS();
1570 }
1571 else
1572 return uint32(movementTime);
1573}
int64_t int64
Definition: Define.h:138
uint32_t uint32
Definition: Define.h:143
#define TC_LOG_WARN(filterType__,...)
Definition: Log.h:162
uint32 GetGameTimeMS()
Definition: GameTime.cpp:44
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ BuildNameQueryData()

void WorldSession::BuildNameQueryData ( ObjectGuid  guid,
WorldPackets::Query::NameCacheLookupResult lookupData 
)
36{
38
39 lookupData.Player = guid;
40
41 lookupData.Data.emplace();
42 if (lookupData.Data->Initialize(guid, player))
43 lookupData.Result = RESPONSE_SUCCESS; // name known
44 else
45 lookupData.Result = RESPONSE_FAILURE; // name unknown
46}
@ RESPONSE_FAILURE
Definition: SharedDefines.h:6069
@ RESPONSE_SUCCESS
Definition: SharedDefines.h:6068
Definition: Player.h:1125
TC_GAME_API Player * FindConnectedPlayer(ObjectGuid const &)
Definition: ObjectAccessor.cpp:273
Optional< PlayerGuidLookupData > Data
Definition: QueryPackets.h:147
uint8 Result
Definition: QueryPackets.h:146
ObjectGuid Player
Definition: QueryPackets.h:145
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CanAccessAlliedRaces()

bool WorldSession::CanAccessAlliedRaces ( ) const
1002{
1004}
@ EXPANSION_BATTLE_FOR_AZEROTH
Definition: SharedDefines.h:90
uint8 GetAccountExpansion() const
Definition: WorldSession.h:1002
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CanOpenMailBox()

bool WorldSession::CanOpenMailBox ( ObjectGuid  guid)
39{
40 if (guid == _player->GetGUID())
41 {
43 {
44 TC_LOG_WARN("cheat", "{} attempted to open mailbox by using a cheat.", _player->GetName());
45 return false;
46 }
47 }
48 else if (guid.IsGameObject())
49 {
51 return false;
52 }
53 else if (guid.IsAnyTypeCreature())
54 {
56 return false;
57 }
58 else
59 return false;
60
61 return true;
62}
@ GAMEOBJECT_TYPE_MAILBOX
Definition: SharedDefines.h:2795
@ UNIT_NPC_FLAG_MAILBOX
Definition: UnitDefines.h:318
@ UNIT_NPC_FLAG_2_NONE
Definition: UnitDefines.h:331
bool IsGameObject() const
Definition: ObjectGuid.h:319
bool IsAnyTypeCreature() const
Definition: ObjectGuid.h:315
static ObjectGuid GetGUID(Object const *o)
Definition: Object.h:157
Creature * GetNPCIfCanInteractWith(ObjectGuid const &guid, NPCFlags npcFlags, NPCFlags2 npcFlags2) const
Definition: Player.cpp:1998
GameObject * GetGameObjectIfCanInteractWith(ObjectGuid const &guid) const
Definition: Player.cpp:2052
std::string const & GetName() const
Definition: Object.h:544
bool HasPermission(uint32 permissionId)
Definition: WorldSession.cpp:1228
@ RBAC_PERM_COMMAND_MAILBOX
Definition: RBAC.h:649
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CanSpeak()

bool WorldSession::CanSpeak ( ) const
770{
772}
time_t GetGameTime()
Definition: GameTime.cpp:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CanUseBank()

bool WorldSession::CanUseBank ( ObjectGuid  bankerGUID = ObjectGuid::Empty) const
private
1183{
1184 // bankerGUID parameter is optional, set to 0 by default.
1185 if (!bankerGUID)
1187
1188 bool isUsingBankCommand = (bankerGUID == GetPlayer()->GetGUID() && bankerGUID == _player->PlayerTalkClass->GetInteractionData().SourceGuid);
1189
1190 if (!isUsingBankCommand)
1191 {
1193 if (!creature)
1194 return false;
1195 }
1196
1197 return true;
1198}
@ UNIT_NPC_FLAG_BANKER
Definition: UnitDefines.h:309
Definition: Creature.h:70
ObjectGuid SourceGuid
Definition: GossipDef.h:231
InteractionData & GetInteractionData()
Definition: GossipDef.h:248
PlayerMenu * PlayerTalkClass
Definition: Player.h:2382
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CheckStableMaster()

bool WorldSession::CheckStableMaster ( ObjectGuid  guid)
437{
438 // spell case or GM
439 if (guid == GetPlayer()->GetGUID())
440 {
441 if (!GetPlayer()->IsGameMaster() && !GetPlayer()->HasAuraType(SPELL_AURA_OPEN_STABLE))
442 {
443 TC_LOG_DEBUG("entities.player.cheat", "{} attempt open stable in cheating way.", guid.ToString());
444 return false;
445 }
446 }
447 // stable master case
448 else
449 {
450 if (!GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_STABLEMASTER, UNIT_NPC_FLAG_2_NONE))
451 {
452 TC_LOG_DEBUG("entities.player", "Stablemaster {} not found or you can't interact with him.", guid.ToString());
453 return false;
454 }
455 }
456 return true;
457}
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:156
@ SPELL_AURA_OPEN_STABLE
Definition: SpellAuraDefines.h:386
@ UNIT_NPC_FLAG_STABLEMASTER
Definition: UnitDefines.h:314
std::string ToString() const
Definition: ObjectGuid.cpp:531
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ComputeNewClockDelta()

void WorldSession::ComputeNewClockDelta ( )
private
766{
767 // implementation of the technique described here: https://web.archive.org/web/20180430214420/http://www.mine-control.com/zack/timesync/timesync.html
768 // to reduce the skew induced by dropped TCP packets that get resent.
769
770 using namespace boost::accumulators;
771
772 accumulator_set<uint32, features<tag::mean, tag::median, tag::variance(lazy)> > latencyAccumulator;
773
774 for (auto [_, roundTripDuration] : *_timeSyncClockDeltaQueue)
775 latencyAccumulator(roundTripDuration);
776
777 uint32 latencyMedian = static_cast<uint32>(std::round(median(latencyAccumulator)));
778 uint32 latencyStandardDeviation = static_cast<uint32>(std::round(sqrt(variance(latencyAccumulator))));
779
780 accumulator_set<int64, features<tag::mean> > clockDeltasAfterFiltering;
781 uint32 sampleSizeAfterFiltering = 0;
782 for (auto [clockDelta, roundTripDuration] : *_timeSyncClockDeltaQueue)
783 {
784 if (roundTripDuration < latencyStandardDeviation + latencyMedian) {
785 clockDeltasAfterFiltering(clockDelta);
786 sampleSizeAfterFiltering++;
787 }
788 }
789
790 if (sampleSizeAfterFiltering != 0)
791 {
792 int64 meanClockDelta = static_cast<int64>(std::round(mean(clockDeltasAfterFiltering)));
793 if (std::abs(meanClockDelta - _timeSyncClockDelta) > 25)
794 _timeSyncClockDelta = meanClockDelta;
795 }
796 else if (_timeSyncClockDelta == 0)
798}
+ Here is the caller graph for this function:

◆ DisallowHyperlinksAndMaybeKick()

bool WorldSession::DisallowHyperlinksAndMaybeKick ( std::string const &  str)
725{
726 if (str.find('|') == std::string::npos)
727 return true;
728
729 TC_LOG_ERROR("network", "Player {} {} sent a message which illegally contained a hyperlink:\n{}", GetPlayer()->GetName(),
730 GetPlayer()->GetGUID().ToString(), str);
731
733 KickPlayer("WorldSession::DisallowHyperlinksAndMaybeKick Illegal chat link");
734
735 return false;
736}
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:165
@ CONFIG_CHAT_STRICT_LINK_CHECKING_KICK
Definition: World.h:317
TC_GAME_API bool GetName(uint32 accountId, std::string &name)
Definition: BattlenetAccountMgr.cpp:141
string ToString(int i)
Definition: strutil.h:491
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DoLootRelease()

void WorldSession::DoLootRelease ( Loot loot)
263{
264 ObjectGuid lguid = loot->GetOwnerGUID();
265 Player *player = GetPlayer();
266
267 if (player->GetLootGUID() == lguid)
269
270 //Player is not looking at loot list, he doesn't need to see updates on the loot list
271 loot->RemoveLooter(player->GetGUID());
272 player->SendLootRelease(lguid);
273 player->m_AELootView.erase(loot->GetGUID());
274
275 if (player->GetAELootView().empty())
277
278 if (!player->IsInWorld())
279 return;
280
281 if (lguid.IsGameObject())
282 {
283 GameObject* go = GetPlayer()->GetMap()->GetGameObject(lguid);
284
285 // not check distance for GO in case owned GO (fishing bobber case, for example) or Fishing hole GO
286 if (!go || ((go->GetOwnerGUID() != player->GetGUID() && go->GetGoType() != GAMEOBJECT_TYPE_FISHINGHOLE) && !go->IsWithinDistInMap(player)))
287 return;
288
290 {
292 {
294 }
295 else if (go->GetGoType() == GAMEOBJECT_TYPE_FISHINGHOLE)
296 { // The fishing hole used once more
297 go->AddUse(); // if the max usage is reached, will be despawned in next tick
298 if (go->GetUseCount() >= go->GetGOValue()->FishingHole.MaxOpens)
300 else
302 }
303 else if (go->GetGoType() != GAMEOBJECT_TYPE_GATHERING_NODE && go->IsFullyLooted())
305
306 go->OnLootRelease(player);
307 }
308 else
309 {
310 // not fully looted object
311 go->SetLootState(GO_ACTIVATED, player);
312 }
313 }
314 else if (lguid.IsCorpse()) // ONLY remove insignia at BG
315 {
316 Corpse* corpse = ObjectAccessor::GetCorpse(*player, lguid);
317 if (!corpse || !corpse->IsWithinDistInMap(player, INTERACTION_DISTANCE))
318 return;
319
320 if (loot->isLooted())
321 {
322 corpse->m_loot = nullptr;
324 }
325 }
326 else if (lguid.IsItem())
327 {
328 Item* pItem = player->GetItemByGuid(lguid);
329 if (!pItem)
330 return;
331
332 ItemTemplate const* proto = pItem->GetTemplate();
333
334 // destroy only 5 items from stack in case prospecting and milling
335 if (loot->loot_type == LOOT_PROSPECTING || loot->loot_type == LOOT_MILLING)
336 {
337 pItem->m_lootGenerated = false;
338 pItem->m_loot = nullptr;
339
340 uint32 count = pItem->GetCount();
341
342 // >=5 checked in spell code, but will work for cheating cases also with removing from another stacks.
343 if (count > 5)
344 count = 5;
345
346 player->DestroyItemCount(pItem, count, true);
347 }
348 else
349 {
350 // Only delete item if no loot or money (unlooted loot is saved to db) or if it isn't an openable item
351 if (loot->isLooted() || !proto->HasFlag(ITEM_FLAG_HAS_LOOT))
352 player->DestroyItem(pItem->GetBagSlot(), pItem->GetSlot(), true);
353 }
354 return; // item can be looted only single player
355 }
356 else
357 {
358 Creature* creature = GetPlayer()->GetMap()->GetCreature(lguid);
359 if (!creature)
360 return;
361
362 if (loot->isLooted())
363 {
364 if (creature->IsFullyLooted())
365 {
367
368 // skip pickpocketing loot for speed, skinning timer reduction is no-op in fact
369 if (!creature->IsAlive())
370 creature->AllLootRemovedFromCorpse();
371 }
372 }
373 else
374 {
375 // if the round robin player release, reset it.
376 if (player->GetGUID() == loot->roundRobinPlayer)
377 {
378 loot->roundRobinPlayer.Clear();
379 loot->NotifyLootList(creature->GetMap());
380 }
381 }
382 // force dynflag update to update looter and lootable info
384 }
385}
@ GO_ACTIVATED
Definition: GameObject.h:117
@ GO_READY
Definition: GameObject.h:116
@ GO_JUST_DEACTIVATED
Definition: GameObject.h:118
@ ITEM_FLAG_HAS_LOOT
Definition: ItemTemplate.h:178
@ LOOT_MILLING
Definition: Loot.h:113
@ LOOT_PROSPECTING
Definition: Loot.h:112
#define INTERACTION_DISTANCE
Definition: ObjectDefines.h:24
@ GAMEOBJECT_TYPE_FISHINGHOLE
Definition: SharedDefines.h:2801
@ GAMEOBJECT_TYPE_FISHINGNODE
Definition: SharedDefines.h:2793
@ GAMEOBJECT_TYPE_GATHERING_NODE
Definition: SharedDefines.h:2826
@ CORPSE_DYNFLAG_LOOTABLE
Definition: SharedDefines.h:5793
@ UNIT_DYNFLAG_LOOTABLE
Definition: SharedDefines.h:5783
@ UNIT_FLAG_LOOTING
Definition: UnitDefines.h:149
Definition: Corpse.h:53
void RemoveCorpseDynamicFlag(CorpseDynFlags dynamicFlags)
Definition: Corpse.h:94
std::unique_ptr< Loot > m_loot
Definition: Corpse.h:130
void AllLootRemovedFromCorpse()
Definition: Creature.cpp:2865
bool IsFullyLooted() const
Definition: Creature.cpp:1378
Definition: GameObject.h:125
ObjectGuid GetOwnerGUID() const override
Definition: GameObject.h:200
bool IsWithinDistInMap(Player const *player) const
Definition: GameObject.cpp:4020
void AddUse()
Definition: GameObject.h:278
bool IsFullyLooted() const
Definition: GameObject.cpp:3338
GameObjectValue const * GetGOValue() const
Definition: GameObject.h:165
void OnLootRelease(Player *looter)
Definition: GameObject.cpp:3350
void SetLootState(LootState s, Unit *unit=nullptr)
Definition: GameObject.cpp:3298
GameobjectTypes GetGoType() const
Definition: GameObject.h:237
uint32 GetUseCount() const
Definition: GameObject.h:280
Definition: Item.h:170
uint8 GetSlot() const
Definition: Item.h:280
ItemTemplate const * GetTemplate() const
Definition: Item.cpp:1140
std::unique_ptr< Loot > m_loot
Definition: Item.h:317
bool m_lootGenerated
Definition: Item.h:318
uint32 GetCount() const
Definition: Item.h:273
uint8 GetBagSlot() const
Definition: Item.cpp:1238
GameObject * GetGameObject(ObjectGuid const &guid)
Definition: Map.cpp:3376
Creature * GetCreature(ObjectGuid const &guid)
Definition: Map.cpp:3366
Definition: ObjectGuid.h:258
static ObjectGuid const Empty
Definition: ObjectGuid.h:264
bool IsCorpse() const
Definition: ObjectGuid.h:321
bool IsItem() const
Definition: ObjectGuid.h:318
bool IsInWorld() const
Definition: Object.h:152
UF::UpdateField< UF::ObjectData, 0, TYPEID_OBJECT > m_objectData
Definition: Object.h:253
UF::UpdateFieldHolder m_values
Definition: Object.h:252
void RemoveDynamicFlag(uint32 flag)
Definition: Object.h:168
void ForceUpdateFieldChange(UF::UpdateFieldSetter< T > const &)
Definition: Object.h:256
void SendLootRelease(ObjectGuid guid) const
Definition: Player.cpp:9009
std::unordered_map< ObjectGuid, Loot * > m_AELootView
Definition: Player.h:3202
ObjectGuid const & GetLootGUID() const
Definition: Player.h:2093
void SetLootGUID(ObjectGuid const &guid)
Definition: Player.h:2094
void DestroyItem(uint8 bag, uint8 slot, bool update)
Definition: Player.cpp:12075
uint32 DestroyItemCount(uint32 item, uint32 count, bool update, bool unequip_check=false)
Definition: Player.cpp:12176
std::unordered_map< ObjectGuid, Loot * > const & GetAELootView() const
Definition: Player.h:2096
Item * GetItemByGuid(ObjectGuid guid) const
Definition: Player.cpp:9469
MutableFieldReference< T, false > ModifyValue(UpdateField< T, BlockBit, Bit >(Derived::*field))
Definition: UpdateField.h:673
bool IsAlive() const
Definition: Unit.h:1253
void RemoveUnitFlag(UnitFlags flags)
Definition: Unit.h:942
Map * GetMap() const
Definition: Object.h:611
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
Definition: Object.cpp:1119
TC_GAME_API Corpse * GetCorpse(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:171
Definition: ItemTemplate.h:754
bool HasFlag(ItemFlags flag) const
Definition: ItemTemplate.h:852
void NotifyLootList(Map const *map) const
Definition: Loot.cpp:633
bool isLooted() const
Definition: Loot.h:305
ObjectGuid roundRobinPlayer
Definition: Loot.h:285
ObjectGuid const & GetOwnerGUID() const
Definition: Loot.h:297
ObjectGuid const & GetGUID() const
Definition: Loot.h:296
void RemoveLooter(ObjectGuid GUID)
Definition: Loot.h:312
LootType loot_type
Definition: Loot.h:286
UpdateField< uint32, 0, 2 > DynamicFlags
Definition: UpdateFields.h:53
uint32 MaxOpens
Definition: GameObject.h:87
struct GameObjectValue::@210 FishingHole
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DoLootReleaseAll()

void WorldSession::DoLootReleaseAll ( )
388{
389 std::unordered_map<ObjectGuid, Loot*> lootView = _player->GetAELootView();
390 for (auto const& [lootGuid, loot] : lootView)
391 DoLootRelease(loot);
392}
void DoLootRelease(Loot *loot)
Definition: LootHandler.cpp:262
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetAccountData()

AccountData const * WorldSession::GetAccountData ( AccountDataType  type) const
inline
1076{ return &_accountData[type]; }
AccountData _accountData[NUM_ACCOUNT_DATA_TYPES]
Definition: WorldSession.h:1931
+ Here is the caller graph for this function:

◆ GetAccountExpansion()

uint8 WorldSession::GetAccountExpansion ( ) const
inline
1002{ return m_accountExpansion; }
+ Here is the caller graph for this function:

◆ GetAccountGUID()

ObjectGuid WorldSession::GetAccountGUID ( ) const
inline
991{ return ObjectGuid::Create<HighGuid::WowAccount>(GetAccountId()); }
+ Here is the caller graph for this function:

◆ GetAccountId()

uint32 WorldSession::GetAccountId ( ) const
inline
990{ return _accountId; }
+ Here is the caller graph for this function:

◆ GetAccountName()

std::string const & WorldSession::GetAccountName ( ) const
inline
992{ return _accountName; }
+ Here is the caller graph for this function:

◆ GetBattlenetAccountGUID()

ObjectGuid WorldSession::GetBattlenetAccountGUID ( ) const
inline
994{ return ObjectGuid::Create<HighGuid::BNetAccount>(GetBattlenetAccountId()); }
uint32 GetBattlenetAccountId() const
Definition: WorldSession.h:993
+ Here is the caller graph for this function:

◆ GetBattlenetAccountId()

uint32 WorldSession::GetBattlenetAccountId ( ) const
inline
993{ return _battlenetAccountId; }
+ Here is the caller graph for this function:

◆ GetBattlePetMgr()

BattlePets::BattlePetMgr * WorldSession::GetBattlePetMgr ( ) const
inline
1165{ return _battlePetMgr.get(); }
+ Here is the caller graph for this function:

◆ GetCalendarEventCreationCooldown()

time_t WorldSession::GetCalendarEventCreationCooldown ( ) const
inline
+ Here is the caller graph for this function:

◆ GetCollectionMgr()

CollectionMgr * WorldSession::GetCollectionMgr ( ) const
inline
1167{ return _collectionMgr.get(); }
+ Here is the caller graph for this function:

◆ GetConnectToInstanceKey()

uint64 WorldSession::GetConnectToInstanceKey ( ) const
inline
1837{ return _instanceConnectKey.Raw; }
+ Here is the caller graph for this function:

◆ GetExpansion()

uint8 WorldSession::GetExpansion ( ) const
inline
1003{ return m_expansion; }
+ Here is the caller graph for this function:

◆ GetLatency()

uint32 WorldSession::GetLatency ( ) const
inline
1142{ return m_latency; }
+ Here is the caller graph for this function:

◆ GetOS()

std::string const & WorldSession::GetOS ( ) const
inline
1004{ return _os; }

◆ GetPlayer()

Player * WorldSession::GetPlayer ( ) const
inline
995{ return _player; }

◆ GetPlayerInfo()

std::string WorldSession::GetPlayerInfo ( ) const
199{
200 std::ostringstream ss;
201
202 ss << "[Player: ";
204 ss << "Logging in: " << m_playerLoading.ToString() << ", ";
205 else if (_player)
206 ss << _player->GetName() << ' ' << _player->GetGUID().ToString() << ", ";
207
208 ss << "Account: " << GetAccountId() << "]";
209
210 return ss.str();
211}
bool IsEmpty() const
Definition: ObjectGuid.h:309
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetPlayerName()

std::string const & WorldSession::GetPlayerName ( ) const
194{
195 return _player != nullptr ? _player->GetName() : DefaultPlayerName;
196}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetQueryProcessor()

QueryCallbackProcessor & WorldSession::GetQueryProcessor ( )
inline
1840{ return _queryProcessor; }
QueryCallbackProcessor _queryProcessor
Definition: WorldSession.h:1847
+ Here is the caller graph for this function:

◆ GetRBACData()

rbac::RBACData * WorldSession::GetRBACData ( )
1224{
1225 return _RBACData;
1226}
+ Here is the caller graph for this function:

◆ GetRealmCharacterCounts()

std::unordered_map< uint32, uint8 > const & WorldSession::GetRealmCharacterCounts ( ) const
inline
1802{ return _realmCharacterCounts; }
std::unordered_map< uint32, uint8 > _realmCharacterCounts
Definition: WorldSession.h:1915

◆ GetRealmListSecret()

std::array< uint8, 32 > const & WorldSession::GetRealmListSecret ( ) const
inline
1799{ return _realmListSecret; }
std::array< uint8, 32 > _realmListSecret
Definition: WorldSession.h:1914

◆ GetRecruiterId()

uint32 WorldSession::GetRecruiterId ( ) const
inline
1152{ return recruiterId; }
+ Here is the caller graph for this function:

◆ GetRemoteAddress()

std::string const & WorldSession::GetRemoteAddress ( ) const
inline
1000{ return m_Address; }
+ Here is the caller graph for this function:

◆ GetSecurity()

AccountTypes WorldSession::GetSecurity ( ) const
inline
989{ return _security; }
+ Here is the caller graph for this function:

◆ GetSessionDbcLocale()

LocaleConstant WorldSession::GetSessionDbcLocale ( ) const
inline
1138{ return m_sessionDbcLocale; }
+ Here is the caller graph for this function:

◆ GetSessionDbLocaleIndex()

LocaleConstant WorldSession::GetSessionDbLocaleIndex ( ) const
inline
1139{ return m_sessionDbLocaleIndex; }
+ Here is the caller graph for this function:

◆ GetTrinityString()

char const * WorldSession::GetTrinityString ( uint32  entry) const
775{
776 return sObjectMgr->GetTrinityString(entry, GetSessionDbLocaleIndex());
777}
#define sObjectMgr
Definition: ObjectMgr.h:1976
LocaleConstant GetSessionDbLocaleIndex() const
Definition: WorldSession.h:1139
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetTutorialInt()

uint32 WorldSession::GetTutorialInt ( uint8  index) const
inline
1084{ return _tutorials[index]; }
+ Here is the caller graph for this function:

◆ GetWarden() [1/2]

Warden * WorldSession::GetWarden ( )
inline
1007{ return _warden.get(); }
std::unique_ptr< Warden > _warden
Definition: WorldSession.h:1920
+ Here is the caller graph for this function:

◆ GetWarden() [2/2]

Warden const * WorldSession::GetWarden ( ) const
inline
1008{ return _warden.get(); }

◆ Handle_EarlyProccess()

void WorldSession::Handle_EarlyProccess ( WorldPackets::Null null)
798{
799 TC_LOG_ERROR("network.opcode", "Received opcode {} that must be processed in WorldSocket::ReadDataHandler from {}"
801}
OpcodeClient GetOpcode() const
Definition: Packet.h:68
std::string GetPlayerInfo() const
Definition: WorldSession.cpp:198
std::string GetOpcodeNameForLogging(OpcodeClient opcode)
Lookup opcode name for human understandable logging.
Definition: Opcodes.cpp:2195
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Handle_NULL()

void WorldSession::Handle_NULL ( WorldPackets::Null null)
793{
794 TC_LOG_ERROR("network.opcode", "Received unhandled opcode {} from {}", GetOpcodeNameForLogging(null.GetOpcode()), GetPlayerInfo());
795}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleAcceptTradeOpcode()

void WorldSession::HandleAcceptTradeOpcode ( WorldPackets::Trade::AcceptTrade acceptTrade)
234{
235 TradeData* my_trade = _player->m_trade;
236 if (!my_trade)
237 return;
238
239 Player* trader = my_trade->GetTrader();
240
241 TradeData* his_trade = trader->m_trade;
242 if (!his_trade)
243 return;
244
245 Item* myItems[TRADE_SLOT_TRADED_COUNT] = { };
246 Item* hisItems[TRADE_SLOT_TRADED_COUNT] = { };
247
248 // set before checks for propertly undo at problems (it already set in to client)
249 my_trade->SetAccepted(true);
250
252 if (his_trade->GetServerStateIndex() != acceptTrade.StateIndex)
253 {
255 SendTradeStatus(info);
256 my_trade->SetAccepted(false);
257 return;
258 }
259
260 if (!_player->IsWithinDistInMap(trader, TRADE_DISTANCE, false))
261 {
263 SendTradeStatus(info);
264 my_trade->SetAccepted(false);
265 return;
266 }
267
268 // not accept case incorrect money amount
269 if (!_player->HasEnoughMoney(my_trade->GetMoney()))
270 {
273 SendTradeStatus(info);
274 my_trade->SetAccepted(false, true);
275 return;
276 }
277
278 // not accept case incorrect money amount
279 if (!trader->HasEnoughMoney(his_trade->GetMoney()))
280 {
283 trader->GetSession()->SendTradeStatus(info);
284 his_trade->SetAccepted(false, true);
285 return;
286 }
287
288 if (_player->GetMoney() > MAX_MONEY_AMOUNT - his_trade->GetMoney())
289 {
292 SendTradeStatus(info);
293 my_trade->SetAccepted(false, true);
294 return;
295 }
296
297 if (trader->GetMoney() > MAX_MONEY_AMOUNT - my_trade->GetMoney())
298 {
301 trader->GetSession()->SendTradeStatus(info);
302 his_trade->SetAccepted(false, true);
303 return;
304 }
305
306 // not accept if some items now can't be trade (cheating)
307 for (uint8 i = 0; i < TRADE_SLOT_TRADED_COUNT; ++i)
308 {
309 if (Item* item = my_trade->GetItem(TradeSlots(i)))
310 {
311 if (!item->CanBeTraded(false, true))
312 {
314 SendTradeStatus(info);
315 return;
316 }
317
318 if (item->IsBindedNotWith(trader))
319 {
322 SendTradeStatus(info);
323 return;
324 }
325 }
326
327 if (Item* item = his_trade->GetItem(TradeSlots(i)))
328 {
329 if (!item->CanBeTraded(false, true))
330 {
332 SendTradeStatus(info);
333 return;
334 }
335 //if (item->IsBindedNotWith(_player)) // dont mark as invalid when his item isnt good (not exploitable because if item is invalid trade will fail anyway later on the same check)
336 //{
337 // SendTradeStatus(TRADE_STATUS_NOT_ELIGIBLE);
338 // his_trade->SetAccepted(false, true);
339 // return;
340 //}
341 }
342 }
343
344 if (his_trade->IsAccepted())
345 {
346 setAcceptTradeMode(my_trade, his_trade, myItems, hisItems);
347
348 Spell* my_spell = nullptr;
349 SpellCastTargets my_targets;
350
351 Spell* his_spell = nullptr;
352 SpellCastTargets his_targets;
353
354 // not accept if spell can't be cast now (cheating)
355 if (uint32 my_spell_id = my_trade->GetSpell())
356 {
357 SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(my_spell_id, _player->GetMap()->GetDifficultyID());
358 Item* castItem = my_trade->GetSpellCastItem();
359
360 if (!spellEntry || !his_trade->GetItem(TRADE_SLOT_NONTRADED) ||
361 (my_trade->HasSpellCastItem() && !castItem))
362 {
363 clearAcceptTradeMode(my_trade, his_trade);
364 clearAcceptTradeMode(myItems, hisItems);
365
366 my_trade->SetSpell(0);
367 return;
368 }
369
370 my_spell = new Spell(_player, spellEntry, TRIGGERED_FULL_MASK);
371 my_spell->m_CastItem = castItem;
372 my_targets.SetTradeItemTarget(_player);
373 my_spell->m_targets = my_targets;
374
375 SpellCastResult res = my_spell->CheckCast(true);
376 if (res != SPELL_CAST_OK)
377 {
378 my_spell->SendCastResult(res);
379
380 clearAcceptTradeMode(my_trade, his_trade);
381 clearAcceptTradeMode(myItems, hisItems);
382
383 delete my_spell;
384 my_trade->SetSpell(0);
385 return;
386 }
387 }
388
389 // not accept if spell can't be cast now (cheating)
390 if (uint32 his_spell_id = his_trade->GetSpell())
391 {
392 SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(his_spell_id, trader->GetMap()->GetDifficultyID());
393 Item* castItem = his_trade->GetSpellCastItem();
394
395 if (!spellEntry || !my_trade->GetItem(TRADE_SLOT_NONTRADED) || (his_trade->HasSpellCastItem() && !castItem))
396 {
397 delete my_spell;
398 his_trade->SetSpell(0);
399
400 clearAcceptTradeMode(my_trade, his_trade);
401 clearAcceptTradeMode(myItems, hisItems);
402 return;
403 }
404
405 his_spell = new Spell(trader, spellEntry, TRIGGERED_FULL_MASK);
406 his_spell->m_CastItem = castItem;
407 his_targets.SetTradeItemTarget(trader);
408 his_spell->m_targets = his_targets;
409
410 SpellCastResult res = his_spell->CheckCast(true);
411 if (res != SPELL_CAST_OK)
412 {
413 his_spell->SendCastResult(res);
414
415 clearAcceptTradeMode(my_trade, his_trade);
416 clearAcceptTradeMode(myItems, hisItems);
417
418 delete my_spell;
419 delete his_spell;
420
421 his_trade->SetSpell(0);
422 return;
423 }
424 }
425
426 // inform partner client
428 trader->GetSession()->SendTradeStatus(info);
429
430 // test if item will fit in each inventory
431 WorldPackets::Trade::TradeStatus myCanCompleteInfo, hisCanCompleteInfo;
432 hisCanCompleteInfo.BagResult = trader->CanStoreItems(myItems, TRADE_SLOT_TRADED_COUNT, &hisCanCompleteInfo.ItemID);
433 myCanCompleteInfo.BagResult = _player->CanStoreItems(hisItems, TRADE_SLOT_TRADED_COUNT, &myCanCompleteInfo.ItemID);
434
435 clearAcceptTradeMode(myItems, hisItems);
436
437 // in case of missing space report error
438 if (myCanCompleteInfo.BagResult != EQUIP_ERR_OK)
439 {
440 clearAcceptTradeMode(my_trade, his_trade);
441
442 myCanCompleteInfo.Status = TRADE_STATUS_FAILED;
443 trader->GetSession()->SendTradeStatus(myCanCompleteInfo);
444 myCanCompleteInfo.FailureForYou = true;
445 SendTradeStatus(myCanCompleteInfo);
446 my_trade->SetAccepted(false);
447 his_trade->SetAccepted(false);
448 delete my_spell;
449 delete his_spell;
450 return;
451 }
452 else if (hisCanCompleteInfo.BagResult != EQUIP_ERR_OK)
453 {
454 clearAcceptTradeMode(my_trade, his_trade);
455
456 hisCanCompleteInfo.Status = TRADE_STATUS_FAILED;
457 SendTradeStatus(hisCanCompleteInfo);
458 hisCanCompleteInfo.FailureForYou = true;
459 trader->GetSession()->SendTradeStatus(hisCanCompleteInfo);
460 my_trade->SetAccepted(false);
461 his_trade->SetAccepted(false);
462 delete my_spell;
463 delete his_spell;
464 return;
465 }
466
467 // execute trade: 1. remove
468 for (uint8 i = 0; i < TRADE_SLOT_TRADED_COUNT; ++i)
469 {
470 if (myItems[i])
471 {
472 myItems[i]->SetGiftCreator(_player->GetGUID());
473 _player->MoveItemFromInventory(myItems[i]->GetBagSlot(), myItems[i]->GetSlot(), true);
474 }
475 if (hisItems[i])
476 {
477 hisItems[i]->SetGiftCreator(trader->GetGUID());
478 trader->MoveItemFromInventory(hisItems[i]->GetBagSlot(), hisItems[i]->GetSlot(), true);
479 }
480 }
481
482 // execute trade: 2. store
483 moveItems(myItems, hisItems);
484
485 // logging money
487 {
488 if (my_trade->GetMoney() > 0)
489 {
490 sLog->OutCommand(_player->GetSession()->GetAccountId(), "GM {} (Account: {}) give money (Amount: {}) to player: {} (Account: {})",
492 my_trade->GetMoney(),
493 trader->GetName(), trader->GetSession()->GetAccountId());
494 }
495
496 if (his_trade->GetMoney() > 0)
497 {
498 sLog->OutCommand(trader->GetSession()->GetAccountId(), "GM {} (Account: {}) give money (Amount: {}) to player: {} (Account: {})",
499 trader->GetName(), trader->GetSession()->GetAccountId(),
500 his_trade->GetMoney(),
502 }
503 }
504
505 // update money
506 _player->ModifyMoney(-int64(my_trade->GetMoney()));
507 _player->ModifyMoney(his_trade->GetMoney());
508 trader->ModifyMoney(-int64(his_trade->GetMoney()));
509 trader->ModifyMoney(my_trade->GetMoney());
510
511 if (my_spell)
512 my_spell->prepare(my_targets);
513
514 if (his_spell)
515 his_spell->prepare(his_targets);
516
517 // cleanup
518 clearAcceptTradeMode(my_trade, his_trade);
519 delete _player->m_trade;
520 _player->m_trade = nullptr;
521 delete trader->m_trade;
522 trader->m_trade = nullptr;
523
524 // desynchronized with the other saves here (SaveInventoryAndGoldToDB() not have own transaction guards)
525 CharacterDatabaseTransaction trans = CharacterDatabase.BeginTransaction();
527 trader->SaveInventoryAndGoldToDB(trans);
528 CharacterDatabase.CommitTransaction(trans);
529
531 trader->GetSession()->SendTradeStatus(info);
532 SendTradeStatus(info);
533 }
534 else
535 {
537 trader->GetSession()->SendTradeStatus(info);
538 }
539}
SQLTransaction< CharacterDatabaseConnection > CharacterDatabaseTransaction
Definition: DatabaseEnvFwd.h:72
DatabaseWorkerPool< CharacterDatabaseConnection > CharacterDatabase
Accessor to the character database.
Definition: DatabaseEnv.cpp:21
@ EQUIP_ERR_TOO_MUCH_GOLD
Definition: ItemDefines.h:104
@ EQUIP_ERR_OK
Definition: ItemDefines.h:26
@ EQUIP_ERR_NOT_ENOUGH_MONEY
Definition: ItemDefines.h:56
@ EQUIP_ERR_TRADE_BOUND_ITEM
Definition: ItemDefines.h:106
#define sLog
Definition: Log.h:130
#define TRADE_DISTANCE
Definition: ObjectDefines.h:27
uint64 const MAX_MONEY_AMOUNT
Definition: Player.cpp:150
@ TRADE_STATUS_CANCELLED
Definition: SharedDefines.h:6405
@ TRADE_STATUS_FAILED
Definition: SharedDefines.h:6414
@ TRADE_STATUS_STATE_CHANGED
Definition: SharedDefines.h:6411
@ TRADE_STATUS_ACCEPTED
Definition: SharedDefines.h:6406
@ TRADE_STATUS_TOO_FAR_AWAY
Definition: SharedDefines.h:6412
@ TRADE_STATUS_COMPLETE
Definition: SharedDefines.h:6410
SpellCastResult
Definition: SharedDefines.h:1439
@ SPELL_CAST_OK
Definition: SharedDefines.h:1762
@ TRIGGERED_FULL_MASK
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
Definition: SpellDefines.h:261
#define sSpellMgr
Definition: SpellMgr.h:824
TradeSlots
Definition: TradeData.h:24
@ TRADE_SLOT_TRADED_COUNT
Definition: TradeData.h:26
@ TRADE_SLOT_NONTRADED
Definition: TradeData.h:27
static void setAcceptTradeMode(TradeData *myTrade, TradeData *hisTrade, Item **myItems, Item **hisItems)
Definition: TradeHandler.cpp:190
static void clearAcceptTradeMode(TradeData *myTrade, TradeData *hisTrade)
Definition: TradeHandler.cpp:215
void SetGiftCreator(ObjectGuid guid)
Definition: Item.h:195
Difficulty GetDifficultyID() const
Definition: Map.h:307
bool ModifyMoney(int64 amount, bool sendError=true)
Definition: Player.cpp:23660
void SaveInventoryAndGoldToDB(CharacterDatabaseTransaction trans)
Definition: Player.cpp:20002
InventoryResult CanStoreItems(Item **items, int count, uint32 *offendingItemId) const
Definition: Player.cpp:10571
TradeData * m_trade
Definition: Player.h:3062
WorldSession * GetSession() const
Definition: Player.h:2103
void MoveItemFromInventory(uint8 bag, uint8 slot, bool update)
Definition: Player.cpp:12029
uint64 GetMoney() const
Definition: Player.h:1743
bool HasEnoughMoney(uint64 amount) const
Definition: Player.h:1745
Definition: SpellDefines.h:324
void SetTradeItemTarget(Player *caster)
Definition: Spell.cpp:302
Definition: SpellInfo.h:322
Definition: Spell.h:239
SpellCastTargets m_targets
Definition: Spell.h:587
static void SendCastResult(Player *caster, SpellInfo const *spellInfo, SpellCastVisual spellVisual, ObjectGuid cast_count, SpellCastResult result, SpellCustomErrors customError=SPELL_CUSTOM_ERROR_NONE, int32 *param1=nullptr, int32 *param2=nullptr)
Definition: Spell.cpp:4526
SpellCastResult prepare(SpellCastTargets const &targets, AuraEffect const *triggeredByAura=nullptr)
Definition: Spell.cpp:3291
SpellCastResult CheckCast(bool strict, int32 *param1=nullptr, int32 *param2=nullptr)
Definition: Spell.cpp:5437
Item * m_CastItem
Definition: Spell.h:544
Definition: TradeData.h:35
Item * GetSpellCastItem() const
Definition: TradeData.cpp:53
bool HasSpellCastItem() const
Definition: TradeData.h:53
void SetSpell(uint32 spell_id, Item *castItem=nullptr)
Definition: TradeData.cpp:84
Player * GetTrader() const
Definition: TradeData.h:41
void SetAccepted(bool state, bool forTrader=false)
Definition: TradeData.cpp:135
Item * GetItem(TradeSlots slot) const
Definition: TradeData.cpp:30
bool IsAccepted() const
Definition: TradeData.h:58
uint64 GetMoney() const
Definition: TradeData.h:55
uint32 GetSpell() const
Definition: TradeData.h:49
uint32 GetServerStateIndex() const
Definition: TradeData.h:67
uint32 StateIndex
Definition: TradePackets.h:37
Definition: TradePackets.h:134
::TradeStatus Status
Definition: TradePackets.h:140
bool FailureForYou
Definition: TradePackets.h:146
uint32 ItemID
Definition: TradePackets.h:148
int32 BagResult
Definition: TradePackets.h:147
void moveItems(Item *myItems[], Item *hisItems[])
Definition: TradeHandler.cpp:107
void SendTradeStatus(WorldPackets::Trade::TradeStatus &status)
Definition: TradeHandler.cpp:35
@ RBAC_PERM_LOG_GM_TRADE
Definition: RBAC.h:64
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleActivateTaxiOpcode()

void WorldSession::HandleActivateTaxiOpcode ( WorldPackets::Taxi::ActivateTaxi activateTaxi)
168{
170 if (!unit)
171 {
172 TC_LOG_DEBUG("network", "WORLD: HandleActivateTaxiOpcode - {} not found or you can't interact with it.", activateTaxi.Vendor.ToString());
174 return;
175 }
176
177 uint32 curloc = sObjectMgr->GetNearestTaxiNode(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ(), unit->GetMapId(), GetPlayer()->GetTeam());
178 if (!curloc)
179 return;
180
181 TaxiNodesEntry const* from = sTaxiNodesStore.LookupEntry(curloc);
182 TaxiNodesEntry const* to = sTaxiNodesStore.LookupEntry(activateTaxi.Node);
183 if (!to)
184 return;
185
186 if (!GetPlayer()->isTaxiCheater())
187 {
188 if (!GetPlayer()->m_taxi.IsTaximaskNodeKnown(curloc) || !GetPlayer()->m_taxi.IsTaximaskNodeKnown(activateTaxi.Node))
189 {
191 return;
192 }
193 }
194
195 uint32 preferredMountDisplay = 0;
196 if (MountEntry const* mount = sMountStore.LookupEntry(activateTaxi.FlyingMountID))
197 {
198 if (GetPlayer()->HasSpell(mount->SourceSpellID))
199 {
200 if (DB2Manager::MountXDisplayContainer const* mountDisplays = sDB2Manager.GetMountDisplays(mount->ID))
201 {
203 std::copy_if(mountDisplays->begin(), mountDisplays->end(), std::back_inserter(usableDisplays), [this](MountXDisplayEntry const* mountDisplay)
204 {
205 if (PlayerConditionEntry const* playerCondition = sPlayerConditionStore.LookupEntry(mountDisplay->PlayerConditionID))
206 return sConditionMgr->IsPlayerMeetingCondition(GetPlayer(), playerCondition);
207
208 return true;
209 });
210
211 if (!usableDisplays.empty())
212 preferredMountDisplay = Trinity::Containers::SelectRandomContainerElement(usableDisplays)->CreatureDisplayInfoID;
213 }
214 }
215 }
216
217 std::vector<uint32> nodes;
219 GetPlayer()->ActivateTaxiPathTo(nodes, unit, 0, preferredMountDisplay);
220}
DB2Storage< TaxiNodesEntry > sTaxiNodesStore("TaxiNodes.db2", &TaxiNodesLoadInfo::Instance)
DB2Storage< MountEntry > sMountStore("Mount.db2", &MountLoadInfo::Instance)
#define sDB2Manager
Definition: DB2Stores.h:502
@ ERR_TAXINOTVISITED
Definition: SharedDefines.h:6455
@ ERR_TAXITOOFARAWAY
Definition: SharedDefines.h:6453
@ UNIT_NPC_FLAG_FLIGHTMASTER
Definition: UnitDefines.h:305
std::vector< MountXDisplayEntry const * > MountXDisplayContainer
Definition: DB2Stores.h:374
bool ActivateTaxiPathTo(std::vector< uint32 > const &nodes, Creature *npc=nullptr, uint32 spellid=0, uint32 preferredMountDisplay=0)
Definition: Player.cpp:22119
uint32 GetMapId() const
Definition: Position.h:186
uint32 FlyingMountID
Definition: TaxiPackets.h:99
uint32 Node
Definition: TaxiPackets.h:97
ObjectGuid Vendor
Definition: TaxiPackets.h:96
void SendActivateTaxiReply(ActivateTaxiReply reply)
Definition: TaxiHandler.cpp:222
std::size_t GetCompleteNodeRoute(TaxiNodesEntry const *from, TaxiNodesEntry const *to, Player const *player, std::vector< uint32 > &shortestPath)
Definition: TaxiPathGraph.cpp:190
auto SelectRandomContainerElement(C const &container) -> typename std::add_const< decltype(*std::begin(container))>::type &
Definition: Containers.h:108
Definition: DB2Structure.h:2743
Definition: DB2Structure.h:2784
float GetPositionZ() const
Definition: Position.h:79
float GetPositionX() const
Definition: Position.h:77
float GetPositionY() const
Definition: Position.h:78
Definition: DB2Structure.h:3867
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleAddFriendOpcode()

void WorldSession::HandleAddFriendOpcode ( WorldPackets::Social::AddFriend packet)
40{
41 if (!normalizePlayerName(packet.Name))
42 return;
43
44 TC_LOG_DEBUG("network", "WorldSession::HandleAddFriendOpcode: {} asked to add friend: {}",
45 GetPlayerInfo(), packet.Name);
46
47 CharacterCacheEntry const* friendCharacterInfo = sCharacterCache->GetCharacterCacheByName(packet.Name);
48 if (!friendCharacterInfo)
49 {
51 return;
52 }
53
54 auto processFriendRequest = [this,
55 playerGuid = _player->GetGUID(),
56 friendGuid = friendCharacterInfo->Guid,
57 friendAccountGuid = ObjectGuid::Create<HighGuid::WowAccount>(friendCharacterInfo->AccountId),
58 team = Player::TeamForRace(friendCharacterInfo->Race),
59 friendNote = std::move(packet.Notes)]()
60 {
61 if (playerGuid.GetCounter() != m_GUIDLow)
62 return; // not the player initiating request, do nothing
63
64 FriendsResult friendResult = FRIEND_NOT_FOUND;
65 if (friendGuid == GetPlayer()->GetGUID())
66 friendResult = FRIEND_SELF;
68 friendResult = FRIEND_ENEMY;
69 else if (GetPlayer()->GetSocial()->HasFriend(friendGuid))
70 friendResult = FRIEND_ALREADY;
71 else
72 {
73 Player* pFriend = ObjectAccessor::FindPlayer(friendGuid);
74 if (pFriend && pFriend->IsVisibleGloballyFor(GetPlayer()))
75 friendResult = FRIEND_ADDED_ONLINE;
76 else
77 friendResult = FRIEND_ADDED_OFFLINE;
78 if (GetPlayer()->GetSocial()->AddToSocialList(friendGuid, friendAccountGuid, SOCIAL_FLAG_FRIEND))
79 GetPlayer()->GetSocial()->SetFriendNote(friendGuid, friendNote);
80 else
81 friendResult = FRIEND_LIST_FULL;
82 }
83
84 sSocialMgr->SendFriendStatus(GetPlayer(), friendResult, friendGuid);
85 };
86
88 {
89 processFriendRequest();
90 return;
91 }
92
93 // First try looking up friend candidate security from online object
94 if (Player* friendPlayer = ObjectAccessor::FindPlayer(friendCharacterInfo->Guid))
95 {
96 if (!AccountMgr::IsPlayerAccount(friendPlayer->GetSession()->GetSecurity()))
97 {
99 return;
100 }
101
102 processFriendRequest();
103 return;
104 }
105
106 // When not found, consult database
108 [this, continuation = std::move(processFriendRequest)](uint32 friendSecurity)
109 {
110 if (!AccountMgr::IsPlayerAccount(friendSecurity))
111 {
112 sSocialMgr->SendFriendStatus(GetPlayer(), FRIEND_NOT_FOUND, ObjectGuid::Empty);
113 return;
114 }
115
116 continuation();
117 }));
118}
#define sCharacterCache
Definition: CharacterCache.h:74
bool normalizePlayerName(std::string &name)
Definition: ObjectMgr.cpp:158
FriendsResult
Results of friend related commands.
Definition: SocialMgr.h:68
@ FRIEND_ENEMY
Definition: SocialMgr.h:79
@ FRIEND_ALREADY
Definition: SocialMgr.h:77
@ FRIEND_ADDED_OFFLINE
Definition: SocialMgr.h:76
@ FRIEND_NOT_FOUND
Definition: SocialMgr.h:73
@ FRIEND_ADDED_ONLINE
Definition: SocialMgr.h:75
@ FRIEND_SELF
Definition: SocialMgr.h:78
@ FRIEND_LIST_FULL
Definition: SocialMgr.h:70
#define sSocialMgr
Definition: SocialMgr.h:161
@ SOCIAL_FLAG_FRIEND
Definition: SocialMgr.h:40
static bool IsPlayerAccount(uint32 gmlevel)
Definition: AccountMgr.cpp:410
static QueryCallback GetSecurityAsync(uint32 accountId, int32 realmId, std::function< void(uint32)> callback)
Definition: AccountMgr.cpp:306
void SetFriendNote(ObjectGuid const &guid, std::string const &note)
Definition: SocialMgr.cpp:123
bool HasFriend(ObjectGuid const &friendGuid)
Definition: SocialMgr.cpp:184
uint32 GetTeam() const
Definition: Player.h:2238
PlayerSocial * GetSocial() const
Definition: Player.h:1179
static uint32 TeamForRace(uint8 race)
Definition: Player.cpp:6414
bool IsVisibleGloballyFor(Player const *player) const
Definition: Player.cpp:23391
std::string Notes
Definition: SocialPackets.h:104
std::string Name
Definition: SocialPackets.h:105
QueryCallbackProcessor & GetQueryProcessor()
Definition: WorldSession.h:1840
Realm realm
Definition: World.cpp:3940
TC_GAME_API Player * FindPlayer(ObjectGuid const &)
Definition: ObjectAccessor.cpp:252
@ RBAC_PERM_ALLOW_GM_FRIEND
Definition: RBAC.h:93
@ RBAC_PERM_TWO_SIDE_ADD_FRIEND
Definition: RBAC.h:82
uint32 Realm
Definition: Realm.h:49
Definition: CharacterCache.h:27
uint8 Race
Definition: CharacterCache.h:32
ObjectGuid Guid
Definition: CharacterCache.h:28
uint32 AccountId
Definition: CharacterCache.h:30
Battlenet::RealmHandle Id
Definition: Realm.h:80
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleAddIgnoreOpcode()

void WorldSession::HandleAddIgnoreOpcode ( WorldPackets::Social::AddIgnore packet)
131{
132 if (!normalizePlayerName(packet.Name))
133 return;
134
135 TC_LOG_DEBUG("network", "WorldSession::HandleAddIgnoreOpcode: {} asked to Ignore: {}",
136 GetPlayer()->GetName(), packet.Name);
137
138 ObjectGuid ignoreGuid;
140
141 if (CharacterCacheEntry const* characterInfo = sCharacterCache->GetCharacterCacheByName(packet.Name))
142 {
143 ignoreGuid = characterInfo->Guid;
144 ObjectGuid ignoreAccountGuid = ObjectGuid::Create<HighGuid::WowAccount>(characterInfo->AccountId);
145 if (ignoreGuid == GetPlayer()->GetGUID()) //not add yourself
146 ignoreResult = FRIEND_IGNORE_SELF;
147 else if (GetPlayer()->GetSocial()->HasIgnore(ignoreGuid, ignoreAccountGuid))
148 ignoreResult = FRIEND_IGNORE_ALREADY;
149 else
150 {
151 ignoreResult = FRIEND_IGNORE_ADDED;
152
153 // ignore list full
154 if (!GetPlayer()->GetSocial()->AddToSocialList(ignoreGuid, ignoreAccountGuid, SOCIAL_FLAG_IGNORED))
155 ignoreResult = FRIEND_IGNORE_FULL;
156 }
157 }
158
159 sSocialMgr->SendFriendStatus(GetPlayer(), ignoreResult, ignoreGuid);
160}
@ FRIEND_IGNORE_FULL
Definition: SocialMgr.h:80
@ FRIEND_IGNORE_ADDED
Definition: SocialMgr.h:84
@ FRIEND_IGNORE_NOT_FOUND
Definition: SocialMgr.h:82
@ FRIEND_IGNORE_SELF
Definition: SocialMgr.h:81
@ FRIEND_IGNORE_ALREADY
Definition: SocialMgr.h:83
@ SOCIAL_FLAG_IGNORED
Definition: SocialMgr.h:41
std::string Name
Definition: SocialPackets.h:136
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleAddonRegisteredPrefixesOpcode()

void WorldSession::HandleAddonRegisteredPrefixesOpcode ( WorldPackets::Chat::ChatRegisterAddonPrefixes packet)
963{
964 // This is always sent after CMSG_CHAT_UNREGISTER_ALL_ADDON_PREFIXES
967 {
968 _filterAddonMessages = false;
969 return;
970 }
971
973}
iterator begin()
Definition: PacketUtilities.h:180
iterator end()
Definition: PacketUtilities.h:183
@ MAX_PREFIXES
Definition: ChatPackets.h:267
Array< std::string, MAX_PREFIXES > Prefixes
Definition: ChatPackets.h:274
std::vector< std::string > _registeredAddonPrefixes
Definition: WorldSession.h:1934
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleAddToy()

void WorldSession::HandleAddToy ( WorldPackets::Toy::AddToy packet)
29{
30 if (!packet.Guid)
31 return;
32
33 Item* item = _player->GetItemByGuid(packet.Guid);
34 if (!item)
35 {
37 return;
38 }
39
40 if (!sDB2Manager.IsToyItem(item->GetEntry()))
41 return;
42
44 if (msg != EQUIP_ERR_OK)
45 {
46 _player->SendEquipError(msg, item, nullptr);
47 return;
48 }
49
50 if (_collectionMgr->AddToy(item->GetEntry(), false, false))
51 _player->DestroyItem(item->GetBagSlot(), item->GetSlot(), true);
52}
InventoryResult
Definition: ItemDefines.h:25
@ EQUIP_ERR_ITEM_NOT_FOUND
Definition: ItemDefines.h:49
uint32 GetEntry() const
Definition: Object.h:159
void SendEquipError(InventoryResult msg, Item const *item1=nullptr, Item const *item2=nullptr, uint32 itemId=0) const
Definition: Player.cpp:13149
InventoryResult CanUseItem(Item *pItem, bool not_loading=true) const
Definition: Player.cpp:11284
ObjectGuid Guid
Definition: ToyPackets.h:35
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleAdventureJournalOpenQuest()

void WorldSession::HandleAdventureJournalOpenQuest ( WorldPackets::AdventureJournal::AdventureJournalOpenQuest openQuest)
26{
27 if (ChrClassUIDisplayEntry const* uiDisplay = sDB2Manager.GetUiDisplayForClass(Classes(_player->GetClass())))
28 if (!_player->MeetPlayerCondition(uiDisplay->AdvGuidePlayerConditionID))
29 return;
30
31 AdventureJournalEntry const* adventureJournal = sAdventureJournalStore.LookupEntry(openQuest.AdventureJournalID);
32 if (!adventureJournal)
33 return;
34
35 if (!_player->MeetPlayerCondition(adventureJournal->PlayerConditionID))
36 return;
37
38 Quest const* quest = sObjectMgr->GetQuestTemplate(adventureJournal->QuestID);
39 if (!quest)
40 return;
41
42 if (_player->CanTakeQuest(quest, true))
44}
DB2Storage< AdventureJournalEntry > sAdventureJournalStore("AdventureJournal.db2", &AdventureJournalLoadInfo::Instance)
Classes
Definition: SharedDefines.h:141
void SendQuestGiverQuestDetails(Quest const *quest, ObjectGuid npcGUID, bool autoLaunched, bool displayPopup) const
Definition: GossipDef.cpp:437
bool MeetPlayerCondition(uint32 conditionId) const
Definition: Player.cpp:28509
bool CanTakeQuest(Quest const *quest, bool msg) const
Definition: Player.cpp:14504
Definition: QuestDef.h:486
uint8 GetClass() const
Definition: Unit.h:861
int32 AdventureJournalID
Definition: AdventureJournalPackets.h:34
Definition: DB2Structure.h:58
int32 QuestID
Definition: DB2Structure.h:71
uint32 PlayerConditionID
Definition: DB2Structure.h:66
Definition: DB2Structure.h:591
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleAdventureJournalUpdateSuggestions()

void WorldSession::HandleAdventureJournalUpdateSuggestions ( WorldPackets::AdventureJournal::AdventureJournalUpdateSuggestions updateSuggestions)
47{
48 if (ChrClassUIDisplayEntry const* uiDisplay = sDB2Manager.GetUiDisplayForClass(Classes(_player->GetClass())))
49 if (!_player->MeetPlayerCondition(uiDisplay->AdvGuidePlayerConditionID))
50 return;
51
53 response.OnLevelUp = updateSuggestions.OnLevelUp;
54
55 for (AdventureJournalEntry const* adventureJournal : sAdventureJournalStore)
56 {
57 if (_player->MeetPlayerCondition(adventureJournal->PlayerConditionID))
58 {
60 adventureJournalData.AdventureJournalID = int32(adventureJournal->ID);
61 adventureJournalData.Priority = int32(adventureJournal->PriorityMax);
62 response.Entries.push_back(adventureJournalData);
63 }
64 }
65
66 SendPacket(response.Write());
67}
int32_t int32
Definition: Define.h:139
Definition: AdventureJournalPackets.h:54
std::vector< AdventureJournalEntry > Entries
Definition: AdventureJournalPackets.h:61
bool OnLevelUp
Definition: AdventureJournalPackets.h:60
WorldPacket const * Write() override
Definition: AdventureJournalPackets.cpp:42
bool OnLevelUp
Definition: AdventureJournalPackets.h:44
Definition: AdventureJournalPackets.h:48
int32 AdventureJournalID
Definition: AdventureJournalPackets.h:49
int32 Priority
Definition: AdventureJournalPackets.h:50
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleAdventureMapStartQuest()

void WorldSession::HandleAdventureMapStartQuest ( WorldPackets::AdventureMap::AdventureMapStartQuest startQuest)
25{
26 Quest const* quest = sObjectMgr->GetQuestTemplate(startQuest.QuestID);
27 if (!quest)
28 return;
29
30 auto itr = std::find_if(sAdventureMapPOIStore.begin(), sAdventureMapPOIStore.end(), [&](AdventureMapPOIEntry const* adventureMap)
31 {
32 return adventureMap->QuestID == uint32(startQuest.QuestID) && _player->MeetPlayerCondition(adventureMap->PlayerConditionID);
33 });
34
35 if (itr == sAdventureMapPOIStore.end())
36 return;
37
38 if (_player->CanTakeQuest(quest, true))
40}
DB2Storage< AdventureMapPOIEntry > sAdventureMapPOIStore("AdventureMapPOI.db2", &AdventureMapPoiLoadInfo::Instance)
void AddQuestAndCheckCompletion(Quest const *quest, Object *questGiver)
Definition: Player.cpp:14663
int32 QuestID
Definition: AdventureMapPackets.h:34
Definition: DB2Structure.h:85
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleAlterAppearance()

void WorldSession::HandleAlterAppearance ( WorldPackets::Character::AlterApperance packet)
1747{
1749 return;
1750
1752 if (!go)
1753 {
1755 return;
1756 }
1757
1759 {
1761 return;
1762 }
1763
1765
1766 // 0 - ok
1767 // 1, 3 - not enough money
1768 // 2 - you have to sit on barber chair
1769 if (!_player->HasEnoughMoney(cost))
1770 {
1772 return;
1773 }
1774
1776
1777 _player->ModifyMoney(-cost); // it isn't free
1778 _player->UpdateCriteria(CriteriaType::MoneySpentAtBarberShop, cost);
1779
1780 if (_player->GetNativeGender() != packet.NewSex)
1781 {
1784 _player->RestoreDisplayId(false);
1785 }
1786
1788
1789 _player->UpdateCriteria(CriteriaType::GotHaircut, 1);
1790
1792
1793 sCharacterCache->UpdateCharacterGender(_player->GetGUID(), packet.NewSex);
1794}
Trinity::IteratorPair< UF::ChrCustomizationChoice const * > MakeChrCustomizationChoiceRange(Container const &container)
Definition: Player.h:3217
Races
Definition: RaceMask.h:26
@ GAMEOBJECT_TYPE_BARBER_CHAIR
Definition: SharedDefines.h:2808
Gender
Definition: SharedDefines.h:131
UnitStandStateType
Definition: UnitDefines.h:36
@ UNIT_STAND_STATE_SIT_LOW_CHAIR
Definition: UnitDefines.h:41
@ UNIT_STAND_STATE_STAND
Definition: UnitDefines.h:37
GameObjectTemplate const * GetGOInfo() const
Definition: GameObject.h:161
void SetNativeGender(Gender gender) override
Definition: Player.h:1234
Gender GetNativeGender() const override
Definition: Player.h:1233
int64 GetBarberShopCost(Trinity::IteratorPair< UF::ChrCustomizationChoice const * > newCustomizations) const
Definition: Player.cpp:25673
void InitDisplayIds()
Definition: Player.cpp:22409
void UpdateCriteria(CriteriaType type, uint64 miscValue1=0, uint64 miscValue2=0, uint64 miscValue3=0, WorldObject *ref=nullptr)
Definition: Player.cpp:26206
void SetCustomizations(Trinity::IteratorPair< Iter > customizations, bool markChanged=true)
Definition: Player.h:2758
void RestoreDisplayId(bool ignorePositiveAurasPreventingMounting=false)
Definition: Unit.cpp:10159
void SetStandState(UnitStandStateType state, uint32 animKitID=0)
Definition: Unit.cpp:10101
UnitStandStateType GetStandState() const
Definition: Unit.h:994
uint8 GetRace() const
Definition: Unit.h:858
GameObject * FindNearestGameObjectOfType(GameobjectTypes type, float range) const
Definition: Object.cpp:2156
Array< ChrCustomizationChoice, 72 > Customizations
Definition: CharacterPackets.h:640
uint8 NewSex
Definition: CharacterPackets.h:639
Definition: CharacterPackets.h:645
bool ValidateAppearance(Races race, Classes playerClass, Gender gender, Trinity::IteratorPair< UF::ChrCustomizationChoice const * > customizations)
Definition: CharacterHandler.cpp:565
constexpr IteratorPair< iterator, end_iterator > MakeIteratorPair(iterator first, end_iterator second)
Definition: IteratorPair.h:48
uint32 chairheight
Definition: GameObjectData.h:181
struct GameObjectTemplate::@214::@248 barberChair
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleAreaSpiritHealerQueryOpcode()

void WorldSession::HandleAreaSpiritHealerQueryOpcode ( WorldPackets::Battleground::AreaSpiritHealerQuery areaSpiritHealerQuery)
653{
654 Creature* unit = ObjectAccessor::GetCreature(*GetPlayer(), areaSpiritHealerQuery.HealerGuid);
655 if (!unit)
656 return;
657
658 if (!unit->IsSpiritService()) // it's not spirit service
659 return;
660
662 sBattlegroundMgr->SendAreaSpiritHealerQueryOpcode(_player, bg, areaSpiritHealerQuery.HealerGuid);
663
664 if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(_player->GetMap(), _player->GetZoneId()))
665 bf->SendAreaSpiritHealerQueryOpcode(_player, areaSpiritHealerQuery.HealerGuid);
666}
#define sBattlefieldMgr
Definition: BattlefieldMgr.h:80
#define sBattlegroundMgr
Definition: BattlegroundMgr.h:203
Definition: Battlefield.h:210
Definition: Battleground.h:256
Battleground * GetBattleground() const
Definition: Player.cpp:24457
bool IsSpiritService() const
Definition: Unit.h:1115
uint32 GetZoneId() const
Definition: Object.h:535
ObjectGuid HealerGuid
Definition: BattlegroundPackets.h:56
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:217
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleAreaSpiritHealerQueueOpcode()

void WorldSession::HandleAreaSpiritHealerQueueOpcode ( WorldPackets::Battleground::AreaSpiritHealerQueue areaSpiritHealerQueue)
669{
670 Creature* unit = ObjectAccessor::GetCreature(*GetPlayer(), areaSpiritHealerQueue.HealerGuid);
671 if (!unit)
672 return;
673
674 if (!unit->IsSpiritService()) // it's not spirit service
675 return;
676
678 bg->AddPlayerToResurrectQueue(areaSpiritHealerQueue.HealerGuid, _player->GetGUID());
679
680 if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(_player->GetMap(), _player->GetZoneId()))
681 bf->AddPlayerToResurrectQueue(areaSpiritHealerQueue.HealerGuid, _player->GetGUID());
682}
ObjectGuid HealerGuid
Definition: BattlegroundPackets.h:66
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleAreaTriggerOpcode()

void WorldSession::HandleAreaTriggerOpcode ( WorldPackets::AreaTrigger::AreaTrigger packet)
476{
477 Player* player = GetPlayer();
478 if (player->IsInFlight())
479 {
480 TC_LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player '{}' {} in flight, ignore Area Trigger ID:{}",
481 player->GetName(), player->GetGUID().ToString(), packet.AreaTriggerID);
482 return;
483 }
484
485 AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(packet.AreaTriggerID);
486 if (!atEntry)
487 {
488 TC_LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player '{}' {} send unknown (by DBC) Area Trigger ID:{}",
489 player->GetName(), player->GetGUID().ToString(), packet.AreaTriggerID);
490 return;
491 }
492
493 if (packet.Entered && !player->IsInAreaTriggerRadius(atEntry))
494 {
495 TC_LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player '{}' {} too far, ignore Area Trigger ID: {}",
496 player->GetName(), player->GetGUID().ToString(), packet.AreaTriggerID);
497 return;
498 }
499
500 if (player->isDebugAreaTriggers)
502
503 if (!sConditionMgr->IsObjectMeetingNotGroupedConditions(CONDITION_SOURCE_TYPE_AREATRIGGER_CLIENT_TRIGGERED, atEntry->ID, player))
504 return;
505
506 if (sScriptMgr->OnAreaTrigger(player, atEntry, packet.Entered))
507 return;
508
509 if (player->IsAlive())
510 {
511 // not using Player::UpdateQuestObjectiveProgress, ObjectID in quest_objectives can be set to -1, areatrigger_involvedrelation then holds correct id
512 if (std::unordered_set<uint32> const* quests = sObjectMgr->GetQuestsForAreaTrigger(packet.AreaTriggerID))
513 {
514 bool anyObjectiveChangedCompletionState = false;
515 for (uint32 questId : *quests)
516 {
517 Quest const* qInfo = sObjectMgr->GetQuestTemplate(questId);
518 uint16 slot = player->FindQuestSlot(questId);
519 if (qInfo && slot < MAX_QUEST_LOG_SIZE && player->GetQuestStatus(questId) == QUEST_STATUS_INCOMPLETE)
520 {
521 for (QuestObjective const& obj : qInfo->Objectives)
522 {
524 continue;
525
526 if (!player->IsQuestObjectiveCompletable(slot, qInfo, obj))
527 continue;
528
529 if (player->IsQuestObjectiveComplete(slot, qInfo, obj))
530 continue;
531
532 if (obj.ObjectID != -1 && obj.ObjectID != packet.AreaTriggerID)
533 continue;
534
535 player->SetQuestObjectiveData(obj, 1);
537 anyObjectiveChangedCompletionState = true;
538 break;
539 }
540
541 if (player->CanCompleteQuest(questId))
542 player->CompleteQuest(questId);
543 }
544 }
545
546 if (anyObjectiveChangedCompletionState)
548 }
549 }
550
551 if (sObjectMgr->IsTavernAreaTrigger(packet.AreaTriggerID))
552 {
553 // set resting flag we are in the inn
554 player->GetRestMgr().SetRestFlag(REST_FLAG_IN_TAVERN, atEntry->ID);
555
556 if (sWorld->IsFFAPvPRealm())
558
559 return;
560 }
561
562 if (Battleground* bg = player->GetBattleground())
563 bg->HandleAreaTrigger(player, packet.AreaTriggerID, packet.Entered);
564
565 if (OutdoorPvP* pvp = player->GetOutdoorPvP())
566 if (pvp->HandleAreaTrigger(_player, packet.AreaTriggerID, packet.Entered))
567 return;
568
569 AreaTriggerStruct const* at = sObjectMgr->GetAreaTrigger(packet.AreaTriggerID);
570 if (!at)
571 return;
572
573 bool teleported = false;
574 if (player->GetMapId() != at->target_mapId)
575 {
576 if (!player->IsAlive())
577 {
578 if (player->HasCorpse())
579 {
580 // let enter in ghost mode in instance that connected to inner instance with corpse
581 uint32 corpseMap = player->GetCorpseLocation().GetMapId();
582 do
583 {
584 if (corpseMap == at->target_mapId)
585 break;
586
587 InstanceTemplate const* corpseInstance = sObjectMgr->GetInstanceTemplate(corpseMap);
588 corpseMap = corpseInstance ? corpseInstance->Parent : 0;
589 } while (corpseMap);
590
591 if (!corpseMap)
592 {
594 return;
595 }
596
597 TC_LOG_DEBUG("maps", "MAP: Player '{}' has corpse in instance {} and can enter.", player->GetName(), at->target_mapId);
598 }
599 else
600 TC_LOG_DEBUG("maps", "Map::CanPlayerEnter - player '{}' is dead but does not have a corpse!", player->GetName());
601 }
602
603 if (TransferAbortParams denyReason = Map::PlayerCannotEnter(at->target_mapId, player))
604 {
605 switch (denyReason.Reason)
606 {
608 TC_LOG_DEBUG("maps", "MAP: Player '{}' attempted to enter map with id {} which has no entry", player->GetName(), at->target_mapId);
609 break;
611 TC_LOG_DEBUG("maps", "MAP: Player '{}' attempted to enter instance map {} but the requested difficulty was not found", player->GetName(), at->target_mapId);
612 break;
614 TC_LOG_DEBUG("maps", "MAP: Player '{}' must be in a raid group to enter map {}", player->GetName(), at->target_mapId);
616 break;
618 TC_LOG_DEBUG("maps", "MAP: Player '{}' cannot enter instance map {} because their permanent bind is incompatible with their group's", player->GetName(), at->target_mapId);
619 break;
621 TC_LOG_DEBUG("maps", "MAP: Player '{}' cannot enter instance map {} because their permanent bind is incompatible with their group's", player->GetName(), at->target_mapId);
622 break;
624 TC_LOG_DEBUG("maps", "MAP: Player '{}' cannot enter instance map {} because he has exceeded the maximum number of instances per hour.", player->GetName(), at->target_mapId);
625 break;
627 break;
629 break;
631 TC_LOG_DEBUG("maps", "MAP: Player '{}' cannot enter instance map {} because instance is resetting.", player->GetName(), at->target_mapId);
632 break;
633 default:
634 break;
635 }
636
637 if (denyReason.Reason != TRANSFER_ABORT_NEED_GROUP)
638 player->SendTransferAborted(at->target_mapId, denyReason.Reason, denyReason.Arg, denyReason.MapDifficultyXConditionId);
639
640 if (!player->IsAlive() && player->HasCorpse())
641 {
642 if (player->GetCorpseLocation().GetMapId() == at->target_mapId)
643 {
644 player->ResurrectPlayer(0.5f);
645 player->SpawnCorpseBones();
646 }
647 }
648
649 return;
650 }
651
652 if (Group* group = player->GetGroup())
653 if (group->isLFGGroup() && player->GetMap()->IsDungeon())
654 teleported = player->TeleportToBGEntryPoint();
655 }
656
657 if (!teleported)
658 {
659 WorldSafeLocsEntry const* entranceLocation = nullptr;
660 MapEntry const* mapEntry = sMapStore.AssertEntry(at->target_mapId);
661 if (mapEntry->Instanceable())
662 {
663 // Check if we can contact the instancescript of the instance for an updated entrance location
664 if (uint32 targetInstanceId = sMapMgr->FindInstanceIdForPlayer(at->target_mapId, _player))
665 if (Map* map = sMapMgr->FindMap(at->target_mapId, targetInstanceId))
666 if (InstanceMap* instanceMap = map->ToInstanceMap())
667 if (InstanceScript* instanceScript = instanceMap->GetInstanceScript())
668 entranceLocation = sObjectMgr->GetWorldSafeLoc(instanceScript->GetEntranceLocation());
669
670 // Finally check with the instancesave for an entrance location if we did not get a valid one from the instancescript
671 if (!entranceLocation)
672 {
673 Group* group = player->GetGroup();
674 Difficulty difficulty = group ? group->GetDifficultyID(mapEntry) : player->GetDifficultyID(mapEntry);
675 ObjectGuid instanceOwnerGuid = group ? group->GetRecentInstanceOwner(at->target_mapId) : player->GetGUID();
676 if (InstanceLock const* instanceLock = sInstanceLockMgr.FindActiveInstanceLock(instanceOwnerGuid, { mapEntry, sDB2Manager.GetDownscaledMapDifficultyData(at->target_mapId, difficulty) }))
677 entranceLocation = sObjectMgr->GetWorldSafeLoc(instanceLock->GetData()->EntranceWorldSafeLocId);
678 }
679 }
680
681 if (entranceLocation)
682 player->TeleportTo(entranceLocation->Loc, TELE_TO_NOT_LEAVE_TRANSPORT);
683 else
685 }
686}
#define sConditionMgr
Definition: ConditionMgr.h:351
@ CONDITION_SOURCE_TYPE_AREATRIGGER_CLIENT_TRIGGERED
Definition: ConditionMgr.h:181
DB2Storage< MapEntry > sMapStore("Map.db2", &MapLoadInfo::Instance)
DB2Storage< AreaTriggerEntry > sAreaTriggerStore("AreaTrigger.db2", &AreaTriggerLoadInfo::Instance)
Difficulty
Definition: DBCEnums.h:732
uint16_t uint16
Definition: Define.h:144
#define sInstanceLockMgr
Definition: InstanceLockMgr.h:318
@ LANG_DEBUG_AREATRIGGER_LEFT
Definition: Language.h:1018
@ LANG_DEBUG_AREATRIGGER_ENTERED
Definition: Language.h:979
#define sMapMgr
Definition: MapManager.h:183
@ TRANSFER_ABORT_TOO_MANY_INSTANCES
Definition: Map.h:89
@ TRANSFER_ABORT_DIFFICULTY
Definition: Map.h:92
@ TRANSFER_ABORT_MAP_NOT_ALLOWED
Definition: Map.h:100
@ TRANSFER_ABORT_MAX_PLAYERS
Definition: Map.h:87
@ TRANSFER_ABORT_ZONE_IN_COMBAT
Definition: Map.h:90
@ TRANSFER_ABORT_ALREADY_COMPLETED_ENCOUNTER
Definition: Map.h:102
@ TRANSFER_ABORT_NOT_FOUND
Definition: Map.h:88
@ TRANSFER_ABORT_LOCKED_TO_DIFFERENT_INSTANCE
Definition: Map.h:101
@ TRANSFER_ABORT_NEED_GROUP
Definition: Map.h:95
@ TELE_TO_NOT_LEAVE_TRANSPORT
Definition: Player.h:823
@ QUEST_OBJECTIVE_AREATRIGGER
Definition: QuestDef.h:322
@ QUEST_STATUS_INCOMPLETE
Definition: QuestDef.h:144
@ REST_FLAG_IN_TAVERN
Definition: RestMgr.h:53
#define sScriptMgr
Definition: ScriptMgr.h:1389
@ RAID_GROUP_ERR_ONLY
Definition: SharedDefines.h:6864
@ UNIT_BYTE2_FLAG_FFA_PVP
Definition: UnitDefines.h:90
Definition: Chat.h:39
void PSendSysMessage(const char *fmt, Args &&... args)
Definition: Chat.h:57
Definition: Group.h:175
ObjectGuid GetRecentInstanceOwner(uint32 mapId) const
Definition: Group.h:340
Difficulty GetDifficultyID(MapEntry const *mapEntry) const
Definition: Group.cpp:1330
Definition: InstanceLockMgr.h:84
Definition: Map.h:819
Definition: InstanceScript.h:186
Definition: Map.h:185
bool IsDungeon() const
Definition: Map.cpp:3195
static TransferAbortParams PlayerCannotEnter(uint32 mapid, Player *player)
Definition: Map.cpp:1772
InstanceMap * ToInstanceMap()
Definition: Map.h:430
Definition: OutdoorPvP.h:155
void UpdateVisibleGameobjectsOrSpellClicks()
Definition: Player.cpp:24685
bool CanCompleteQuest(uint32 quest_id, uint32 ignoredQuestObjectiveId=0)
Definition: Player.cpp:14540
void SendRaidGroupOnlyMessage(RaidGroupReason reason, int32 delay) const
Definition: Player.cpp:28931
uint16 FindQuestSlot(uint32 quest_id) const
Definition: Player.cpp:16235
bool TeleportTo(uint32 mapid, float x, float y, float z, float orientation, uint32 options=0, Optional< uint32 > instanceId={})
Definition: Player.cpp:1318
void SpawnCorpseBones(bool triggerSave=true)
Definition: Player.cpp:4570
bool HasCorpse() const
Definition: Player.h:2167
void CompleteQuest(uint32 quest_id)
Definition: Player.cpp:14918
OutdoorPvP * GetOutdoorPvP() const
Definition: Player.cpp:24888
bool IsQuestObjectiveCompletable(uint16 slot, Quest const *quest, QuestObjective const &objective) const
Definition: Player.cpp:16747
RestMgr & GetRestMgr() const
Definition: Player.h:2711
WorldLocation GetCorpseLocation() const
Definition: Player.h:2168
bool TeleportToBGEntryPoint()
Definition: Player.cpp:1561
Group * GetGroup()
Definition: Player.h:2602
bool IsInAreaTriggerRadius(AreaTriggerEntry const *trigger) const
Definition: Player.cpp:2090
bool IsQuestObjectiveComplete(uint16 slot, Quest const *quest, QuestObjective const &objective) const
Definition: Player.cpp:16805
void SendTransferAborted(uint32 mapid, TransferAbortReason reason, uint8 arg=0, int32 mapDifficultyXConditionID=0) const
Definition: Player.cpp:23970
void SetQuestObjectiveData(QuestObjective const &objective, int32 data)
Definition: Player.cpp:16698
bool isDebugAreaTriggers
Definition: Player.h:2669
void SendQuestUpdateAddCreditSimple(QuestObjective const &obj) const
Definition: Player.cpp:17014
Difficulty GetDifficultyID(MapEntry const *mapEntry) const
Definition: Player.cpp:28767
void ResurrectPlayer(float restore_percent, bool applySickness=false)
Definition: Player.cpp:4382
QuestObjectives Objectives
Definition: QuestDef.h:646
void SetRestFlag(RestFlag restFlag, uint32 triggerId=0)
Definition: RestMgr.cpp:95
bool IsInFlight() const
Definition: Unit.h:1118
void RemovePvpFlag(UnitPVPStateFlags flags)
Definition: Unit.h:977
Definition: AreaTriggerPackets.h:67
int32 AreaTriggerID
Definition: AreaTriggerPackets.h:50
bool Entered
Definition: AreaTriggerPackets.h:51
Definition: DB2Structure.h:171
uint32 ID
Definition: DB2Structure.h:173
Definition: ObjectMgr.h:464
float target_Y
Definition: ObjectMgr.h:467
float target_X
Definition: ObjectMgr.h:466
float target_Z
Definition: ObjectMgr.h:468
uint32 target_mapId
Definition: ObjectMgr.h:465
float target_Orientation
Definition: ObjectMgr.h:469
Definition: ObjectMgr.h:158
uint32 Parent
Definition: ObjectMgr.h:159
Definition: DB2Structure.h:2591
bool Instanceable() const
Definition: DB2Structure.h:2623
Definition: QuestDef.h:394
int32 ObjectID
Definition: QuestDef.h:399
uint8 Type
Definition: QuestDef.h:397
Definition: Map.h:110
Definition: ObjectMgr.h:837
WorldLocation Loc
Definition: ObjectMgr.h:839
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleArtifactAddPower()

void WorldSession::HandleArtifactAddPower ( WorldPackets::Artifact::ArtifactAddPower artifactAddPower)
30{
32 return;
33
34 Item* artifact = _player->GetItemByGuid(artifactAddPower.ArtifactGUID);
35 if (!artifact || artifact->IsArtifactDisabled())
36 return;
37
38 uint32 currentArtifactTier = artifact->GetModifier(ITEM_MODIFIER_ARTIFACT_TIER);
39
40 uint64 xpCost = 0;
42 xpCost = uint64(currentArtifactTier == MAX_ARTIFACT_TIER ? cost->XP2 : cost->XP);
43
44 if (xpCost > artifact->m_itemData->ArtifactXP)
45 return;
46
47 if (artifactAddPower.PowerChoices.empty())
48 return;
49
50 UF::ArtifactPower const* artifactPower = artifact->GetArtifactPower(artifactAddPower.PowerChoices[0].ArtifactPowerID);
51 if (!artifactPower)
52 return;
53
54 ArtifactPowerEntry const* artifactPowerEntry = sArtifactPowerStore.LookupEntry(artifactPower->ArtifactPowerID);
55 if (!artifactPowerEntry)
56 return;
57
58 if (artifactPowerEntry->Tier > currentArtifactTier)
59 return;
60
61 uint32 maxRank = artifactPowerEntry->MaxPurchasableRank;
62 if (artifactPowerEntry->Tier < currentArtifactTier)
63 {
64 if (artifactPowerEntry->Flags & ARTIFACT_POWER_FLAG_FINAL)
65 maxRank = 1;
66 else if (artifactPowerEntry->Flags & ARTIFACT_POWER_FLAG_MAX_RANK_WITH_TIER)
67 maxRank += currentArtifactTier - artifactPowerEntry->Tier;
68 }
69
70 if (artifactAddPower.PowerChoices[0].Rank != artifactPower->PurchasedRank + 1 ||
71 artifactAddPower.PowerChoices[0].Rank > maxRank)
72 return;
73
74 if (!(artifactPowerEntry->Flags & ARTIFACT_POWER_FLAG_NO_LINK_REQUIRED))
75 {
76 if (std::vector<uint32> const* artifactPowerLinks = sDB2Manager.GetArtifactPowerLinks(artifactPower->ArtifactPowerID))
77 {
78 bool hasAnyLink = false;
79 for (uint32 artifactPowerLinkId : *artifactPowerLinks)
80 {
81 ArtifactPowerEntry const* artifactPowerLink = sArtifactPowerStore.LookupEntry(artifactPowerLinkId);
82 if (!artifactPowerLink)
83 continue;
84
85 UF::ArtifactPower const* artifactPowerLinkLearned = artifact->GetArtifactPower(artifactPowerLinkId);
86 if (!artifactPowerLinkLearned)
87 continue;
88
89 if (artifactPowerLinkLearned->PurchasedRank >= artifactPowerLink->MaxPurchasableRank)
90 {
91 hasAnyLink = true;
92 break;
93 }
94 }
95
96 if (!hasAnyLink)
97 return;
98 }
99 }
100
101 ArtifactPowerRankEntry const* artifactPowerRank = sDB2Manager.GetArtifactPowerRank(artifactPower->ArtifactPowerID, artifactPower->CurrentRankWithBonus + 1 - 1); // need data for next rank, but -1 because of how db2 data is structured
102 if (!artifactPowerRank)
103 return;
104
105 artifact->SetArtifactPower(artifactPower->ArtifactPowerID, artifactPower->PurchasedRank + 1, artifactPower->CurrentRankWithBonus + 1);
106
107 if (artifact->IsEquipped())
108 {
109 _player->ApplyArtifactPowerRank(artifact, artifactPowerRank, true);
110
111 for (UF::ArtifactPower const& power : artifact->m_itemData->ArtifactPowers)
112 {
113 ArtifactPowerEntry const* scaledArtifactPowerEntry = sArtifactPowerStore.AssertEntry(power.ArtifactPowerID);
114 if (!(scaledArtifactPowerEntry->Flags & ARTIFACT_POWER_FLAG_SCALES_WITH_NUM_POWERS))
115 continue;
116
117 ArtifactPowerRankEntry const* scaledArtifactPowerRank = sDB2Manager.GetArtifactPowerRank(scaledArtifactPowerEntry->ID, 0);
118 if (!scaledArtifactPowerRank)
119 continue;
120
121 artifact->SetArtifactPower(power.ArtifactPowerID, power.PurchasedRank, power.CurrentRankWithBonus + 1);
122
123 _player->ApplyArtifactPowerRank(artifact, scaledArtifactPowerRank, false);
124 _player->ApplyArtifactPowerRank(artifact, scaledArtifactPowerRank, true);
125 }
126 }
127
128 artifact->SetArtifactXP(artifact->m_itemData->ArtifactXP - xpCost);
129 artifact->SetState(ITEM_CHANGED, _player);
130
131 uint32 totalPurchasedArtifactPower = artifact->GetTotalPurchasedArtifactPowers();
132 uint32 artifactTier = 0;
133
134 for (ArtifactTierEntry const* tier : sArtifactTierStore)
135 {
136 if (artifactPowerEntry->Flags & ARTIFACT_POWER_FLAG_FINAL && artifactPowerEntry->Tier < MAX_ARTIFACT_TIER)
137 {
138 artifactTier = artifactPowerEntry->Tier + 1;
139 break;
140 }
141
142 if (totalPurchasedArtifactPower < tier->MaxNumTraits)
143 {
144 artifactTier = tier->ArtifactTier;
145 break;
146 }
147 }
148
149 artifactTier = std::max(artifactTier, currentArtifactTier);
150
151 for (uint32 i = currentArtifactTier; i <= artifactTier; ++i)
152 artifact->InitArtifactPowers(artifact->GetTemplate()->GetArtifactID(), uint8(i));
153
154 artifact->SetModifier(ITEM_MODIFIER_ARTIFACT_TIER, artifactTier);
155}
DB2Storage< ArtifactPowerEntry > sArtifactPowerStore("ArtifactPower.db2", &ArtifactPowerLoadInfo::Instance)
DB2Storage< ArtifactTierEntry > sArtifactTierStore("ArtifactTier.db2", &ArtifactTierLoadInfo::Instance)
@ ARTIFACT_POWER_FLAG_SCALES_WITH_NUM_POWERS
Definition: DBCEnums.h:168
@ ARTIFACT_POWER_FLAG_MAX_RANK_WITH_TIER
Definition: DBCEnums.h:170
@ ARTIFACT_POWER_FLAG_NO_LINK_REQUIRED
Definition: DBCEnums.h:166
@ ARTIFACT_POWER_FLAG_FINAL
Definition: DBCEnums.h:167
#define MAX_ARTIFACT_TIER
Definition: DBCEnums.h:175
uint64_t uint64
Definition: Define.h:142
GameTable< GtArtifactLevelXPEntry > sArtifactLevelXPGameTable
Definition: GameTables.cpp:28
@ ITEM_MODIFIER_ARTIFACT_TIER
Definition: ItemDefines.h:231
@ ITEM_CHANGED
Definition: Item.h:55
@ GAMEOBJECT_TYPE_ITEM_FORGE
Definition: SharedDefines.h:2823
void SetState(ItemUpdateState state, Player *forplayer=nullptr)
Definition: Item.cpp:1165
void SetArtifactPower(uint16 artifactPowerId, uint8 purchasedRank, uint8 currentRankWithBonus)
Definition: Item.cpp:2579
void InitArtifactPowers(uint8 artifactId, uint8 artifactTier)
Definition: Item.cpp:2594
void SetModifier(ItemModifier modifier, uint32 value)
Definition: Item.cpp:2426
bool IsEquipped() const
Definition: Item.cpp:1243
UF::ArtifactPower const * GetArtifactPower(uint32 artifactPowerId) const
Definition: Item.cpp:2559
bool IsArtifactDisabled() const
Definition: Item.cpp:2551
void SetArtifactXP(uint64 xp)
Definition: Item.h:437
uint32 GetModifier(ItemModifier modifier) const
Definition: Item.cpp:2413
uint32 GetTotalPurchasedArtifactPowers() const
Definition: Item.cpp:2635
UF::UpdateField< UF::ItemData, 0, TYPEID_ITEM > m_itemData
Definition: Item.h:448
void ApplyArtifactPowerRank(Item *artifact, ArtifactPowerRankEntry const *artifactPowerRank, bool apply)
Definition: Player.cpp:8375
ObjectGuid ArtifactGUID
Definition: ArtifactPackets.h:42
Array< ArtifactPowerChoice, 1 > PowerChoices
Definition: ArtifactPackets.h:44
ObjectGuid ForgeGUID
Definition: ArtifactPackets.h:43
Definition: DB2Structure.h:255
uint8 MaxPurchasableRank
Definition: DB2Structure.h:259
uint32 ID
Definition: DB2Structure.h:257
uint8 Tier
Definition: DB2Structure.h:262
uint8 Flags
Definition: DB2Structure.h:261
Definition: DB2Structure.h:279
Definition: DB2Structure.h:295
Definition: GameTables.h:33
uint8 GetArtifactID() const
Definition: ItemTemplate.h:806
Definition: UpdateFields.h:96
uint8 PurchasedRank
Definition: UpdateFields.h:98
int16 ArtifactPowerID
Definition: UpdateFields.h:97
uint8 CurrentRankWithBonus
Definition: UpdateFields.h:99
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleArtifactSetAppearance()

void WorldSession::HandleArtifactSetAppearance ( WorldPackets::Artifact::ArtifactSetAppearance artifactSetAppearance)
158{
160 return;
161
162 ArtifactAppearanceEntry const* artifactAppearance = sArtifactAppearanceStore.LookupEntry(artifactSetAppearance.ArtifactAppearanceID);
163 if (!artifactAppearance)
164 return;
165
166 Item* artifact = _player->GetItemByGuid(artifactSetAppearance.ArtifactGUID);
167 if (!artifact)
168 return;
169
170 ArtifactAppearanceSetEntry const* artifactAppearanceSet = sArtifactAppearanceSetStore.LookupEntry(artifactAppearance->ArtifactAppearanceSetID);
171 if (!artifactAppearanceSet || artifactAppearanceSet->ArtifactID != artifact->GetTemplate()->GetArtifactID())
172 return;
173
174 if (PlayerConditionEntry const* playerCondition = sPlayerConditionStore.LookupEntry(artifactAppearance->UnlockPlayerConditionID))
175 if (!sConditionMgr->IsPlayerMeetingCondition(_player, playerCondition))
176 return;
177
178 artifact->SetAppearanceModId(artifactAppearance->ItemAppearanceModifierID);
179 artifact->SetModifier(ITEM_MODIFIER_ARTIFACT_APPEARANCE_ID, artifactAppearance->ID);
180 artifact->SetState(ITEM_CHANGED, _player);
181 Item* childItem = _player->GetChildItemByGuid(artifact->GetChildItem());
182 if (childItem)
183 {
184 childItem->SetAppearanceModId(artifactAppearance->ItemAppearanceModifierID);
185 childItem->SetState(ITEM_CHANGED, _player);
186 }
187
188 if (artifact->IsEquipped())
189 {
190 // change weapon appearance
191 _player->SetVisibleItemSlot(artifact->GetSlot(), artifact);
192 if (childItem)
193 _player->SetVisibleItemSlot(childItem->GetSlot(), childItem);
194
195 // change druid form appearance
196 if (artifactAppearance->OverrideShapeshiftDisplayID && artifactAppearance->OverrideShapeshiftFormID && _player->GetShapeshiftForm() == ShapeshiftForm(artifactAppearance->OverrideShapeshiftFormID))
198 }
199}
DB2Storage< ArtifactAppearanceEntry > sArtifactAppearanceStore("ArtifactAppearance.db2", &ArtifactAppearanceLoadInfo::Instance)
DB2Storage< PlayerConditionEntry > sPlayerConditionStore("PlayerCondition.db2", &PlayerConditionLoadInfo::Instance)
DB2Storage< ArtifactAppearanceSetEntry > sArtifactAppearanceSetStore("ArtifactAppearanceSet.db2", &ArtifactAppearanceSetLoadInfo::Instance)
@ ITEM_MODIFIER_ARTIFACT_APPEARANCE_ID
Definition: ItemDefines.h:215
ShapeshiftForm
Definition: SpellAuraDefines.h:641
void SetAppearanceModId(uint32 appearanceModId)
Definition: Item.h:346
ObjectGuid GetChildItem() const
Definition: Item.h:422
Item * GetChildItemByGuid(ObjectGuid guid) const
Definition: Player.cpp:9598
void SetVisibleItemSlot(uint8 slot, Item *pItem)
Definition: Player.cpp:11890
ShapeshiftForm GetShapeshiftForm() const
Definition: Unit.h:1550
bool IsMounted() const
Definition: Unit.h:1006
ObjectGuid ForgeGUID
Definition: ArtifactPackets.h:55
int32 ArtifactAppearanceID
Definition: ArtifactPackets.h:56
ObjectGuid ArtifactGUID
Definition: ArtifactPackets.h:54
Definition: DB2Structure.h:215
uint32 ID
Definition: DB2Structure.h:217
uint32 UnlockPlayerConditionID
Definition: DB2Structure.h:220
uint16 ArtifactAppearanceSetID
Definition: DB2Structure.h:218
uint8 OverrideShapeshiftFormID
Definition: DB2Structure.h:225
uint32 OverrideShapeshiftDisplayID
Definition: DB2Structure.h:226
uint8 ItemAppearanceModifierID
Definition: DB2Structure.h:221
Definition: DB2Structure.h:235
uint32 ArtifactID
Definition: DB2Structure.h:244
Definition: DB2Structure.h:2870
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleAttackStopOpcode()

void WorldSession::HandleAttackStopOpcode ( WorldPackets::Combat::AttackStop packet)
64{
66}
bool AttackStop()
Definition: Unit.cpp:5654
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleAttackSwingOpcode()

void WorldSession::HandleAttackSwingOpcode ( WorldPackets::Combat::AttackSwing packet)

Client explicitly checks the following before sending CMSG_ATTACK_SWING packet, so we'll place the same check here. Note that it might be possible to reuse this snippet in other places as well.

29{
30 Unit* enemy = ObjectAccessor::GetUnit(*_player, packet.Victim);
31
32 if (!enemy)
33 {
34 // stop attack state at client
35 SendAttackStop(nullptr);
36 return;
37 }
38
39 if (!_player->IsValidAttackTarget(enemy))
40 {
41 // stop attack state at client
42 SendAttackStop(enemy);
43 return;
44 }
45
49 if (Vehicle* vehicle = _player->GetVehicle())
50 {
51 VehicleSeatEntry const* seat = vehicle->GetSeatForPassenger(_player);
52 ASSERT(seat);
54 {
55 SendAttackStop(enemy);
56 return;
57 }
58 }
59
60 _player->Attack(enemy, true);
61}
@ VEHICLE_SEAT_FLAG_CAN_ATTACK
Definition: DBCEnums.h:2223
#define ASSERT
Definition: Errors.h:68
Definition: Unit.h:739
Vehicle * GetVehicle() const
Definition: Unit.h:1806
bool Attack(Unit *victim, bool meleeAttack)
Definition: Unit.cpp:5538
Definition: Vehicle.h:31
bool IsValidAttackTarget(WorldObject const *target, SpellInfo const *bySpell=nullptr) const
Definition: Object.cpp:2927
ObjectGuid Victim
Definition: CombatPackets.h:37
void SendAttackStop(Unit const *enemy)
Definition: CombatHandler.cpp:79
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:206
Definition: DB2Structure.h:4341
int32 Flags
Definition: DB2Structure.h:4345
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleAuctionBrowseQuery()

void WorldSession::HandleAuctionBrowseQuery ( WorldPackets::AuctionHouse::AuctionBrowseQuery browseQuery)
37{
38 AuctionThrottleResult throttle = sAuctionMgr->CheckThrottle(_player, browseQuery.TaintedBy.has_value());
39 if (throttle.Throttled)
40 return;
41
43 if (!creature)
44 {
45 TC_LOG_DEBUG("network", "WORLD: HandleAuctionListItems - {} not found or you can't interact with him.", browseQuery.Auctioneer.ToString());
46 return;
47 }
48
49 // remove fake death
50 if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
52
53 AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction());
54
55 TC_LOG_DEBUG("auctionHouse", "Auctionhouse search {}, searchedname: {}, levelmin: {}, levelmax: {}, filters: {}",
56 browseQuery.Auctioneer.ToString(), browseQuery.Name, browseQuery.MinLevel, browseQuery.MaxLevel, AsUnderlyingType(browseQuery.Filters));
57
58 std::wstring name;
59 if (!Utf8toWStr(browseQuery.Name, name))
60 return;
61
63
65 if (!browseQuery.ItemClassFilters.empty())
66 {
67 classFilters.emplace();
68
69 for (auto const& classFilter : browseQuery.ItemClassFilters)
70 {
71 if (!classFilter.SubClassFilters.empty())
72 {
73 for (auto const& subClassFilter : classFilter.SubClassFilters)
74 {
75 if (classFilter.ItemClass < MAX_ITEM_CLASS)
76 {
77 classFilters->Classes[classFilter.ItemClass].SubclassMask |= 1 << subClassFilter.ItemSubclass;
78 if (subClassFilter.ItemSubclass < MAX_ITEM_SUBCLASS_TOTAL)
79 classFilters->Classes[classFilter.ItemClass].InvTypes[subClassFilter.ItemSubclass] = subClassFilter.InvTypeMask;
80 }
81 }
82 }
83 else
84 classFilters->Classes[classFilter.ItemClass].SubclassMask = AuctionSearchClassFilters::FILTER_SKIP_SUBCLASS;
85 }
86 }
87
88 auctionHouse->BuildListBuckets(listBucketsResult, _player,
89 name, browseQuery.MinLevel, browseQuery.MaxLevel, browseQuery.Filters, classFilters,
90 browseQuery.KnownPets.data(), browseQuery.KnownPets.size(), browseQuery.MaxPetLevel,
91 browseQuery.Offset, browseQuery.Sorts.data(), browseQuery.Sorts.size());
92
93 listBucketsResult.BrowseMode = AuctionHouseBrowseMode::Search;
94 listBucketsResult.DesiredDelay = uint32(throttle.DelayUntilNext.count());
95 SendPacket(listBucketsResult.Write());
96}
#define sAuctionMgr
Definition: AuctionHouseMgr.h:433
#define MAX_ITEM_SUBCLASS_TOTAL
Definition: ItemTemplate.h:742
#define MAX_ITEM_CLASS
Definition: ItemTemplate.h:424
std::optional< T > Optional
Optional helper class to wrap optional values within.
Definition: Optional.h:25
@ SPELL_AURA_FEIGN_DEATH
Definition: SpellAuraDefines.h:160
@ UNIT_NPC_FLAG_AUCTIONEER
Definition: UnitDefines.h:313
@ UNIT_STATE_DIED
Definition: Unit.h:244
bool Utf8toWStr(char const *utf8str, size_t csize, wchar_t *wstr, size_t &wsize)
Definition: Util.cpp:367
constexpr std::underlying_type< E >::type AsUnderlyingType(E enumValue)
Definition: Util.h:475
Definition: AuctionHouseMgr.h:278
void BuildListBuckets(WorldPackets::AuctionHouse::AuctionListBucketsResult &listBucketsResult, Player *player, std::wstring const &name, uint8 minLevel, uint8 maxLevel, EnumFlag< AuctionHouseFilterMask > filters, Optional< AuctionSearchClassFilters > const &classFilters, uint8 const *knownPetBits, std::size_t knownPetBitsCount, uint8 maxKnownPetLevel, uint32 offset, WorldPackets::AuctionHouse::AuctionSortDef const *sorts, std::size_t sortCount)
Definition: AuctionHouseMgr.cpp:1179
void RemoveAurasByType(AuraType auraType, std::function< bool(AuraApplication const *)> const &check, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
Definition: Unit.cpp:3692
uint32 GetFaction() const override
Definition: Unit.h:966
uint32 Offset
Definition: AuctionHousePackets.h:152
int8 MaxPetLevel
Definition: AuctionHousePackets.h:157
std::vector< uint8 > KnownPets
Definition: AuctionHousePackets.h:156
uint8 MaxLevel
Definition: AuctionHousePackets.h:154
Array< AuctionSortDef, 2 > Sorts
Definition: AuctionHousePackets.h:161
uint8 MinLevel
Definition: AuctionHousePackets.h:153
Optional< Addon::AddOnInfo > TaintedBy
Definition: AuctionHousePackets.h:158
Array< AuctionListFilterClass, 7 > ItemClassFilters
Definition: AuctionHousePackets.h:160
AuctionHouseFilterMask Filters
Definition: AuctionHousePackets.h:155
ObjectGuid Auctioneer
Definition: AuctionHousePackets.h:151
std::string Name
Definition: AuctionHousePackets.h:159
Definition: AuctionHousePackets.h:438
AuctionHouseBrowseMode BrowseMode
Definition: AuctionHousePackets.h:448
WorldPacket const * Write() override
Definition: AuctionHousePackets.cpp:609
uint32 DesiredDelay
Definition: AuctionHousePackets.h:445
@ FILTER_SKIP_SUBCLASS
Definition: AuctionHouseMgr.h:142
Definition: AuctionHouseMgr.h:271
bool Throttled
Definition: AuctionHouseMgr.h:273
Milliseconds DelayUntilNext
Definition: AuctionHouseMgr.h:272
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleAuctionCancelCommoditiesPurchase()

void WorldSession::HandleAuctionCancelCommoditiesPurchase ( WorldPackets::AuctionHouse::AuctionCancelCommoditiesPurchase cancelCommoditiesPurchase)
99{
100 AuctionThrottleResult throttle = sAuctionMgr->CheckThrottle(_player, cancelCommoditiesPurchase.TaintedBy.has_value(), AuctionCommand::PlaceBid);
101 if (throttle.Throttled)
102 return;
103
105 if (!creature)
106 {
107 TC_LOG_DEBUG("network", "WORLD: HandleAuctionCancelCommoditiesPurchase - {} not found or you can't interact with him.",
108 cancelCommoditiesPurchase.Auctioneer.ToString());
109 return;
110 }
111
112 // remove fake death
113 if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
115
116 AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction());
117 auctionHouse->CancelCommodityQuote(_player->GetGUID());
118}
void CancelCommodityQuote(ObjectGuid guid)
Definition: AuctionHouseMgr.cpp:1607
ObjectGuid Auctioneer
Definition: AuctionHousePackets.h:171
Optional< Addon::AddOnInfo > TaintedBy
Definition: AuctionHousePackets.h:172
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleAuctionConfirmCommoditiesPurchase()

void WorldSession::HandleAuctionConfirmCommoditiesPurchase ( WorldPackets::AuctionHouse::AuctionConfirmCommoditiesPurchase confirmCommoditiesPurchase)
121{
122 AuctionThrottleResult throttle = sAuctionMgr->CheckThrottle(_player, confirmCommoditiesPurchase.TaintedBy.has_value(), AuctionCommand::PlaceBid);
123 if (throttle.Throttled)
124 return;
125
127 if (!creature)
128 {
129 TC_LOG_DEBUG("network", "WORLD: HandleAuctionConfirmCommoditiesPurchase - {} not found or you can't interact with him.", confirmCommoditiesPurchase.Auctioneer.ToString());
130 return;
131 }
132
133 // remove fake death
134 if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
136
137 AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(creature->GetFaction());
138
139 CharacterDatabaseTransaction trans = CharacterDatabase.BeginTransaction();
140 if (auctionHouse->BuyCommodity(trans, _player, confirmCommoditiesPurchase.ItemID, confirmCommoditiesPurchase.Quantity, throttle.DelayUntilNext))
141 {
142 AddTransactionCallback(CharacterDatabase.AsyncCommitTransaction(trans)).AfterComplete([this, buyerGuid = _player->GetGUID(), throttle](bool success)
143 {
144 if (GetPlayer() && GetPlayer()->GetGUID() == buyerGuid)
145 {
146 if (success)
147 {
148 GetPlayer()->UpdateCriteria(CriteriaType::AuctionsWon, 1);
149 SendAuctionCommandResult(0, AuctionCommand::PlaceBid, AuctionResult::Ok, throttle.DelayUntilNext);
150 }
151 else
152 SendAuctionCommandResult(0, AuctionCommand::PlaceBid, AuctionResult::CommodityPurchaseFailed, throttle.DelayUntilNext);
153 }
154 });
155 }
156}
bool BuyCommodity(CharacterDatabaseTransaction trans, Player *player, uint32 itemId, uint32 quantity, Milliseconds delayForNextAction)
Definition: AuctionHouseMgr.cpp:1612
void AfterComplete(std::function< void(bool)> callback) &
Definition: Transaction.h:112
ObjectGuid Auctioneer
Definition: AuctionHousePackets.h:182
int32 ItemID
Definition: AuctionHousePackets.h:183
Optional< Addon::AddOnInfo > TaintedBy
Definition: AuctionHousePackets.h:185
uint32 Quantity
Definition: AuctionHousePackets.h:184
TransactionCallback & AddTransactionCallback(TransactionCallback &&callback)
Definition: WorldSession.cpp:991
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HandleAuctionGetCommodityQuote()

void WorldSession::HandleAuctionGetCommodityQuote ( WorldPackets::AuctionHouse::AuctionGetCommodityQuote startCommoditiesPurchase)
159{
160 AuctionThrottleResult throttle = sAuctionMgr->CheckThrottle(_player, getCommodityQuote.TaintedBy.has_value(), AuctionCommand::PlaceBid);
161