TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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
 
void ReadAddonsInfo (ByteBuffer &data)
 
void SendAddonsInfo ()
 
bool IsAddonRegistered (const std::string &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, DeclinedName *declinedName)
 
void SendPartyResult (PartyOperation operation, std::string const &member, PartyResult res, uint32 val=0)
 
void SendSetPhaseShift (std::set< uint32 > const &phaseIds, std::set< uint32 > const &terrainswaps, std::set< uint32 > const &worldMapAreaSwaps)
 
void SendQueryTimeResponse ()
 
void SendAuthResponse (uint32 code, bool queued, uint32 queuePos=0)
 
void SendClientCacheVersion (uint32 version)
 
void InitializeSession ()
 
void InitializeSessionCallback (SQLQueryHolder *realmHolder, SQLQueryHolder *holder)
 
rbac::RBACDataGetRBACData ()
 
bool HasPermission (uint32 permissionId)
 
void LoadPermissions ()
 
PreparedQueryResultFuture LoadPermissionsAsync ()
 
void InvalidateRBACData ()
 
AccountTypes GetSecurity () const
 
uint32 GetAccountId () const
 
ObjectGuid GetAccountGUID () const
 
std::string constGetAccountName () const
 
uint32 GetBattlenetAccountId () const
 
ObjectGuid GetBattlenetAccountGUID () const
 
PlayerGetPlayer () const
 
std::string constGetPlayerName () const
 
std::string GetPlayerInfo () const
 
void SetSecurity (AccountTypes security)
 
std::string constGetRemoteAddress () const
 
void SetPlayer (Player *player)
 
uint8 GetExpansion () const
 
std::string constGetOS () const
 
void InitWarden (BigNumber *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 ()
 Kick a player out of the World. More...
 
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 SendAuthWaitQue (uint32 position)
 Handle the authentication waiting queue (to be completed) More...
 
void SendSetTimeZoneInformation ()
 
void SendFeatureSystemStatus ()
 
void SendFeatureSystemStatusGlueScreen ()
 
void SendNameQueryOpcode (ObjectGuid guid)
 
void SendTrainerList (ObjectGuid guid)
 
void SendTrainerList (ObjectGuid guid, std::string const &strTitle)
 
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 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 SendStablePetCallback (PreparedQueryResult result, ObjectGuid guid)
 
void SendPetStableResult (uint8 guid)
 
bool CheckStableMaster (ObjectGuid guid)
 
AccountData constGetAccountData (AccountDataType type) const
 
void SetAccountData (AccountDataType type, uint32 time, std::string const &data)
 
void LoadAccountData (PreparedQueryResult result, uint32 mask)
 
void LoadTutorialsData (PreparedQueryResult result)
 
void SendTutorialsData ()
 
void SaveTutorialsData (SQLTransaction &trans)
 
uint32 GetTutorialInt (uint8 index) const
 
void SetTutorialInt (uint8 index, uint32 value)
 
bool SendItemInfo (uint32 itemid, WorldPacket data)
 
void SendAuctionHello (ObjectGuid guid, Creature *unit)
 
void SendAuctionCommandResult (AuctionEntry *auction, uint32 Action, uint32 ErrorCode, uint32 bidError=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 SendAuctionOutBidNotification (AuctionEntry const *auction, Item const *item)
 
void SendAuctionClosedNotification (AuctionEntry const *auction, float mailDelay, bool sold, Item const *item)
 
void SendAuctionWonNotification (AuctionEntry const *auction, Item const *item)
 
void SendAuctionOwnerBidNotification (AuctionEntry const *auction, Item const *item)
 
void SendBlackMarketOpenResult (ObjectGuid guid, Creature *auctioneer)
 
void SendEnchantmentLog (ObjectGuid target, ObjectGuid caster, uint32 itemId, uint32 enchantId)
 
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 SendNotInArenaTeamPacket (uint8 type)
 
void SendPetitionShowList (ObjectGuid guid)
 
void DoLootRelease (ObjectGuid lguid)
 
LocaleConstant GetSessionDbcLocale () const
 
LocaleConstant GetSessionDbLocaleIndex () const
 
char constGetTrinityString (uint32 entry) const
 
uint32 GetLatency () const
 
void SetLatency (uint32 latency)
 
void ResetClientTimeDelay ()
 
void UpdateTimeOutTime (uint32 diff)
 
void ResetTimeOutTime ()
 
bool IsConnectionIdle () const
 
uint32 GetRecruiterId () const
 
bool IsARecruiter () const
 
BattlePetMgrGetBattlePetMgr () const
 
CollectionMgrGetCollectionMgr () const
 
void Handle_NULL (WorldPackets::Null &null)
 
void Handle_EarlyProccess (WorldPacket &recvPacket)
 
void HandleCharEnum (PreparedQueryResult result)
 
void HandleCharEnumOpcode (WorldPackets::Character::EnumCharacters &)
 
void HandleCharUndeleteEnum (PreparedQueryResult result)
 
void HandleCharUndeleteEnumOpcode (WorldPackets::Character::EnumCharacters &)
 
void HandleCharDeleteOpcode (WorldPackets::Character::CharDelete &charDelete)
 
void HandleCharCreateOpcode (WorldPackets::Character::CreateCharacter &charCreate)
 
void HandleCharCreateCallback (PreparedQueryResult result, WorldPackets::Character::CharacterCreateInfo *createInfo)
 
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 *holder)
 
void HandleCharRenameOpcode (WorldPackets::Character::CharacterRenameRequest &request)
 
void HandleCharRenameCallBack (PreparedQueryResult result, WorldPackets::Character::CharacterRenameInfo *renameInfo)
 
void HandleSetPlayerDeclinedNames (WorldPackets::Character::SetPlayerDeclinedNames &packet)
 
void HandleAlterAppearance (WorldPackets::Character::AlterApperance &packet)
 
void HandleCharCustomizeOpcode (WorldPackets::Character::CharCustomize &packet)
 
void HandleCharCustomizeCallback (PreparedQueryResult result, WorldPackets::Character::CharCustomizeInfo *customizeInfo)
 
void HandleCharRaceOrFactionChangeOpcode (WorldPackets::Character::CharRaceOrFactionChange &packet)
 
void HandleCharRaceOrFactionChangeCallback (PreparedQueryResult result, WorldPackets::Character::CharRaceOrFactionChangeInfo *factionChangeInfo)
 
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)
 
void HandleCharUndeleteCallback (PreparedQueryResult result, WorldPackets::Character::CharacterUndeleteInfo *undeleteInfo)
 
void SendCharCreate (ResponseCodes result)
 
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 SendBarberShopResult (BarberShopResult result)
 
void SendUndeleteCooldownStatusResponse (uint32 currentCooldown, uint32 maxCooldown)
 
void SendUndeleteCharacterResponse (CharacterUndeleteResult result, WorldPackets::Character::CharacterUndeleteInfo const *undeleteInfo)
 
void HandlePlayedTime (WorldPackets::Character::RequestPlayedTime &packet)
 
void HandleLookingForGroup (WorldPacket &recvPacket)
 
void HandlePortGraveyard (WorldPackets::Misc::PortGraveyard &packet)
 
void HandleRequestCemeteryList (WorldPackets::Misc::RequestCemeteryList &packet)
 
void HandleInspectOpcode (WorldPackets::Inspect::Inspect &inspect)
 
void HandleRequestHonorStatsOpcode (WorldPackets::Inspect::RequestHonorStats &request)
 
void HandleInspectPVP (WorldPackets::Inspect::InspectPVPRequest &request)
 
void HandleQueryInspectAchievements (WorldPackets::Inspect::QueryInspectAchievements &inspect)
 
void HandleMountSpecialAnimOpcode (WorldPackets::Misc::MountSpecial &mountSpecial)
 
void HandleShowingHelmOpcode (WorldPackets::Character::ShowingHelm &packet)
 
void HandleShowingCloakOpcode (WorldPackets::Character::ShowingCloak &packet)
 
void HandleRepairItemOpcode (WorldPackets::Item::RepairItem &packet)
 
void HandleMoveKnockBackAck (WorldPackets::Movement::MovementAckMessage &movementAck)
 
void HandleMoveTeleportAck (WorldPackets::Movement::MoveTeleportAck &packet)
 
void HandleForceSpeedChangeAck (WorldPackets::Movement::MovementSpeedAck &packet)
 
void HandleSetCollisionHeightAck (WorldPackets::Movement::MoveSetCollisionHeightAck &setCollisionHeightAck)
 
void HandlePingOpcode (WorldPacket &recvPacket)
 
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 (WorldPacket &recvPacket)
 
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 HandleSupportTicketSubmitBug (WorldPackets::Ticket::SupportTicketSubmitBug &packet)
 
void HandleSupportTicketSubmitSuggestion (WorldPackets::Ticket::SupportTicketSubmitSuggestion &packet)
 
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 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 HandleAddFriendOpcodeCallBack (PreparedQueryResult result, std::string const &friendNote)
 
void HandleDelFriendOpcode (WorldPackets::Social::DelFriend &packet)
 
void HandleAddIgnoreOpcode (WorldPackets::Social::AddIgnore &packet)
 
void HandleAddIgnoreOpcodeCallBack (PreparedQueryResult result)
 
void HandleDelIgnoreOpcode (WorldPackets::Social::DelIgnore &packet)
 
void HandleSetContactNotesOpcode (WorldPackets::Social::SetContactNotes &packet)
 
void HandleAreaTriggerOpcode (WorldPackets::Misc::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 HandleMeetingStoneInfo (WorldPacket &recPacket)
 
void HandleGameobjectReportUse (WorldPackets::GameObject::GameObjReportUse &packet)
 
void HandleNameQueryOpcode (WorldPackets::Query::QueryPlayerName &packet)
 
void HandleQueryTimeOpcode (WorldPackets::Query::QueryTime &queryTime)
 
void HandleCreatureQuery (WorldPackets::Query::QueryCreature &packet)
 Only static data is sent in this packet !!! More...
 
void HandleDBQueryBulk (WorldPackets::Query::DBQueryBulk &packet)
 
void HandleGameObjectQueryOpcode (WorldPackets::Query::QueryGameObject &packet)
 Only static data is sent in this packet !!! More...
 
void HandleMoveWorldportAckOpcode (WorldPackets::Movement::WorldPortResponse &packet)
 
void HandleMoveWorldportAckOpcode ()
 
void HandleMovementOpcodes (WorldPackets::Movement::ClientPlayerMovement &packet)
 
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 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 HandleDeclinePetition (WorldPackets::Petition::DeclinePetition &packet)
 
void HandleOfferPetition (WorldPackets::Petition::OfferPetition &packet)
 
void HandlePetitionBuy (WorldPackets::Petition::PetitionBuy &packet)
 
void HandlePetitionShowSignatures (WorldPackets::Petition::PetitionShowSignatures &packet)
 
void HandleQueryPetition (WorldPackets::Petition::QueryPetition &packet)
 
void HandlePetitionRenameGuild (WorldPackets::Petition::PetitionRenameGuild &packet)
 
void HandleSignPetition (WorldPackets::Petition::SignPetition &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 HandleGuildSetAchievementTracking (WorldPackets::Guild::GuildSetAchievementTracking &packet)
 
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 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 HandleGuildFinderAddRecruit (WorldPackets::GuildFinder::LFGuildAddRecruit &lfGuildAddRecruit)
 
void HandleGuildFinderBrowse (WorldPackets::GuildFinder::LFGuildBrowse &lfGuildBrowse)
 
void HandleGuildFinderDeclineRecruit (WorldPackets::GuildFinder::LFGuildDeclineRecruit &lfGuildDeclineRecruit)
 
void HandleGuildFinderGetApplications (WorldPackets::GuildFinder::LFGuildGetApplications &lfGuildGetApplications)
 
void HandleGuildFinderGetGuildPost (WorldPackets::GuildFinder::LFGuildGetGuildPost &lfGuildGetGuildPost)
 
void HandleGuildFinderGetRecruits (WorldPackets::GuildFinder::LFGuildGetRecruits &lfGuildGetRecruits)
 
void HandleGuildFinderRemoveRecruit (WorldPackets::GuildFinder::LFGuildRemoveRecruit &lfGuildRemoveRecruit)
 
void HandleGuildFinderSetGuildPost (WorldPackets::GuildFinder::LFGuildSetGuildPost &lfGuildSetGuildPost)
 
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 HandleStablePet (WorldPacket &recvPacket)
 
void HandleStablePetCallback (PreparedQueryResult result)
 
void HandleUnstablePet (WorldPacket &recvPacket)
 
void HandleUnstablePetCallback (PreparedQueryResult result, uint32 petId)
 
void HandleBuyStableSlot (WorldPacket &recvPacket)
 
void HandleStableRevivePet (WorldPacket &recvPacket)
 
void HandleStableSwapPet (WorldPacket &recvPacket)
 
void HandleStableSwapPetCallback (PreparedQueryResult result, uint32 petId)
 
void SendTrainerBuyFailed (ObjectGuid trainerGUID, uint32 spellID, int32 trainerFailedReason)
 
void HandleCanDuel (WorldPackets::Duel::CanDuel &packet)
 
void HandleDuelResponseOpcode (WorldPackets::Duel::DuelResponse &duelResponse)
 
void HandleDuelAccepted ()
 
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 HandleAuctionHelloOpcode (WorldPackets::AuctionHouse::AuctionHelloRequest &packet)
 
void HandleAuctionListItems (WorldPackets::AuctionHouse::AuctionListItems &packet)
 
void HandleAuctionListBidderItems (WorldPackets::AuctionHouse::AuctionListBidderItems &packet)
 
void HandleAuctionSellItem (WorldPackets::AuctionHouse::AuctionSellItem &packet)
 
void HandleAuctionRemoveItem (WorldPackets::AuctionHouse::AuctionRemoveItem &packet)
 
void HandleAuctionListOwnerItems (WorldPackets::AuctionHouse::AuctionListOwnerItems &packet)
 
void HandleAuctionPlaceBid (WorldPackets::AuctionHouse::AuctionPlaceBid &packet)
 
void HandleAuctionListPendingSales (WorldPackets::AuctionHouse::AuctionListPendingSales &packet)
 
void HandleReplicateItems (WorldPackets::AuctionHouse::AuctionReplicateItems &packet)
 
void HandleAutoBankItemOpcode (WorldPackets::Bank::AutoBankItem &packet)
 
void HandleAutoStoreBankItemOpcode (WorldPackets::Bank::AutoStoreBankItem &packet)
 
void HandleBuyBankSlotOpcode (WorldPackets::Bank::BuyBankSlot &packet)
 
void HandleBlackMarketOpen (WorldPackets::BlackMarket::BlackMarketOpen &packet)
 
void HandleGetMailList (WorldPackets::Mail::MailGetList &packet)
 
void HandleSendMail (WorldPackets::Mail::SendMail &packet)
 
void HandleMailTakeMoney (WorldPackets::Mail::MailTakeMoney &packet)
 
void HandleMailTakeItem (WorldPackets::Mail::MailTakeItem &packet)
 
void HandleMailMarkAsRead (WorldPackets::Mail::MailMarkAsRead &packet)
 
void HandleMailReturnToSender (WorldPackets::Mail::MailReturnToSender &packet)
 
void HandleMailDelete (WorldPackets::Mail::MailDelete &packet)
 
void HandleItemTextQuery (WorldPackets::Query::ItemTextQuery &itemTextQuery)
 
void HandleMailCreateTextItem (WorldPackets::Mail::MailCreateTextItem &packet)
 
void HandleQueryNextMailTime (WorldPackets::Mail::MailQueryNextMailTime &packet)
 
void HandleCancelChanneling (WorldPackets::Spells::CancelChannelling &cancelChanneling)
 
void SendItemPageInfo (ItemTemplate *itemProto)
 
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 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 HandleCancelAutoRepeatSpellOpcode (WorldPackets::Spells::CancelAutoRepeatSpell &cancelAutoRepeatSpell)
 
void HandleMissileTrajectoryCollision (WorldPackets::Spells::MissileTrajectoryCollision &packet)
 
void HandleUpdateMissileTrajectory (WorldPackets::Spells::UpdateMissileTrajectory &packet)
 
void HandleLearnTalentsOpcode (WorldPackets::Talent::LearnTalents &packet)
 
void HandleConfirmRespecWipeOpcode (WorldPackets::Talent::ConfirmRespecWipe &confirmRespecWipe)
 
void HandleUnlearnSkillOpcode (WorldPackets::Spells::UnlearnSkill &packet)
 
void HandleSetSpecializationOpcode (WorldPackets::Talent::SetSpecialization &packet)
 
void HandleQuestgiverStatusQueryOpcode (WorldPackets::Quest::QuestGiverStatusQuery &packet)
 
void HandleQuestgiverStatusMultipleQuery (WorldPackets::Quest::QuestGiverStatusMultipleQuery &packet)
 
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 HandleQuestgiverCancel (WorldPacket &recvData)
 
void HandleQuestLogRemoveQuest (WorldPackets::Quest::QuestLogRemoveQuest &packet)
 
void HandleQuestConfirmAccept (WorldPackets::Quest::QuestConfirmAccept &packet)
 
void HandleQuestgiverCompleteQuest (WorldPackets::Quest::QuestGiverCompleteQuest &packet)
 
void HandleQuestgiverQuestAutoLaunch (WorldPacket &recvPacket)
 
void HandlePushQuestToParty (WorldPackets::Quest::PushQuestToParty &packet)
 
void HandleQuestPushResult (WorldPackets::Quest::QuestPushResult &packet)
 
void HandleChatMessageOpcode (WorldPackets::Chat::ChatMessage &chatMessage)
 
void HandleChatMessageWhisperOpcode (WorldPackets::Chat::ChatMessageWhisper &chatMessageWhisper)
 
void HandleChatMessageChannelOpcode (WorldPackets::Chat::ChatMessageChannel &chatMessageChannel)
 
void HandleChatMessage (ChatMsg type, uint32 lang, std::string msg, std::string target="")
 
void HandleChatAddonMessageOpcode (WorldPackets::Chat::ChatAddonMessage &chatAddonMessage)
 
void HandleChatAddonMessageWhisperOpcode (WorldPackets::Chat::ChatAddonMessageWhisper &chatAddonMessageWhisper)
 
void HandleChatAddonMessageChannelOpcode (WorldPackets::Chat::ChatAddonMessageChannel &chatAddonMessageChannel)
 
void HandleChatAddonMessage (ChatMsg type, std::string prefix, std::string text, std::string target="")
 
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)
 
template<void(Channel::*)(Player const *) CommandFunction>
void HandleChannelCommand (WorldPackets::Channel::ChannelPlayerCommand &packet)
 
template<void(Channel::*)(Player const *, std::string const &) CommandFunction>
void HandleChannelPlayerCommand (WorldPackets::Channel::ChannelPlayerCommand &packet)
 
void HandleVoiceSessionEnable (WorldPackets::Voice::VoiceSessionEnable &packet)
 
void HandleSetActiveVoiceChannel (WorldPackets::Voice::SetActiveVoiceChannel &packet)
 
void HandleCompleteCinematic (WorldPackets::Misc::CompleteCinematic &packet)
 
void HandleNextCinematicCamera (WorldPackets::Misc::NextCinematicCamera &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, float x, float y, float z)
 
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 HandleRequestRatedBattlefieldInfo (WorldPackets::Battleground::RequestRatedBattlefieldInfo &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 SendBfInvitePlayerToWar (uint64 queueId, uint32 zoneId, uint32 acceptTime)
 This send to player windows for invite player to join the war. More...
 
void SendBfInvitePlayerToQueue (uint64 queueId, int8 battleState)
 This send invitation to player to join the queue. More...
 
void SendBfQueueInviteResponse (uint64 queueId, uint32 zoneId, int8 battleStatus, bool canQueue=true, bool loggingIn=false)
 This send packet for inform player that he join queue. More...
 
void SendBfEntered (uint64 queueId, bool relocated, bool onOffense)
 This is call when player accept to join war. More...
 
void SendBfLeaveMessage (uint64 queueId, int8 battleState, bool relocated, BFLeaveReason reason=BF_LEAVE_REASON_EXITED)
 This is call when player leave battlefield zone. More...
 
void HandleBfEntryInviteResponse (WorldPackets::Battlefield::BFMgrEntryInviteResponse &bfMgrEntryInviteResponse)
 Send by client on clicking in accept or refuse of invitation windows for join game. More...
 
void HandleBfQueueInviteResponse (WorldPackets::Battlefield::BFMgrQueueInviteResponse &bfMgrQueueInviteResponse)
 Send by client when he click on accept for queue. More...
 
void HandleBfQueueExitRequest (WorldPackets::Battlefield::BFMgrQueueExitRequest &bfMgrQueueExitRequest)
 
void HandleWorldTeleportOpcode (WorldPackets::Misc::WorldTeleport &worldTeleport)
 
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 &packet)
 
void HandleWhoIsOpcode (WorldPackets::Who::WhoIsRequest &packet)
 
void HandleResetInstancesOpcode (WorldPackets::Instance::ResetInstances &packet)
 
void HandleInstanceLockResponse (WorldPackets::Instance::InstanceLockResponse &packet)
 
void HandleLfgSetCommentOpcode (WorldPacket &recvData)
 
void HandleDFGetSystemInfo (WorldPacket &recvData)
 
void SendLfgPlayerLockInfo ()
 
void SendLfgPartyLockInfo ()
 
void HandleLfgJoinOpcode (WorldPacket &recvData)
 
void HandleLfgLeaveOpcode (WorldPacket &recvData)
 
void HandleLfgSetRolesOpcode (WorldPacket &recvData)
 
void HandleLfgProposalResultOpcode (WorldPacket &recvData)
 
void HandleLfgSetBootVoteOpcode (WorldPacket &recvData)
 
void HandleLfgTeleportOpcode (WorldPacket &recvData)
 
void HandleLfrJoinOpcode (WorldPacket &recvData)
 
void HandleLfrLeaveOpcode (WorldPacket &recvData)
 
void HandleDFGetJoinStatus (WorldPacket &recvData)
 
void SendLfgUpdateStatus (lfg::LfgUpdateData const &updateData, bool party)
 
void SendLfgRoleChosen (ObjectGuid guid, uint8 roles)
 
void SendLfgRoleCheckUpdate (lfg::LfgRoleCheck const &pRoleCheck)
 
void SendLfgLfrList (bool update)
 
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 (uint8 err)
 
void HandleSelfResOpcode (WorldPackets::Spells::SelfRes &packet)
 
void HandleRequestPetInfo (WorldPackets::Pet::RequestPetInfo &packet)
 
void HandleSocketGems (WorldPackets::Item::SocketGems &socketGems)
 
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 HandleGuildBankSwapItems (WorldPackets::Guild::GuildBankSwapItems &packet)
 
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 HandleGrantLevel (WorldPackets::RaF::GrantLevel &grantLevel)
 
void HandleAcceptGrantLevel (WorldPackets::RaF::AcceptLevelGrant &acceptLevelGrant)
 
void HandleCalendarGetCalendar (WorldPackets::Calendar::CalendarGetCalendar &calendarGetCalendar)
 
void HandleCalendarGetEvent (WorldPackets::Calendar::CalendarGetEvent &calendarGetEvent)
 
void HandleCalendarGuildFilter (WorldPackets::Calendar::CalendarGuildFilter &calendarGuildFilter)
 
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 HandleCalendarEventInvite (WorldPackets::Calendar::CalendarEventInvite &calendarEventInvite)
 
void HandleCalendarEventRsvp (WorldPackets::Calendar::CalendarEventRSVP &calendarEventRSVP)
 
void HandleCalendarEventRemoveInvite (WorldPackets::Calendar::CalendarRemoveInvite &calendarRemoveInvite)
 
void HandleCalendarEventStatus (WorldPackets::Calendar::CalendarEventStatus &calendarEventStatus)
 
void HandleCalendarEventModeratorStatus (WorldPackets::Calendar::CalendarEventModeratorStatus &calendarEventModeratorStatus)
 
void HandleCalendarComplain (WorldPackets::Calendar::CalendarComplain &calendarComplain)
 
void HandleCalendarGetNumPending (WorldPackets::Calendar::CalendarGetNumPending &calendarGetNumPending)
 
void HandleCalendarEventSignup (WorldPackets::Calendar::CalendarEventSignUp &calendarEventSignUp)
 
void SendCalendarRaidLockout (InstanceSave const *save, bool add)
 
void SendCalendarRaidLockoutUpdated (InstanceSave const *save)
 
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 HandleTransmogrifyItems (WorldPackets::Item::TransmogrifyItems &transmogrifyItems)
 
void HandleSpellClick (WorldPackets::Spells::SpellClick &spellClick)
 
void HandleMirrorImageDataRequest (WorldPackets::Spells::GetMirrorImageData &getMirrorImageData)
 
void HandleRemoveGlyph (WorldPacket &recvData)
 
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 HandleUITimeRequest (WorldPackets::Misc::UITimeRequest &)
 
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 HandleAddToy (WorldPackets::Toy::AddToy &packet)
 
void HandleToySetFavorite (WorldPackets::Toy::ToySetFavorite &packet)
 
void HandleUseToy (WorldPackets::Toy::UseToy &packet)
 
void HandleSceneTriggerEvent (WorldPackets::Scenes::SceneTriggerEvent &sceneTriggerEvent)
 
void HandleScenePlaybackComplete (WorldPackets::Scenes::ScenePlaybackComplete &scenePlaybackComplete)
 
void HandleScenePlaybackCanceled (WorldPackets::Scenes::ScenePlaybackCanceled &scenePlaybackCanceled)
 
void HandleUpdateListedAuctionableTokens (WorldPackets::Token::UpdateListedAuctionableTokens &updateListedAuctionableTokens)
 
void HandleRequestWowTokenMarketPrice (WorldPackets::Token::RequestWowTokenMarketPrice &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 HandleGarrisonGetBuildingLandmarks (WorldPackets::Garrison::GarrisonGetBuildingLandmarks &garrisonGetBuildingLandmarks)
 
void HandleBattlePetRequestJournal (WorldPackets::BattlePet::BattlePetRequestJournal &battlePetRequestJournal)
 
void HandleBattlePetSetBattleSlot (WorldPackets::BattlePet::BattlePetSetBattleSlot &battlePetSetBattleSlot)
 
void HandleBattlePetModifyName (WorldPackets::BattlePet::BattlePetModifyName &battlePetModifyName)
 
void HandleBattlePetDeletePet (WorldPackets::BattlePet::BattlePetDeletePet &battlePetDeletePet)
 
void HandleBattlePetSetFlags (WorldPackets::BattlePet::BattlePetSetFlags &battlePetSetFlags)
 
void HandleBattlePetSummon (WorldPackets::BattlePet::BattlePetSummon &battlePetSummon)
 
void HandleCageBattlePet (WorldPackets::BattlePet::CageBattlePet &cageBattlePet)
 
void HandleWardenData (WorldPackets::Warden::WardenData &packet)
 
void HandleBattlenetRequest (WorldPackets::Battlenet::Request &request)
 
void HandleBattlenetRequestRealmListTicket (WorldPackets::Battlenet::RequestRealmListTicket &requestRealmListTicket)
 
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 > constGetRealmListSecret () const
 
void SetRealmListSecret (std::array< uint8, 32 > const &secret)
 
std::unordered_map< uint32,
uint8 > const
GetRealmCharacterCounts () const
 
uint64 GetConnectToInstanceKey () const
 

Public Attributes

time_t m_muteTime
 
std::atomic< int32m_timeOutTime
 

Protected Attributes

class WorldSession::DosProtection AntiDOS
 

Private Types

typedef std::list< AddonInfoAddonsList
 

Private Member Functions

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

Private Attributes

QueryResultHolderFuture _realmAccountLoginCallback
 
QueryResultHolderFuture _accountLoginCallback
 
PreparedQueryResultFuture _addIgnoreCallback
 
PreparedQueryResultFuture _stablePetCallback
 
QueryCallback
< PreparedQueryResult, bool
_charEnumCallback
 
QueryCallback
< PreparedQueryResult,
std::string > 
_addFriendCallback
 
QueryCallback
< PreparedQueryResult, uint32
_unstablePetCallback
 
QueryCallback
< PreparedQueryResult, uint32
_stableSwapCallback
 
QueryCallback
< PreparedQueryResult,
ObjectGuid
_sendStabledPetCallback
 
QueryCallback
< PreparedQueryResult,
std::shared_ptr
< WorldPackets::Character::CharacterCreateInfo >
, true
_charCreateCallback
 
QueryCallback
< PreparedQueryResult,
std::shared_ptr
< WorldPackets::Character::CharacterRenameInfo > > 
_charRenameCallback
 
QueryCallback
< PreparedQueryResult,
std::shared_ptr
< WorldPackets::Character::CharCustomizeInfo > > 
_charCustomizeCallback
 
QueryCallback
< PreparedQueryResult,
std::shared_ptr
< WorldPackets::Character::CharRaceOrFactionChangeInfo > > 
_charFactionChangeCallback
 
QueryCallback
< PreparedQueryResult, bool,
true
_undeleteCooldownStatusCallback
 
QueryCallback
< PreparedQueryResult,
std::shared_ptr
< WorldPackets::Character::CharacterUndeleteInfo >
, true
_charUndeleteCallback
 
QueryResultHolderFuture _charLoginCallback
 
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_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
 
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
 
std::atomic< uint32m_clientTimeDelay
 
AccountData _accountData [NUM_ACCOUNT_DATA_TYPES]
 
uint32 _tutorials [MAX_ACCOUNT_TUTORIAL_VALUES]
 
bool _tutorialsChanged
 
AddonsList m_addonsList
 
std::vector< std::string > _registeredAddonPrefixes
 
bool _filterAddonMessages
 
uint32 recruiterId
 
bool isRecruiter
 
LockedQueue< WorldPacket * > _recvQueue
 
rbac::RBACData_RBACData
 
uint32 expireTime
 
bool forceExit
 
ObjectGuid m_currentBankerGUID
 
std::unique_ptr< BattlePetMgr_battlePetMgr
 
std::unique_ptr< CollectionMgr_collectionMgr
 
ConnectToKey _instanceConnectKey
 

Friends

class World
 

Detailed Description

Player session in the World.

Member Typedef Documentation

typedef std::list<AddonInfo> WorldSession::AddonsList
private

Constructor & Destructor Documentation

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.

108  :
109  m_muteTime(mute_time),
110  m_timeOutTime(0),
111  AntiDOS(this),
112  m_GUIDLow(UI64LIT(0)),
113  _player(NULL),
114  _security(sec),
115  _accountId(id),
116  _accountName(std::move(name)),
117  _battlenetAccountId(battlenetAccountId),
118  m_expansion(expansion),
119  _os(os),
120  _warden(NULL),
121  _logoutTime(0),
122  m_inQueue(false),
123  m_playerLogout(false),
124  m_playerRecentlyLogout(false),
125  m_playerSave(false),
126  m_sessionDbcLocale(sWorld->GetAvailableDbcLocale(locale)),
127  m_sessionDbLocaleIndex(locale),
128  m_latency(0),
130  _tutorialsChanged(false),
131  _filterAddonMessages(false),
132  recruiterId(recruiter),
133  isRecruiter(isARecruiter),
134  _RBACData(NULL),
135  expireTime(60000), // 1 min after socket loss, session is deleted
136  forceExit(false),
138  _battlePetMgr(Trinity::make_unique<BattlePetMgr>(this)),
139  _collectionMgr(Trinity::make_unique<CollectionMgr>(this))
140 {
141  memset(_tutorials, 0, sizeof(_tutorials));
142 
143  if (sock)
144  {
145  m_Address = sock->GetRemoteIpAddress().to_string();
147  LoginDatabase.PExecute("UPDATE account SET online = 1 WHERE id = %u;", GetAccountId()); // One-time query
148  }
149 
152 
154 }
std::atomic< uint32 > m_latency
Definition: WorldSession.h:1827
Warden * _warden
Definition: WorldSession.h:1817
LocaleConstant m_sessionDbcLocale
Definition: WorldSession.h:1825
bool isRecruiter
Definition: WorldSession.h:1836
time_t _logoutTime
Definition: WorldSession.h:1819
bool _filterAddonMessages
Definition: WorldSession.h:1834
bool m_playerLogout
Definition: WorldSession.h:1822
LocaleConstant m_sessionDbLocaleIndex
Definition: WorldSession.h:1826
#define UI64LIT(N)
Definition: Define.h:138
arena_t NULL
Definition: jemalloc_internal.h:624
void ResetTimeOutTime()
Definition: WorldSession.h:1074
uint32 GetAccountId() const
Definition: WorldSession.h:922
uint8 m_expansion
Definition: WorldSession.h:1806
#define sWorld
Definition: World.h:887
std::shared_ptr< WorldSocket > m_Socket[MAX_CONNECTION_TYPES]
Definition: WorldSession.h:1798
uint32 expireTime
Definition: WorldSession.h:1839
LoginDatabaseWorkerPool LoginDatabase
Accessor to the realm/login database.
Definition: DatabaseEnv.cpp:22
void PExecute(Format &&sql, Args &&...args)
Definition: DatabaseWorkerPool.h:99
uint32 recruiterId
Definition: WorldSession.h:1835
ObjectGuid::LowType m_GUIDLow
Definition: WorldSession.h:1796
time_t m_muteTime
Definition: WorldSession.h:1056
std::string _os
Definition: WorldSession.h:1807
ObjectGuid m_currentBankerGUID
Definition: WorldSession.h:1841
uint64 Raw
Definition: WorldSession.h:1721
std::atomic< int32 > m_timeOutTime
Definition: WorldSession.h:1067
AccountTypes _security
Definition: WorldSession.h:1802
bool m_playerRecentlyLogout
Definition: WorldSession.h:1823
std::unique_ptr< CollectionMgr > _collectionMgr
Definition: WorldSession.h:1845
std::unique_ptr< BattlePetMgr > _battlePetMgr
Definition: WorldSession.h:1843
uint32 _accountId
Definition: WorldSession.h:1803
class WorldSession::DosProtection AntiDOS
std::string m_Address
Definition: WorldSession.h:1799
void InitializeQueryCallbackParameters()
Definition: WorldSession.cpp:944
uint32 _battlenetAccountId
Definition: WorldSession.h:1805
ConnectToKey _instanceConnectKey
Definition: WorldSession.h:1847
Player * _player
Definition: WorldSession.h:1797
uint32 _tutorials[MAX_ACCOUNT_TUTORIAL_VALUES]
Definition: WorldSession.h:1830
bool m_inQueue
Definition: WorldSession.h:1820
bool forceExit
Definition: WorldSession.h:1840
std::atomic< uint32 > m_clientTimeDelay
Definition: WorldSession.h:1828
rbac::RBACData * _RBACData
Definition: WorldSession.h:1838
Definition: Opcodes.h:31
bool _tutorialsChanged
Definition: WorldSession.h:1831
std::string _accountName
Definition: WorldSession.h:1804
bool m_playerSave
Definition: WorldSession.h:1824

+ Here is the call graph for this function:

WorldSession::~WorldSession ( )

WorldSession destructor.

  • unload player if not unloaded
  • If have unclosed socket, close it
  • empty incoming packet queue
158 {
160  if (_player)
161  LogoutPlayer (true);
162 
164  for (uint8 i = 0; i < 2; ++i)
165  {
166  if (m_Socket[i])
167  {
168  m_Socket[i]->CloseSocket();
169  m_Socket[i].reset();
170  }
171  }
172 
173  delete _warden;
174  delete _RBACData;
175 
177  WorldPacket* packet = NULL;
178  while (_recvQueue.next(packet))
179  delete packet;
180 
181  LoginDatabase.PExecute("UPDATE account SET online = 0 WHERE id = %u;", GetAccountId()); // One-time query
182 }
Warden * _warden
Definition: WorldSession.h:1817
arena_t NULL
Definition: jemalloc_internal.h:624
uint32 GetAccountId() const
Definition: WorldSession.h:922
std::shared_ptr< WorldSocket > m_Socket[MAX_CONNECTION_TYPES]
Definition: WorldSession.h:1798
LoginDatabaseWorkerPool LoginDatabase
Accessor to the realm/login database.
Definition: DatabaseEnv.cpp:22
void PExecute(Format &&sql, Args &&...args)
Definition: DatabaseWorkerPool.h:99
void LogoutPlayer(bool save)
Log the player out
Definition: WorldSession.cpp:498
bool next(T &result)
Gets the next result in the queue, if any.
Definition: LockedQueue.h:69
Player * _player
Definition: WorldSession.h:1797
LockedQueue< WorldPacket * > _recvQueue
Definition: WorldSession.h:1837
uint8_t uint8
Definition: Define.h:152
rbac::RBACData * _RBACData
Definition: WorldSession.h:1838
Definition: WorldPacket.h:26

+ Here is the call graph for this function:

WorldSession::WorldSession ( WorldSession const right)
privatedelete

Member Function Documentation

void WorldSession::AbortLogin ( WorldPackets::Character::LoginFailureReason  reason)
877 {
878  if (!PlayerLoading() || GetPlayer())
879  {
880  KickPlayer();
881  return;
882  }
883 
886 }
Player * GetPlayer() const
Definition: WorldSession.h:927
void KickPlayer()
Kick a player out of the World.
Definition: WorldSession.cpp:646
ObjectGuid m_playerLoading
Definition: WorldSession.h:1821
Definition: CharacterPackets.h:451
void SendPacket(WorldPacket const *packet, bool forced=false)
Send a packet to the client.
Definition: WorldSession.cpp:211
void Clear()
Definition: ObjectGuid.h:215
bool PlayerLoading() const
Definition: WorldSession.h:889

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void WorldSession::AddInstanceConnection ( std::shared_ptr< WorldSocket sock)
inline
std::shared_ptr< WorldSocket > m_Socket[MAX_CONNECTION_TYPES]
Definition: WorldSession.h:1798
Definition: Opcodes.h:32

+ Here is the caller graph for this function:

bool WorldSession::CanOpenMailBox ( ObjectGuid  guid)
36 {
37  if (guid == _player->GetGUID())
38  {
40  {
41  TC_LOG_WARN("cheat", "%s attempt open mailbox in cheating way.", _player->GetName().c_str());
42  return false;
43  }
44  }
45  else if (guid.IsGameObject())
46  {
47  if (!_player->GetGameObjectIfCanInteractWith(guid, GAMEOBJECT_TYPE_MAILBOX))
48  return false;
49  }
50  else if (guid.IsAnyTypeCreature())
51  {
52  if (!_player->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_MAILBOX))
53  return false;
54  }
55  else
56  return false;
57 
58  return true;
59 }
bool IsGameObject() const
Definition: ObjectGuid.h:252
Definition: SharedDefines.h:2084
Definition: Unit.h:761
Player * _player
Definition: WorldSession.h:1797
bool IsAnyTypeCreature() const
Definition: ObjectGuid.h:248
#define TC_LOG_WARN(filterType__,...)
Definition: Log.h:204
Definition: RBAC.h:671
bool HasPermission(uint32 permissionId)
Definition: WorldSession.cpp:1259

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool WorldSession::CanUseBank ( ObjectGuid  bankerGUID = ObjectGuid::Empty) const
private
1257 {
1258  // bankerGUID parameter is optional, set to 0 by default.
1259  if (!bankerGUID)
1260  bankerGUID = m_currentBankerGUID;
1261 
1262  bool isUsingBankCommand = (bankerGUID == GetPlayer()->GetGUID() && bankerGUID == m_currentBankerGUID);
1263 
1264  if (!isUsingBankCommand)
1265  {
1266  Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(bankerGUID, UNIT_NPC_FLAG_BANKER);
1267  if (!creature)
1268  return false;
1269  }
1270 
1271  return true;
1272 }
Definition: Creature.h:467
Player * GetPlayer() const
Definition: WorldSession.h:927
ObjectGuid m_currentBankerGUID
Definition: WorldSession.h:1841
Definition: Unit.h:752

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool WorldSession::CheckStableMaster ( ObjectGuid  guid)
435 {
436  // spell case or GM
437  if (guid == GetPlayer()->GetGUID())
438  {
439  if (!GetPlayer()->IsGameMaster() && !GetPlayer()->HasAuraType(SPELL_AURA_OPEN_STABLE))
440  {
441  TC_LOG_DEBUG("network", "%s attempt open stable in cheating way.", guid.ToString().c_str());
442  return false;
443  }
444  }
445  // stable master case
446  else
447  {
448  if (!GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_STABLEMASTER))
449  {
450  TC_LOG_DEBUG("network", "Stablemaster %s not found or you can't interact with him.", guid.ToString().c_str());
451  return false;
452  }
453  }
454  return true;
455 }
Definition: Unit.h:757
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
Player * GetPlayer() const
Definition: WorldSession.h:927
Definition: SpellAuraDefines.h:352
std::string ToString() const
Definition: ObjectGuid.cpp:99

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void WorldSession::DoLootRelease ( ObjectGuid  lguid)
251 {
252  Player *player = GetPlayer();
253  Loot *loot;
254 
255  player->SetLootGUID(ObjectGuid::Empty);
256  player->SendLootRelease(lguid);
257 
258  player->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_LOOTING);
259 
260  if (!player->IsInWorld())
261  return;
262 
263  if (lguid.IsGameObject())
264  {
265  GameObject* go = GetPlayer()->GetMap()->GetGameObject(lguid);
266 
267  // not check distance for GO in case owned GO (fishing bobber case, for example) or Fishing hole GO
268  if (!go || ((go->GetOwnerGUID() != _player->GetGUID() && go->GetGoType() != GAMEOBJECT_TYPE_FISHINGHOLE) && !go->IsWithinDistInMap(_player, INTERACTION_DISTANCE)))
269  return;
270 
271  loot = &go->loot;
272 
273  if (go->GetGoType() == GAMEOBJECT_TYPE_DOOR)
274  {
275  // locked doors are opened with spelleffect openlock, prevent remove its as looted
276  go->UseDoorOrButton();
277  }
278  else if (loot->isLooted() || go->GetGoType() == GAMEOBJECT_TYPE_FISHINGNODE)
279  {
281  { // The fishing hole used once more
282  go->AddUse(); // if the max usage is reached, will be despawned in next tick
283  if (go->GetUseCount() >= go->GetGOValue()->FishingHole.MaxOpens)
285  else
286  go->SetLootState(GO_READY);
287  }
288  else
290 
291  loot->clear();
292  }
293  else
294  {
295  // not fully looted object
296  go->SetLootState(GO_ACTIVATED, player);
297 
298  // if the round robin player release, reset it.
299  if (player->GetGUID() == loot->roundRobinPlayer)
300  loot->roundRobinPlayer.Clear();
301  }
302  }
303  else if (lguid.IsCorpse()) // ONLY remove insignia at BG
304  {
305  Corpse* corpse = ObjectAccessor::GetCorpse(*player, lguid);
306  if (!corpse || !corpse->IsWithinDistInMap(_player, INTERACTION_DISTANCE))
307  return;
308 
309  loot = &corpse->loot;
310 
311  if (loot->isLooted())
312  {
313  loot->clear();
315  }
316  }
317  else if (lguid.IsItem())
318  {
319  Item* pItem = player->GetItemByGuid(lguid);
320  if (!pItem)
321  return;
322 
323  ItemTemplate const* proto = pItem->GetTemplate();
324 
325  // destroy only 5 items from stack in case prospecting and milling
327  {
328  pItem->m_lootGenerated = false;
329  pItem->loot.clear();
330 
331  uint32 count = pItem->GetCount();
332 
333  // >=5 checked in spell code, but will work for cheating cases also with removing from another stacks.
334  if (count > 5)
335  count = 5;
336 
337  player->DestroyItemCount(pItem, count, true);
338  }
339  else
340  {
341  // Only delete item if no loot or money (unlooted loot is saved to db) or if it isn't an openable item
342  if (pItem->loot.isLooted() || !(proto->GetFlags() & ITEM_FLAG_OPENABLE))
343  player->DestroyItem(pItem->GetBagSlot(), pItem->GetSlot(), true);
344  }
345  return; // item can be looted only single player
346  }
347  else
348  {
349  Creature* creature = GetPlayer()->GetMap()->GetCreature(lguid);
350 
351  bool lootAllowed = creature && creature->IsAlive() == (player->getClass() == CLASS_ROGUE && creature->loot.loot_type == LOOT_PICKPOCKETING);
352  if (!lootAllowed || !creature->IsWithinDistInMap(_player, INTERACTION_DISTANCE))
353  return;
354 
355  loot = &creature->loot;
356  if (loot->isLooted())
357  {
359 
360  // skip pickpocketing loot for speed, skinning timer reduction is no-op in fact
361  if (!creature->IsAlive())
362  creature->AllLootRemovedFromCorpse();
363 
364  loot->clear();
365  }
366  else
367  {
368  // if the round robin player release, reset it.
369  if (player->GetGUID() == loot->roundRobinPlayer)
370  {
371  loot->roundRobinPlayer.Clear();
372 
373  if (Group* group = player->GetGroup())
374  {
375  group->SendLooter(creature, NULL);
376 
377  // force update of dynamic flags, otherwise other group's players still not able to loot.
379  }
380  }
381  }
382  }
383 
384  //Player is not looking at loot list, he doesn't need to see updates on the loot list
385  loot->RemoveLooter(player->GetGUID());
386 }
#define INTERACTION_DISTANCE
Definition: Object.h:34
Definition: SharedDefines.h:170
uint32 GetCount() const
Definition: Item.h:322
bool IsGameObject() const
Definition: ObjectGuid.h:252
Definition: Corpse.h:49
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
Definition: GameObject.h:871
Definition: GameObject.h:870
Loot loot
Definition: Creature.h:578
bool m_lootGenerated
Definition: Item.h:368
Definition: SharedDefines.h:4213
arena_t NULL
Definition: jemalloc_internal.h:624
Definition: Creature.h:467
Definition: UpdateFields.h:362
Player * GetPlayer() const
Definition: WorldSession.h:927
Definition: SharedDefines.h:2082
void AllLootRemovedFromCorpse()
Definition: Creature.cpp:2382
void clear()
Definition: LootMgr.h:349
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true) const
Definition: Object.cpp:1663
void RemoveLooter(ObjectGuid GUID)
Definition: LootMgr.h:381
bool IsItem() const
Definition: ObjectGuid.h:251
void SetLootState(LootState s, Unit *unit=NULL)
Definition: GameObject.cpp:2112
Definition: ItemTemplate.h:202
uint32 MaxOpens
Definition: GameObject.h:788
Definition: LootMgr.h:314
bool IsAlive() const
Definition: Unit.h:1692
Definition: Item.h:259
Definition: Unit.h:683
uint32_t uint32
Definition: Define.h:150
TC_GAME_API Corpse * GetCorpse(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:138
Loot loot
Definition: GameObject.h:1007
struct GameObjectValue::@274 FishingHole
Definition: GameObject.h:880
ObjectGuid GetOwnerGUID() const
Definition: GameObject.h:925
ObjectGuid roundRobinPlayer
Definition: LootMgr.h:324
void UseDoorOrButton(uint32 time_to_restore=0, bool alternative=false, Unit *user=NULL)
Definition: GameObject.cpp:1182
uint8 GetSlot() const
Definition: Item.h:329
Definition: SharedDefines.h:2090
Definition: SharedDefines.h:4201
void Clear()
Definition: ObjectGuid.h:215
void ForceValuesUpdateAtIndex(uint32)
Definition: Object.cpp:2138
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
Definition: ItemTemplate.h:647
GameobjectTypes GetGoType() const
Definition: GameObject.h:964
bool isLooted() const
Definition: LootMgr.h:375
Player * _player
Definition: WorldSession.h:1797
Definition: UpdateFields.h:109
void AddUse()
Definition: GameObject.h:1000
LootType loot_type
Definition: LootMgr.h:325
Definition: LootMgr.h:91
Loot loot
Definition: Corpse.h:76
uint32 GetFlags() const
Definition: ItemTemplate.h:656
Definition: UpdateFields.h:30
GameObjectValue const * GetGOValue() const
Definition: GameObject.h:896
Definition: ItemTemplate.h:191
uint8 GetBagSlot() const
Definition: Item.cpp:759
Definition: GameObject.h:869
Loot loot
Definition: Item.h:367
Definition: Group.h:191
Definition: ItemTemplate.h:175
Definition: SharedDefines.h:2065
ItemTemplate const * GetTemplate() const
Definition: Item.cpp:547
bool IsCorpse() const
Definition: ObjectGuid.h:254
uint32 GetUseCount() const
Definition: GameObject.h:1002

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

AccountData const* WorldSession::GetAccountData ( AccountDataType  type) const
inline
998 { return &_accountData[type]; }
AccountData _accountData[NUM_ACCOUNT_DATA_TYPES]
Definition: WorldSession.h:1829

+ Here is the caller graph for this function:

ObjectGuid WorldSession::GetAccountGUID ( ) const
inline
923 { return ObjectGuid::Create<HighGuid::WowAccount>(GetAccountId()); }
uint32 GetAccountId() const
Definition: WorldSession.h:922

+ Here is the caller graph for this function:

uint32 WorldSession::GetAccountId ( ) const
inline
922 { return _accountId; }
uint32 _accountId
Definition: WorldSession.h:1803
std::string const& WorldSession::GetAccountName ( ) const
inline
924 { return _accountName; }
std::string _accountName
Definition: WorldSession.h:1804
ObjectGuid WorldSession::GetBattlenetAccountGUID ( ) const
inline
926 { return ObjectGuid::Create<HighGuid::BNetAccount>(GetBattlenetAccountId()); }
uint32 GetBattlenetAccountId() const
Definition: WorldSession.h:925
uint32 WorldSession::GetBattlenetAccountId ( ) const
inline
925 { return _battlenetAccountId; }
uint32 _battlenetAccountId
Definition: WorldSession.h:1805

+ Here is the caller graph for this function:

BattlePetMgr* WorldSession::GetBattlePetMgr ( ) const
inline
1089 { return _battlePetMgr.get(); }
std::unique_ptr< BattlePetMgr > _battlePetMgr
Definition: WorldSession.h:1843

+ Here is the caller graph for this function:

CollectionMgr* WorldSession::GetCollectionMgr ( ) const
inline
1091 { return _collectionMgr.get(); }
std::unique_ptr< CollectionMgr > _collectionMgr
Definition: WorldSession.h:1845
uint64 WorldSession::GetConnectToInstanceKey ( ) const
inline
1724 { return _instanceConnectKey.Raw; }
uint64 Raw
Definition: WorldSession.h:1721
ConnectToKey _instanceConnectKey
Definition: WorldSession.h:1847

+ Here is the caller graph for this function:

uint8 WorldSession::GetExpansion ( ) const
inline
934 { return m_expansion; }
uint8 m_expansion
Definition: WorldSession.h:1806

+ Here is the caller graph for this function:

uint32 WorldSession::GetLatency ( ) const
inline
1063 { return m_latency; }
std::atomic< uint32 > m_latency
Definition: WorldSession.h:1827

+ Here is the caller graph for this function:

std::string const& WorldSession::GetOS ( ) const
inline
935 { return _os; }
std::string _os
Definition: WorldSession.h:1807
Player* WorldSession::GetPlayer ( ) const
inline
927 { return _player; }
Player * _player
Definition: WorldSession.h:1797
std::string WorldSession::GetPlayerInfo ( ) const
196 {
197  std::ostringstream ss;
198 
199  ss << "[Player: ";
200  if (!m_playerLoading.IsEmpty())
201  ss << "Logging in: " << m_playerLoading.ToString() << ", ";
202  else if (_player)
203  ss << _player->GetName() << ' ' << _player->GetGUID().ToString() << ", ";
204 
205  ss << "Account: " << GetAccountId() << "]";
206 
207  return ss.str();
208 }
uint32 GetAccountId() const
Definition: WorldSession.h:922
ObjectGuid m_playerLoading
Definition: WorldSession.h:1821
Player * _player
Definition: WorldSession.h:1797
std::string ToString() const
Definition: ObjectGuid.cpp:99
bool IsEmpty() const
Definition: ObjectGuid.h:242

+ Here is the call graph for this function:

std::string const & WorldSession::GetPlayerName ( ) const
191 {
192  return _player != NULL ? _player->GetName() : DefaultPlayerName;
193 }
arena_t NULL
Definition: jemalloc_internal.h:624
Player * _player
Definition: WorldSession.h:1797

+ Here is the caller graph for this function:

rbac::RBACData * WorldSession::GetRBACData ( )
1255 {
1256  return _RBACData;
1257 }
rbac::RBACData * _RBACData
Definition: WorldSession.h:1838

+ Here is the caller graph for this function:

std::unordered_map<uint32, uint8> const& WorldSession::GetRealmCharacterCounts ( ) const
inline
1710 { return _realmCharacterCounts; }
std::unordered_map< uint32, uint8 > _realmCharacterCounts
Definition: WorldSession.h:1810
std::array<uint8, 32> const& WorldSession::GetRealmListSecret ( ) const
inline
1707 { return _realmListSecret; }
std::array< uint8, 32 > _realmListSecret
Definition: WorldSession.h:1809
uint32 WorldSession::GetRecruiterId ( ) const
inline
1085 { return recruiterId; }
uint32 recruiterId
Definition: WorldSession.h:1835

+ Here is the caller graph for this function:

std::string const& WorldSession::GetRemoteAddress ( ) const
inline
932 { return m_Address; }
std::string m_Address
Definition: WorldSession.h:1799

+ Here is the caller graph for this function:

AccountTypes WorldSession::GetSecurity ( ) const
inline
921 { return _security; }
AccountTypes _security
Definition: WorldSession.h:1802

+ Here is the caller graph for this function:

LocaleConstant WorldSession::GetSessionDbcLocale ( ) const
inline
1059 { return m_sessionDbcLocale; }
LocaleConstant m_sessionDbcLocale
Definition: WorldSession.h:1825

+ Here is the caller graph for this function:

LocaleConstant WorldSession::GetSessionDbLocaleIndex ( ) const
inline
1060 { return m_sessionDbLocaleIndex; }
LocaleConstant m_sessionDbLocaleIndex
Definition: WorldSession.h:1826

+ Here is the caller graph for this function:

char const * WorldSession::GetTrinityString ( uint32  entry) const
690 {
691  return sObjectMgr->GetTrinityString(entry, GetSessionDbLocaleIndex());
692 }
LocaleConstant GetSessionDbLocaleIndex() const
Definition: WorldSession.h:1060
#define sObjectMgr
Definition: ObjectMgr.h:1567

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint32 WorldSession::GetTutorialInt ( uint8  index) const
inline
1005 { return _tutorials[index]; }
uint32 _tutorials[MAX_ACCOUNT_TUTORIAL_VALUES]
Definition: WorldSession.h:1830

+ Here is the caller graph for this function:

void WorldSession::Handle_EarlyProccess ( WorldPacket recvPacket)
700 {
701  TC_LOG_ERROR("network.opcode", "Received opcode %s that must be processed in WorldSocket::OnRead from %s"
702  , GetOpcodeNameForLogging(static_cast<OpcodeClient>(recvPacket.GetOpcode())).c_str(), GetPlayerInfo().c_str());
703 }
uint32 GetOpcode() const
Definition: WorldPacket.h:79
std::string GetOpcodeNameForLogging(T id)
Lookup opcode name for human understandable logging (T = OpcodeClient|OpcodeServer) ...
Definition: Opcodes.h:1777
std::string GetPlayerInfo() const
Definition: WorldSession.cpp:195
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void WorldSession::Handle_NULL ( WorldPackets::Null null)
695 {
696  TC_LOG_ERROR("network.opcode", "Received unhandled opcode %s from %s", GetOpcodeNameForLogging(null.GetOpcode()).c_str(), GetPlayerInfo().c_str());
697 }
std::string GetOpcodeNameForLogging(T id)
Lookup opcode name for human understandable logging (T = OpcodeClient|OpcodeServer) ...
Definition: Opcodes.h:1777
OpcodeClient GetOpcode() const
Definition: Packet.h:72
std::string GetPlayerInfo() const
Definition: WorldSession.cpp:195
#define TC_LOG_ERROR(filterType__,...)
Definition: Log.h:207

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void WorldSession::HandleAcceptGrantLevel ( WorldPackets::RaF::AcceptLevelGrant acceptLevelGrant)
65 {
66  Player* other = ObjectAccessor::GetPlayer(*_player, acceptLevelGrant.Granter);
67  if (!(other && other->GetSession()))
68  return;
69 
70  if (GetAccountId() != other->GetSession()->GetRecruiterId())
71  return;
72 
73  if (other->GetGrantableLevels())
74  other->SetGrantableLevels(other->GetGrantableLevels() - 1);
75  else
76  return;
77 
78  _player->GiveLevel(_player->getLevel() + 1);
79 }
ObjectGuid Granter
Definition: ReferAFriendPackets.h:35
uint32 GetAccountId() const
Definition: WorldSession.h:922
TC_GAME_API Player * GetPlayer(Map const *, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:184
Player * _player
Definition: WorldSession.h:1797

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void WorldSession::HandleAcceptTradeOpcode ( WorldPackets::Trade::AcceptTrade acceptTrade)
224 {
225  TradeData* my_trade = _player->m_trade;
226  if (!my_trade)
227  return;
228 
229  Player* trader = my_trade->GetTrader();
230 
231  TradeData* his_trade = trader->m_trade;
232  if (!his_trade)
233  return;
234 
235  Item* myItems[TRADE_SLOT_TRADED_COUNT] = { NULL, NULL, NULL, NULL, NULL, NULL };
236  Item* hisItems[TRADE_SLOT_TRADED_COUNT] = { NULL, NULL, NULL, NULL, NULL, NULL };
237 
238  // set before checks for propertly undo at problems (it already set in to client)
239  my_trade->SetAccepted(true);
240 
242  if (his_trade->GetServerStateIndex() != acceptTrade.StateIndex)
243  {
245  SendTradeStatus(info);
246  my_trade->SetAccepted(false);
247  return;
248  }
249 
250  if (!_player->IsWithinDistInMap(trader, TRADE_DISTANCE, false))
251  {
253  SendTradeStatus(info);
254  my_trade->SetAccepted(false);
255  return;
256  }
257 
258  // not accept case incorrect money amount
259  if (!_player->HasEnoughMoney(my_trade->GetMoney()))
260  {
263  SendTradeStatus(info);
264  my_trade->SetAccepted(false, true);
265  return;
266  }
267 
268  // not accept case incorrect money amount
269  if (!trader->HasEnoughMoney(his_trade->GetMoney()))
270  {
273  trader->GetSession()->SendTradeStatus(info);
274  his_trade->SetAccepted(false, true);
275  return;
276  }
277 
278  if (_player->GetMoney() >= uint64(MAX_MONEY_AMOUNT) - his_trade->GetMoney())
279  {
282  SendTradeStatus(info);
283  my_trade->SetAccepted(false, true);
284  return;
285  }
286 
287  if (trader->GetMoney() >= uint64(MAX_MONEY_AMOUNT) - my_trade->GetMoney())
288  {
291  trader->GetSession()->SendTradeStatus(info);
292  his_trade->SetAccepted(false, true);
293  return;
294  }
295 
296  // not accept if some items now can't be trade (cheating)
297  for (uint8 i = 0; i < TRADE_SLOT_TRADED_COUNT; ++i)
298  {
299  if (Item* item = my_trade->GetItem(TradeSlots(i)))
300  {
301  if (!item->CanBeTraded(false, true))
302  {
304  SendTradeStatus(info);
305  return;
306  }
307 
308  if (item->IsBindedNotWith(trader))
309  {
312  SendTradeStatus(info);
313  return;
314  }
315  }
316 
317  if (Item* item = his_trade->GetItem(TradeSlots(i)))
318  {
319  if (!item->CanBeTraded(false, true))
320  {
322  SendTradeStatus(info);
323  return;
324  }
325  //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)
326  //{
327  // SendTradeStatus(TRADE_STATUS_NOT_ELIGIBLE);
328  // his_trade->SetAccepted(false, true);
329  // return;
330  //}
331  }
332  }
333 
334  if (his_trade->IsAccepted())
335  {
336  setAcceptTradeMode(my_trade, his_trade, myItems, hisItems);
337 
338  Spell* my_spell = NULL;
339  SpellCastTargets my_targets;
340 
341  Spell* his_spell = NULL;
342  SpellCastTargets his_targets;
343 
344  // not accept if spell can't be cast now (cheating)
345  if (uint32 my_spell_id = my_trade->GetSpell())
346  {
347  SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(my_spell_id);
348  Item* castItem = my_trade->GetSpellCastItem();
349 
350  if (!spellEntry || !his_trade->GetItem(TRADE_SLOT_NONTRADED) ||
351  (my_trade->HasSpellCastItem() && !castItem))
352  {
353  clearAcceptTradeMode(my_trade, his_trade);
354  clearAcceptTradeMode(myItems, hisItems);
355 
356  my_trade->SetSpell(0);
357  return;
358  }
359 
360  my_spell = new Spell(_player, spellEntry, TRIGGERED_FULL_MASK);
361  my_spell->m_CastItem = castItem;
362  my_targets.SetTradeItemTarget(_player);
363  my_spell->m_targets = my_targets;
364 
365  SpellCastResult res = my_spell->CheckCast(true);
366  if (res != SPELL_CAST_OK)
367  {
368  my_spell->SendCastResult(res);
369 
370  clearAcceptTradeMode(my_trade, his_trade);
371  clearAcceptTradeMode(myItems, hisItems);
372 
373  delete my_spell;
374  my_trade->SetSpell(0);
375  return;
376  }
377  }
378 
379  // not accept if spell can't be cast now (cheating)
380  if (uint32 his_spell_id = his_trade->GetSpell())
381  {
382  SpellInfo const* spellEntry = sSpellMgr->GetSpellInfo(his_spell_id);
383  Item* castItem = his_trade->GetSpellCastItem();
384 
385  if (!spellEntry || !my_trade->GetItem(TRADE_SLOT_NONTRADED) || (his_trade->HasSpellCastItem() && !castItem))
386  {
387  delete my_spell;
388  his_trade->SetSpell(0);
389 
390  clearAcceptTradeMode(my_trade, his_trade);
391  clearAcceptTradeMode(myItems, hisItems);
392  return;
393  }
394 
395  his_spell = new Spell(trader, spellEntry, TRIGGERED_FULL_MASK);
396  his_spell->m_CastItem = castItem;
397  his_targets.SetTradeItemTarget(trader);
398  his_spell->m_targets = his_targets;
399 
400  SpellCastResult res = his_spell->CheckCast(true);
401  if (res != SPELL_CAST_OK)
402  {
403  his_spell->SendCastResult(res);
404 
405  clearAcceptTradeMode(my_trade, his_trade);
406  clearAcceptTradeMode(myItems, hisItems);
407 
408  delete my_spell;
409  delete his_spell;
410 
411  his_trade->SetSpell(0);
412  return;
413  }
414  }
415 
416  // inform partner client
418  trader->GetSession()->SendTradeStatus(info);
419 
420  // test if item will fit in each inventory
421  WorldPackets::Trade::TradeStatus myCanCompleteInfo, hisCanCompleteInfo;
422  hisCanCompleteInfo.BagResult = trader->CanStoreItems(myItems, TRADE_SLOT_TRADED_COUNT, &hisCanCompleteInfo.ItemID);
423  myCanCompleteInfo.BagResult = _player->CanStoreItems(hisItems, TRADE_SLOT_TRADED_COUNT, &myCanCompleteInfo.ItemID);
424 
425  clearAcceptTradeMode(myItems, hisItems);
426 
427  // in case of missing space report error
428  if (myCanCompleteInfo.BagResult != EQUIP_ERR_OK)
429  {
430  clearAcceptTradeMode(my_trade, his_trade);
431 
432  myCanCompleteInfo.Status = TRADE_STATUS_FAILED;
433  trader->GetSession()->SendTradeStatus(myCanCompleteInfo);
434  myCanCompleteInfo.FailureForYou = true;
435  SendTradeStatus(myCanCompleteInfo);
436  my_trade->SetAccepted(false);
437  his_trade->SetAccepted(false);
438  delete my_spell;
439  delete his_spell;
440  return;
441  }
442  else if (hisCanCompleteInfo.BagResult != EQUIP_ERR_OK)
443  {
444  clearAcceptTradeMode(my_trade, his_trade);
445 
446  hisCanCompleteInfo.Status = TRADE_STATUS_FAILED;
447  SendTradeStatus(hisCanCompleteInfo);
448  hisCanCompleteInfo.FailureForYou = true;
449  trader->GetSession()->SendTradeStatus(hisCanCompleteInfo);
450  my_trade->SetAccepted(false);
451  his_trade->SetAccepted(false);
452  delete my_spell;
453  delete his_spell;
454  return;
455  }
456 
457  // execute trade: 1. remove
458  for (uint8 i = 0; i < TRADE_SLOT_TRADED_COUNT; ++i)
459  {
460  if (myItems[i])
461  {
462  myItems[i]->SetGuidValue(ITEM_FIELD_GIFTCREATOR, _player->GetGUID());
463  _player->MoveItemFromInventory(myItems[i]->GetBagSlot(), myItems[i]->GetSlot(), true);
464  }
465  if (hisItems[i])
466  {
467  hisItems[i]->SetGuidValue(ITEM_FIELD_GIFTCREATOR, trader->GetGUID());
468  trader->MoveItemFromInventory(hisItems[i]->GetBagSlot(), hisItems[i]->GetSlot(), true);
469  }
470  }
471 
472  // execute trade: 2. store
473  moveItems(myItems, hisItems);
474 
475  // logging money
477  {
478  if (my_trade->GetMoney() > 0)
479  {
480  sLog->outCommand(_player->GetSession()->GetAccountId(), "GM %s (Account: %u) give money (Amount: " UI64FMTD ") to player: %s (Account: %u)",
481  _player->GetName().c_str(), _player->GetSession()->GetAccountId(),
482  my_trade->GetMoney(),
483  trader->GetName().c_str(), trader->GetSession()->GetAccountId());
484  }
485 
486  if (his_trade->GetMoney() > 0)
487  {
488  sLog->outCommand(trader->GetSession()->GetAccountId(), "GM %s (Account: %u) give money (Amount: " UI64FMTD ") to player: %s (Account: %u)",
489  trader->GetName().c_str(), trader->GetSession()->GetAccountId(),
490  his_trade->GetMoney(),
491  _player->GetName().c_str(), _player->GetSession()->GetAccountId());
492  }
493  }
494 
495  // update money
496  _player->ModifyMoney(-int64(my_trade->GetMoney()));
497  _player->ModifyMoney(his_trade->GetMoney());
498  trader->ModifyMoney(-int64(his_trade->GetMoney()));
499  trader->ModifyMoney(my_trade->GetMoney());
500 
501  if (my_spell)
502  my_spell->prepare(&my_targets);
503 
504  if (his_spell)
505  his_spell->prepare(&his_targets);
506 
507  // cleanup
508  clearAcceptTradeMode(my_trade, his_trade);
509  delete _player->m_trade;
510  _player->m_trade = NULL;
511  delete trader->m_trade;
512  trader->m_trade = NULL;
513 
514  // desynchronized with the other saves here (SaveInventoryAndGoldToDB() not have own transaction guards)
516  _player->SaveInventoryAndGoldToDB(trans);
517  trader->SaveInventoryAndGoldToDB(trans);
519 
521  trader->GetSession()->SendTradeStatus(info);
522  SendTradeStatus(info);
523  }
524  else
525  {
527  trader->GetSession()->SendTradeStatus(info);
528  }
529 }
uint64 const MAX_MONEY_AMOUNT
Definition: Player.cpp:130
Definition: SpellInfo.h:326
SpellCastTargets m_targets
Definition: Spell.h:584
static void SendCastResult(Player *caster, SpellInfo const *spellInfo, uint8 cast_count, SpellCastResult result, SpellCustomErrors customError=SPELL_CUSTOM_ERROR_NONE, OpcodeServer opcode=SMSG_CAST_FAILED, uint32 *misc=nullptr)
Definition: Spell.cpp:3732
Definition: SharedDefines.h:4652
SQLTransaction BeginTransaction()
Begins an automanaged transaction pointer that will automatically rollback if not commited...
Definition: DatabaseWorkerPool.h:221
void SendTradeStatus(WorldPackets::Trade::TradeStatus &status)
Definition: TradeHandler.cpp:34
arena_t NULL
Definition: jemalloc_internal.h:624
Will ignore most target checks (mostly DBC target checks)
Definition: Unit.h:479
#define sLog
Definition: Log.h:154
uint64_t uint64
Definition: g3dmath.h:170
void SetGuidValue(uint16 index, ObjectGuid const &value)
Definition: Object.cpp:1120
Item * m_CastItem
Definition: Spell.h:548
uint32 ItemID
Definition: TradePackets.h:145
Definition: SharedDefines.h:4660
Item * GetItem(TradeSlots slot) const
Definition: TradeData.cpp:27
void CommitTransaction(SQLTransaction transaction)
Definition: DatabaseWorkerPool.cpp:179
Definition: Item.h:127
void prepare(SpellCastTargets const *targets, AuraEffect const *triggeredByAura=NULL)
Definition: Spell.cpp:2860
Definition: SharedDefines.h:4657
Definition: Item.h:48
Definition: Item.h:77
Definition: Item.h:125
uint32 GetSpell() const
Definition: TradeData.h:49
Definition: TradeData.h:34
TradeSlots
Definition: TradeData.h:23
Definition: TradeData.h:27
Definition: Item.h:259
#define UI64FMTD
Definition: Define.h:137
#define sSpellMgr
Definition: SpellMgr.h:756
uint32_t uint32
Definition: Define.h:150
Player * GetTrader() const
Definition: TradeData.h:41
#define TRADE_DISTANCE
Definition: Object.h:37
Definition: SharedDefines.h:4651
Definition: Spell.h:170
static void setAcceptTradeMode(TradeData *myTrade, TradeData *hisTrade, Item **myItems, Item **hisItems)
Definition: TradeHandler.cpp:180
static void clearAcceptTradeMode(TradeData *myTrade, TradeData *hisTrade)
Definition: TradeHandler.cpp:205
void SetSpell(uint32 spell_id, Item *castItem=nullptr)
Definition: TradeData.cpp:81
int64_t int64
Definition: g3dmath.h:169
Definition: SharedDefines.h:4658
Definition: TradePackets.h:130
void moveItems(Item *myItems[], Item *hisItems[])
Definition: TradeHandler.cpp:97
SpellCastResult CheckCast(bool strict)
Definition: Spell.cpp:4739
Player * _player
Definition: WorldSession.h:1797
void SetTradeItemTarget(Player *caster)
Definition: Spell.cpp:310
uint32 GetServerStateIndex() const
Definition: TradeData.h:67
uint32 StateIndex
Definition: TradePackets.h:34
Definition: RBAC.h:63
::TradeStatus Status
Definition: TradePackets.h:137
uint8_t uint8
Definition: Define.h:152
bool IsAccepted() const
Definition: TradeData.h:58
CharacterDatabaseWorkerPool CharacterDatabase
Accessor to the character database.
Definition: DatabaseEnv.cpp:21
bool FailureForYou
Definition: TradePackets.h:143
SpellCastResult
Definition: SharedDefines.h:1265
bool HasSpellCastItem() const
Definition: TradeData.h:53
Definition: UpdateFields.h:45
int32 BagResult
Definition: TradePackets.h:144
Definition: TradeData.h:26
Definition: SharedDefines.h:4656
bool HasPermission(uint32 permissionId)
Definition: WorldSession.cpp:1259
Item * GetSpellCastItem() const
Definition: TradeData.cpp:50
uint64 GetMoney() const
Definition: TradeData.h:55
Definition: SharedDefines.h:1538
void SetAccepted(bool state, bool forTrader=false)
Definition: TradeData.cpp:132
std::shared_ptr< Transaction > SQLTransaction
Definition: Transaction.h:58
Definition: Spell.h:294

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void WorldSession::HandleActivateTaxiOpcode ( WorldPackets::Taxi::ActivateTaxi activateTaxi)
161 {
162  Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(activateTaxi.Vendor, UNIT_NPC_FLAG_FLIGHTMASTER);
163  if (!unit)
164  {
165  TC_LOG_DEBUG("network", "WORLD: HandleActivateTaxiOpcode - %s not found or you can't interact with it.", activateTaxi.Vendor.ToString().c_str());
166  return;
167  }
168 
169  uint32 curloc = sObjectMgr->GetNearestTaxiNode(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ(), unit->GetMapId(), GetPlayer()->GetTeam());
170  if (!curloc)
171  return;
172 
173  TaxiNodesEntry const* from = sTaxiNodesStore.LookupEntry(curloc);
174  TaxiNodesEntry const* to = sTaxiNodesStore.LookupEntry(activateTaxi.Node);
175  if (!to)
176  return;
177 
178  if (!GetPlayer()->isTaxiCheater())
179  {
180  if (!GetPlayer()->m_taxi.IsTaximaskNodeKnown(curloc) || !GetPlayer()->m_taxi.IsTaximaskNodeKnown(activateTaxi.Node))
181  {
183  return;
184  }
185  }
186 
187  std::vector<uint32> nodes;
188  sTaxiPathGraph.GetCompleteNodeRoute(from, to, GetPlayer(), nodes);
189  GetPlayer()->ActivateTaxiPathTo(nodes, unit);
190 }
void SendActivateTaxiReply(ActivateTaxiReply reply)
Definition: TaxiHandler.cpp:192
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
Definition: Creature.h:467
Player * GetPlayer() const
Definition: WorldSession.h:927
uint32 Node
Definition: TaxiPackets.h:95
#define sObjectMgr
Definition: ObjectMgr.h:1567
float GetPositionY() const
Definition: Position.h:105
ObjectGuid Vendor
Definition: TaxiPackets.h:94
float GetPositionZ() const
Definition: Position.h:106
uint32_t uint32
Definition: Define.h:150
uint32 GetMapId() const
Definition: Position.h:254
Definition: SharedDefines.h:4701
#define sTaxiPathGraph
Definition: TaxiPathGraph.h:65
Definition: DB2Structure.h:1324
float GetPositionX() const
Definition: Position.h:104
DB2Storage< TaxiNodesEntry > sTaxiNodesStore("TaxiNodes.db2", TaxiNodesFormat, HOTFIX_SEL_TAXI_NODES)
std::string ToString() const
Definition: ObjectGuid.cpp:99
Definition: Unit.h:748

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void WorldSession::HandleAddFriendOpcode ( WorldPackets::Social::AddFriend packet)
32 {
33  if (!normalizePlayerName(packet.Name))
34  return;
35 
36  TC_LOG_DEBUG("network", "WorldSession::HandleAddFriendOpcode: %s asked to add friend: %s",
37  GetPlayerInfo().c_str(), packet.Name.c_str());
38 
40  stmt->setString(0, packet.Name);
41 
42  _addFriendCallback.SetParam(std::move(packet.Notes));
44 }
void SetParam(ParamType value)
Definition: Callback.h:63
QueryCallback< PreparedQueryResult, std::string > _addFriendCallback
Definition: WorldSession.h:1734
std::string Notes
Definition: SocialPackets.h:102
void setString(const uint8 index, const std::string &value)
Definition: PreparedStatement.cpp:187
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
QueryResultFuture AsyncQuery(const char *sql)
Definition: DatabaseWorkerPool.cpp:149
Definition: PreparedStatement.h:74
Definition: CharacterDatabase.h:56
bool normalizePlayerName(std::string &name)
Definition: ObjectMgr.cpp:133
std::string Name
Definition: SocialPackets.h:103
PreparedStatement * GetPreparedStatement(PreparedStatementIndex index)
Definition: DatabaseWorkerPool.h:263
std::string GetPlayerInfo() const
Definition: WorldSession.cpp:195
CharacterDatabaseWorkerPool CharacterDatabase
Accessor to the character database.
Definition: DatabaseEnv.cpp:21
void SetFutureResult(std::future< Result > value)
The parameter of this function should be a resultset returned from either .AsyncQuery or ...
Definition: Callback.h:38

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void WorldSession::HandleAddFriendOpcodeCallBack ( PreparedQueryResult  result,
std::string const friendNote 
)
47 {
48  if (!GetPlayer())
49  return;
50 
51  ObjectGuid friendGuid;
52  FriendsResult friendResult = FRIEND_NOT_FOUND;
53 
54  if (result)
55  {
56  Field* fields = result->Fetch();
57 
58  if (ObjectGuid::LowType lowGuid = fields[0].GetUInt64())
59  {
60  friendGuid = ObjectGuid::Create<HighGuid::Player>(lowGuid);
61  uint32 team = Player::TeamForRace(fields[1].GetUInt8());
62  uint32 friendAccountId = fields[2].GetUInt32();
63 
65  {
66  if (friendGuid == GetPlayer()->GetGUID())
67  friendResult = FRIEND_SELF;
68  else if (GetPlayer()->GetTeam() != team && !HasPermission(rbac::RBAC_PERM_TWO_SIDE_ADD_FRIEND))
69  friendResult = FRIEND_ENEMY;
70  else if (GetPlayer()->GetSocial()->HasFriend(friendGuid))
71  friendResult = FRIEND_ALREADY;
72  else
73  {
74  Player* playerFriend = ObjectAccessor::FindPlayer(friendGuid);
75  if (playerFriend && playerFriend->IsVisibleGloballyFor(GetPlayer()))
76  friendResult = FRIEND_ADDED_ONLINE;
77  else
78  friendResult = FRIEND_ADDED_OFFLINE;
79 
80  if (GetPlayer()->GetSocial()->AddToSocialList(friendGuid, SOCIAL_FLAG_FRIEND))
81  GetPlayer()->GetSocial()->SetFriendNote(friendGuid, friendNote);
82  else
83  friendResult = FRIEND_LIST_FULL;
84  }
85  }
86  }
87  }
88 
89  sSocialMgr->SendFriendStatus(GetPlayer(), friendResult, friendGuid);
90 }
Definition: RBAC.h:92
uint32 Realm
Definition: Realm.h:53
FriendsResult
Results of friend related commands.
Definition: SocialMgr.h:67
Definition: SocialMgr.h:77
Realm realm
Definition: World.cpp:3485
Class used to access individual fields of database query result.
Definition: Field.h:56
Player * GetPlayer() const
Definition: WorldSession.h:927
Definition: SocialMgr.h:78
uint64 LowType
Definition: ObjectGuid.h:199
Definition: SocialMgr.h:75
static uint32 GetSecurity(uint32 accountId)
Definition: AccountMgr.cpp:284
TC_GAME_API Player * FindPlayer(ObjectGuid const &)
Definition: ObjectAccessor.cpp:209
Battlenet::RealmHandle Id
Definition: Realm.h:86
Definition: SocialMgr.h:73
uint32_t uint32
Definition: Define.h:150
#define sSocialMgr
Definition: SocialMgr.h:160
static bool IsPlayerAccount(uint32 gmlevel)
Definition: AccountMgr.cpp:390
uint32 GetUInt32() const
Definition: Field.h:146
Definition: SocialMgr.h:76
Definition: SocialMgr.h:70
Definition: ObjectGuid.h:189
bool HasPermission(uint32 permissionId)
Definition: WorldSession.cpp:1259
Definition: SocialMgr.h:40
Definition: SocialMgr.h:79

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void WorldSession::HandleAddIgnoreOpcode ( WorldPackets::Social::AddIgnore packet)
103 {
104  if (!normalizePlayerName(packet.Name))
105  return;
106 
107  TC_LOG_DEBUG("network", "WorldSession::HandleAddIgnoreOpcode: %s asked to Ignore: %s",
108  GetPlayerInfo().c_str(), packet.Name.c_str());
109 
111  stmt->setString(0, packet.Name);
112 
114 }
Definition: CharacterDatabase.h:36
void setString(const uint8 index, const std::string &value)
Definition: PreparedStatement.cpp:187
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
QueryResultFuture AsyncQuery(const char *sql)
Definition: DatabaseWorkerPool.cpp:149
Definition: PreparedStatement.h:74
bool normalizePlayerName(std::string &name)
Definition: ObjectMgr.cpp:133
PreparedStatement * GetPreparedStatement(PreparedStatementIndex index)
Definition: DatabaseWorkerPool.h:263
std::string Name
Definition: SocialPackets.h:134
std::string GetPlayerInfo() const
Definition: WorldSession.cpp:195
PreparedQueryResultFuture _addIgnoreCallback
Definition: WorldSession.h:1731
CharacterDatabaseWorkerPool CharacterDatabase
Accessor to the character database.
Definition: DatabaseEnv.cpp:21

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void WorldSession::HandleAddIgnoreOpcodeCallBack ( PreparedQueryResult  result)
117 {
118  if (!GetPlayer())
119  return;
120 
121  ObjectGuid ignoreGuid;
122  FriendsResult ignoreResult = FRIEND_IGNORE_NOT_FOUND;
123 
124  if (result)
125  {
126  Field* fields = result->Fetch();
127 
128  if (ObjectGuid::LowType lowGuid = fields[0].GetUInt64())
129  {
130  ignoreGuid = ObjectGuid::Create<HighGuid::Player>(lowGuid);
131 
132  if (ignoreGuid == GetPlayer()->GetGUID()) //not add yourself
133  ignoreResult = FRIEND_IGNORE_SELF;
134  else if (GetPlayer()->GetSocial()->HasIgnore(ignoreGuid))
135  ignoreResult = FRIEND_IGNORE_ALREADY;
136  else
137  {
138  ignoreResult = FRIEND_IGNORE_ADDED;
139 
140  // ignore list full
141  if (!GetPlayer()->GetSocial()->AddToSocialList(ignoreGuid, SOCIAL_FLAG_IGNORED))
142  ignoreResult = FRIEND_IGNORE_FULL;
143  }
144  }
145  }
146 
147  sSocialMgr->SendFriendStatus(GetPlayer(), ignoreResult, ignoreGuid);
148 }
FriendsResult
Results of friend related commands.
Definition: SocialMgr.h:67
Definition: SocialMgr.h:82
Definition: SocialMgr.h:81
Class used to access individual fields of database query result.
Definition: Field.h:56
Definition: SocialMgr.h:41
Player * GetPlayer() const
Definition: WorldSession.h:927
Definition: SocialMgr.h:83
uint64 LowType
Definition: ObjectGuid.h:199
Definition: SocialMgr.h:84
#define sSocialMgr
Definition: SocialMgr.h:160
Definition: SocialMgr.h:80
Definition: ObjectGuid.h:189

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void WorldSession::HandleAddonRegisteredPrefixesOpcode ( WorldPackets::Chat::ChatRegisterAddonPrefixes packet)
923 {
924  // This is always sent after CMSG_CHAT_UNREGISTER_ALL_ADDON_PREFIXES
927  {
928  _filterAddonMessages = false;
929  return;
930  }
931 
932  _filterAddonMessages = true;
933 }
iterator begin()
Definition: PacketUtilities.h:83
bool _filterAddonMessages
Definition: WorldSession.h:1834
Array< std::string, MAX_PREFIXES > Prefixes
Definition: ChatPackets.h:271
std::vector< std::string > _registeredAddonPrefixes
Definition: WorldSession.h:1833
iterator end()
Definition: PacketUtilities.h:86

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void WorldSession::HandleAddToy ( WorldPackets::Toy::AddToy packet)
23 {
24  if (!packet.Guid)
25  return;
26 
27  Item* item = _player->GetItemByGuid(packet.Guid);
28  if (!item)
29  {
30  _player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, nullptr, nullptr);
31  return;
32  }
33 
34  if (!sDB2Manager.IsToyItem(item->GetEntry()))
35  return;
36 
37  InventoryResult msg = _player->CanUseItem(item);
38  if (msg != EQUIP_ERR_OK)
39  {
40  _player->SendEquipError(msg, item, nullptr);
41  return;
42  }
43 
44  if (_collectionMgr->AddToy(item->GetEntry(), false))
45  _player->DestroyItem(item->GetBagSlot(), item->GetSlot(), true);
46 }
#define sDB2Manager
Definition: DB2Stores.h:224
Definition: Item.h:48
Definition: Item.h:71
ObjectGuid Guid
Definition: ToyPackets.h:37
Definition: Item.h:259
uint8 GetSlot() const
Definition: Item.h:329
std::unique_ptr< CollectionMgr > _collectionMgr
Definition: WorldSession.h:1845
Player * _player
Definition: WorldSession.h:1797
uint32 GetEntry() const
Definition: Object.h:107
InventoryResult
Definition: Item.h:46
uint8 GetBagSlot() const
Definition: Item.cpp:759

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void WorldSession::HandleAlterAppearance ( WorldPackets::Character::AlterApperance packet)
1411 {
1412  BarberShopStyleEntry const* bs_hair = sBarberShopStyleStore.LookupEntry(packet.NewHairStyle);
1413  if (!bs_hair || bs_hair->Type != 0 || bs_hair->Race != _player->getRace() || bs_hair->Sex != _player->GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER))
1414  return;
1415 
1416  BarberShopStyleEntry const* bs_facialHair = sBarberShopStyleStore.LookupEntry(packet.NewFacialHair);
1417  if (!bs_facialHair || bs_facialHair->Type != 2 || bs_facialHair->Race != _player->getRace() || bs_facialHair->Sex != _player->GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER))
1418  return;
1419 
1420  BarberShopStyleEntry const* bs_skinColor = sBarberShopStyleStore.LookupEntry(packet.NewSkinColor);
1421  if (bs_skinColor && (bs_skinColor->Type != 3 || bs_skinColor->Race != _player->getRace() || bs_skinColor->Sex != _player->GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER)))
1422  return;
1423 
1424  BarberShopStyleEntry const* bs_face = sBarberShopStyleStore.LookupEntry(packet.NewFace);
1425  if (bs_face && (bs_face->Type != 4 || bs_face->Race != _player->getRace() || bs_face->Sex != _player->GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER)))
1426  return;
1427 
1428  if (!Player::ValidateAppearance(_player->getRace(), _player->getClass(), _player->GetByteValue(PLAYER_BYTES_3, PLAYER_BYTES_3_OFFSET_GENDER),
1429  bs_hair->Data,
1430  packet.NewHairColor,
1431  bs_face ? bs_face->Data : _player->GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_FACE_ID),
1432  bs_facialHair->Data,
1433  bs_skinColor ? bs_skinColor->Data : _player->GetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_SKIN_ID)))
1434  return;
1435 
1436  GameObject* go = _player->FindNearestGameObjectOfType(GAMEOBJECT_TYPE_BARBER_CHAIR, 5.0f);
1437  if (!go)
1438  {
1440  return;
1441  }
1442 
1443  if (_player->GetStandState() != UnitStandStateType(UNIT_STAND_STATE_SIT_LOW_CHAIR + go->GetGOInfo()->barberChair.chairheight))
1444  {
1446  return;
1447  }
1448 
1449  uint32 cost = _player->GetBarberShopCost(bs_hair, packet.NewHairColor, bs_facialHair, bs_skinColor, bs_face);
1450 
1451  // 0 - ok
1452  // 1, 3 - not enough money
1453  // 2 - you have to sit on barber chair
1454  if (!_player->HasEnoughMoney((uint64)cost))
1455  {
1457  return;
1458  }
1459 
1461 
1462  _player->ModifyMoney(-int64(cost)); // it isn't free
1463  _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_AT_BARBER, cost);
1464 
1467  _player->SetByteValue(PLAYER_BYTES_2, PLAYER_BYTES_2_OFFSET_FACIAL_STYLE, uint8(bs_facialHair->Data));
1468  if (bs_skinColor)
1469  _player->SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_SKIN_ID, uint8(bs_skinColor->Data));
1470  if (bs_face)
1471  _player->SetByteValue(PLAYER_BYTES, PLAYER_BYTES_OFFSET_FACE_ID, uint8(bs_face->Data));
1472 
1473  _player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_VISIT_BARBER_SHOP, 1);
1474 
1475  _player->SetStandState(UNIT_STAND_STATE_STAND);
1476 }
struct GameObjectTemplate::@221::@255 barberChair
Definition: Unit.h:207
Definition: Player.h:587
Definition: Player.h:572
uint32 NewHairStyle
Definition: CharacterPackets.h:599
uint32 Data
Definition: DB2Structure.h:71
uint32 NewSkinColor
Definition: CharacterPackets.h:602
Definition: WorldSession.h:791
uint32 Type
Definition: DB2Structure.h:65
uint32 Race
Definition: DB2Structure.h:69
Definition: Player.h:573
Definition: UpdateFields.h:198
Definition: UpdateFields.h:197
Definition: DB2Structure.h:62
uint32 Sex
Definition: DB2Structure.h:70
UnitStandStateType
Definition: Unit.h:205
Definition: WorldSession.h:792
uint32_t uint32
Definition: Define.h:150
uint64_t uint64
Definition: Define.h:149
GameObjectTemplate const * GetGOInfo() const
Definition: GameObject.h:894
Definition: Unit.h:211
Definition: GameObject.h:880
void SendBarberShopResult(BarberShopResult result)
Definition: CharacterHandler.cpp:2555
Definition: Player.h:571
int64_t int64
Definition: g3dmath.h:169
uint8_t uint8
Definition: g3dmath.h:164
Definition: WorldSession.h:793
Player * _player
Definition: WorldSession.h:1797
uint32 NewFacialHair
Definition: CharacterPackets.h:601
uint32 NewHairColor
Definition: CharacterPackets.h:600
Definition: SharedDefines.h:2097
Definition: Player.h:579
DB2Storage< BarberShopStyleEntry > sBarberShopStyleStore("BarberShopStyle.db2", BarberShopStyleFormat, HOTFIX_SEL_BARBER_SHOP_STYLE)
uint32 NewFace
Definition: CharacterPackets.h:603
Definition: UpdateFields.h:196
Definition: Player.h:574

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void WorldSession::HandleAreaSpiritHealerQueryOpcode ( WorldPackets::Battleground::AreaSpiritHealerQuery areaSpiritHealerQuery)
644 {
645  Creature* unit = GetPlayer()->GetMap()->GetCreature(areaSpiritHealerQuery.HealerGuid);
646  if (!unit)
647  return;
648 
649  if (!unit->IsSpiritService()) // it's not spirit service
650  return;
651 
652  if (Battleground* bg = _player->GetBattleground())
653  sBattlegroundMgr->SendAreaSpiritHealerQueryOpcode(_player, bg, areaSpiritHealerQuery.HealerGuid);
654 
655  if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(_player->GetZoneId()))
656  bf->SendAreaSpiritHealerQueryOpcode(_player, areaSpiritHealerQuery.HealerGuid);
657 }
ObjectGuid HealerGuid
Definition: BattlegroundPackets.h:49
Definition: Creature.h:467
Player * GetPlayer() const
Definition: WorldSession.h:927
Definition: Battlefield.h:196
#define sBattlefieldMgr
Definition: BattlefieldMgr.h:67
Player * _player
Definition: WorldSession.h:1797
#define sBattlegroundMgr
Definition: BattlegroundMgr.h:181
Definition: Battleground.h:235
bool IsSpiritService() const
Definition: Unit.h:1579

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void WorldSession::HandleAreaSpiritHealerQueueOpcode ( WorldPackets::Battleground::AreaSpiritHealerQueue areaSpiritHealerQueue)
660 {
661  Creature* unit = GetPlayer()->GetMap()->GetCreature(areaSpiritHealerQueue.HealerGuid);
662  if (!unit)
663  return;
664 
665  if (!unit->IsSpiritService()) // it's not spirit service
666  return;
667 
668  if (Battleground* bg = _player->GetBattleground())
669  bg->AddPlayerToResurrectQueue(areaSpiritHealerQueue.HealerGuid, _player->GetGUID());
670 
671  if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldToZoneId(_player->GetZoneId()))
672  bf->AddPlayerToResurrectQueue(areaSpiritHealerQueue.HealerGuid, _player->GetGUID());
673 }
Definition: Creature.h:467
Player * GetPlayer() const
Definition: WorldSession.h:927
Definition: Battlefield.h:196
ObjectGuid HealerGuid
Definition: BattlegroundPackets.h:59
#define sBattlefieldMgr
Definition: BattlefieldMgr.h:67
Player * _player
Definition: WorldSession.h:1797
Definition: Battleground.h:235
bool IsSpiritService() const
Definition: Unit.h:1579

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void WorldSession::HandleAreaTriggerOpcode ( WorldPackets::Misc::AreaTrigger packet)
456 {
457  Player* player = GetPlayer();
458  if (player->IsInFlight())
459  {
460  TC_LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player '%s' (%s) in flight, ignore Area Trigger ID:%u",
461  player->GetName().c_str(), player->GetGUID().ToString().c_str(), packet.AreaTriggerID);
462  return;
463  }
464 
465  AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(packet.AreaTriggerID);
466  if (!atEntry)
467  {
468  TC_LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player '%s' (%s) send unknown (by DBC) Area Trigger ID:%u",
469  player->GetName().c_str(), player->GetGUID().ToString().c_str(), packet.AreaTriggerID);
470  return;
471  }
472 
473  if (!player->IsInAreaTriggerRadius(atEntry))
474  {
475  TC_LOG_DEBUG("network", "HandleAreaTriggerOpcode: Player '%s' (%s) too far, ignore Area Trigger ID: %u",
476  player->GetName().c_str(), player->GetGUID().ToString().c_str(), packet.AreaTriggerID);
477  return;
478  }
479 
480  if (player->isDebugAreaTriggers)
481  ChatHandler(player->GetSession()).PSendSysMessage(packet.Entered ? LANG_DEBUG_AREATRIGGER_ENTERED : LANG_DEBUG_AREATRIGGER_LEFT, packet.AreaTriggerID);
482 
483  if (sScriptMgr->OnAreaTrigger(player, atEntry, packet.Entered))
484  return;
485 
486  if (player->IsAlive())
487  {
488  if (std::unordered_set<uint32> const* quests = sObjectMgr->GetQuestsForAreaTrigger(packet.AreaTriggerID))
489  {
490  for (uint32 questId : *quests)
491  {
492  Quest const* qInfo = sObjectMgr->GetQuestTemplate(questId);
493  if (qInfo && player->GetQuestStatus(questId) == QUEST_STATUS_INCOMPLETE)
494  {
495  for (uint8 j = 0; j < qInfo->Objectives.size(); ++j)
496  {
497  if (qInfo->Objectives[j].Type == QUEST_OBJECTIVE_AREATRIGGER)
498  {
499  player->SetQuestObjectiveData(qInfo, j, int32(true));
500  break;
501  }
502  }
503 
504  if (player->CanCompleteQuest(questId))
505  player->CompleteQuest(questId);
506  }
507  }
508  }
509  }
510 
511  if (sObjectMgr->IsTavernAreaTrigger(packet.AreaTriggerID))
512  {
513  // set resting flag we are in the inn
514  player->SetRestFlag(REST_FLAG_IN_TAVERN, atEntry->ID);
515 
516  if (sWorld->IsFFAPvPRealm())
517  player->RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP);
518 
519  return;
520  }
521 
522  if (Battleground* bg = player->GetBattleground())
523  if (bg->GetStatus() == STATUS_IN_PROGRESS)
524  bg->HandleAreaTrigger(player, packet.AreaTriggerID, packet.Entered);
525 
526  if (OutdoorPvP* pvp = player->GetOutdoorPvP())
527  if (pvp->HandleAreaTrigger(_player, packet.AreaTriggerID, packet.Entered))
528  return;
529 
530  AreaTriggerStruct const* at = sObjectMgr->GetAreaTrigger(packet.AreaTriggerID);
531  if (!at)
532  return;
533 
534  bool teleported = false;
535  if (player->GetMapId() != at->target_mapId)
536  {
537  if (Map::EnterState denyReason = sMapMgr->PlayerCannotEnter(at->target_mapId, player, false))
538  {
539  bool reviveAtTrigger = false; // should we revive the player if he is trying to enter the correct instance?
540  switch (denyReason)
541  {
543  TC_LOG_DEBUG("maps", "MAP: Player '%s' attempted to enter map with id %d which has no entry", player->GetName().c_str(), at->target_mapId);
544  break;
546  TC_LOG_DEBUG("maps", "MAP: Player '%s' attempted to enter dungeon map %d but no instance template was found", player->GetName().c_str(), at->target_mapId);
547  break;
549  TC_LOG_DEBUG("maps", "MAP: Player '%s' attempted to enter instance map %d but the requested difficulty was not found", player->GetName().c_str(), at->target_mapId);
550  if (MapEntry const* entry = sMapStore.LookupEntry(at->target_mapId))
551  player->SendTransferAborted(entry->ID, TRANSFER_ABORT_DIFFICULTY, player->GetDifficultyID(entry));
552  break;
554  TC_LOG_DEBUG("maps", "MAP: Player '%s' must be in a raid group to enter map %d", player->GetName().c_str(), at->target_mapId);
555  player->SendRaidGroupOnlyMessage(RAID_GROUP_ERR_ONLY, 0);
556  reviveAtTrigger = true;
557  break;
559  player->GetSession()->SendPacket(WorldPackets::Misc::AreaTriggerNoCorpse().Write());
560  TC_LOG_DEBUG("maps", "MAP: Player '%s' does not have a corpse in instance map %d and cannot enter", player->GetName().c_str(), at->target_mapId);
561  break;
563  if (MapEntry const* entry = sMapStore.LookupEntry(at->target_mapId))
564  {
565  char const* mapName = entry->MapName_lang;
566  TC_LOG_DEBUG("maps", "MAP: Player '%s' cannot enter instance map '%s' because their permanent bind is incompatible with their group's", player->GetName().c_str(), mapName);
567  // is there a special opcode for this?
568  // @todo figure out how to get player localized difficulty string (e.g. "10 player", "Heroic" etc)
569  ChatHandler(player->GetSession()).PSendSysMessage(player->GetSession()->GetTrinityString(LANG_INSTANCE_BIND_MISMATCH), mapName);
570  }
571  reviveAtTrigger = true;
572  break;
574  player->SendTransferAborted(at->target_mapId, TRANSFER_ABORT_TOO_MANY_INSTANCES);
575  TC_LOG_DEBUG("maps", "MAP: Player '%s' cannot enter instance map %d because he has exceeded the maximum number of instances per hour.", player->GetName().c_str(), at->target_mapId);
576  reviveAtTrigger = true;
577  break;
579  player->SendTransferAborted(at->target_mapId, TRANSFER_ABORT_MAX_PLAYERS);
580  reviveAtTrigger = true;
581  break;
583  player->SendTransferAborted(at->target_mapId, TRANSFER_ABORT_ZONE_IN_COMBAT);
584  reviveAtTrigger = true;
585  break;
586  default:
587  break;
588  }
589 
590  if (reviveAtTrigger) // check if the player is touching the areatrigger leading to the map his corpse is on
591  if (!player->IsAlive() && player->HasCorpse())
592  if (player->GetCorpseLocation().GetMapId() == at->target_mapId)
593  {
594  player->ResurrectPlayer(0.5f);
595  player->SpawnCorpseBones();
596  }
597 
598  return;
599  }
600 
601  if (Group* group = player->GetGroup())
602  if (group->isLFGGroup() && player->GetMap()->IsDungeon())
603  teleported = player->TeleportToBGEntryPoint();
604  }
605 
606  if (!teleported)
607  player->TeleportTo(at->target_mapId, at->target_X, at->target_Y, at->target_Z, at->target_Orientation, TELE_TO_NOT_LEAVE_TRANSPORT);
608 }
Definition: Battleground.h:159
Definition: ObjectMgr.h:400
Definition: UpdateFields.h:146
Definition: Language.h:1221
Definition: QuestDef.h:279
DBCStorage< AreaTriggerEntry > sAreaTriggerStore(AreaTriggerfmt)
Definition: Map.h:378
float target_Orientation
Definition: ObjectMgr.h:406
Definition: DBCStructure.h:830
Definition: Language.h:997
Definition: Unit.h:310
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
Player * GetPlayer() const
Definition: WorldSession.h:927
Definition: SharedDefines.h:4901
#define sWorld
Definition: World.h:887
uint32 ID
Definition: DBCStructure.h:76
bool Entered
Definition: MiscPackets.h:257
#define sObjectMgr
Definition: ObjectMgr.h:1567
float target_Y
Definition: ObjectMgr.h:404
Definition: QuestDef.h:230
Definition: MiscPackets.h:392
Definition: Map.h:375
uint32_t uint32
Definition: Define.h:150
int32 AreaTriggerID
Definition: MiscPackets.h:256
Definition: Language.h:1002
Definition: Map.h:382
Definition: Chat.h:56
Definition: OutdoorPvP.h:188
Player * _player
Definition: WorldSession.h:1797
DBCStorage< MapEntry > sMapStore(Mapfmt)
float target_Z
Definition: ObjectMgr.h:405
#define sMapMgr
Definition: MapManager.h:194
int32_t int32
Definition: g3dmath.h:167
Definition: QuestDef.h:113
uint8_t uint8
Definition: Define.h:152
Definition: Battleground.h:235
Definition: DBCStructure.h:74
EnterState
Definition: Map.h:371
#define sScriptMgr
Definition: ScriptMgr.h:837
QuestObjectives Objectives
Definition: QuestDef.h:454
Definition: Group.h:191
float target_X
Definition: ObjectMgr.h:403
uint32 target_mapId
Definition: ObjectMgr.h:402

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void WorldSession::HandleAttackStopOpcode ( WorldPackets::Combat::AttackStop packet)
65 {
66  GetPlayer()->AttackStop();
67 }
Player * GetPlayer() const
Definition: WorldSession.h:927

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

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

30 {
31  Unit* enemy = ObjectAccessor::GetUnit(*_player, packet.Victim);
32 
33  if (!enemy)
34  {
35  // stop attack state at client
36  SendAttackStop(nullptr);
37  return;
38  }
39 
40  if (!_player->IsValidAttackTarget(enemy))
41  {
42  // stop attack state at client
43  SendAttackStop(enemy);
44  return;
45  }
46 
50  if (Vehicle* vehicle = _player->GetVehicle())
51  {
52  VehicleSeatEntry const* seat = vehicle->GetSeatForPassenger(_player);
53  ASSERT(seat);
54  if (!(seat->Flags & VEHICLE_SEAT_FLAG_CAN_ATTACK))
55  {
56  SendAttackStop(enemy);
57  return;
58  }
59  }
60 
61  _player->Attack(enemy, true);
62 }
Definition: DBCStructure.h:1305
void SendAttackStop(Unit const *enemy)
Definition: CombatHandler.cpp:80
Definition: Vehicle.h:32
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:163
Definition: DBCEnums.h:721
ObjectGuid Victim
Definition: CombatPackets.h:36
Player * _player
Definition: WorldSession.h:1797
#define ASSERT
Definition: Errors.h:55
uint32 Flags
Definition: DBCStructure.h:1308
Definition: Unit.h:1305

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void WorldSession::HandleAuctionHelloOpcode ( WorldPackets::AuctionHouse::AuctionHelloRequest packet)
34 {
35  Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(packet.Guid, UNIT_NPC_FLAG_AUCTIONEER);
36  if (!unit)
37  {
38  TC_LOG_DEBUG("network", "WORLD: HandleAuctionHelloOpcode - Unit (%s) not found or you can't interact with him.", packet.Guid.ToString().c_str());
39  return;
40  }
41 
42  // remove fake death
43  if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
44  GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
45 
46  SendAuctionHello(packet.Guid, unit);
47 }
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
Definition: Creature.h:467
Player * GetPlayer() const
Definition: WorldSession.h:927
void SendAuctionHello(ObjectGuid guid, Creature *unit)
Definition: AuctionHouseHandler.cpp:50
Definition: SpellAuraDefines.h:126
ObjectGuid Guid
Definition: AuctionHousePackets.h:88
Definition: Unit.h:550
Definition: Unit.h:756
std::string ToString() const
Definition: ObjectGuid.cpp:99

+ Here is the call graph for this function: