60 TC_LOG_DEBUG(
"network",
"WORLD: Recvd CMSG_REPOP_REQUEST Message");
75 TC_LOG_DEBUG(
"network",
"HandleRepopRequestOpcode: got request after player {} {} was killed and before he was updated",
89 TC_LOG_DEBUG(
"network",
"WORLD: CMSG_GOSSIP_SELECT_OPTION");
94 std::string code =
"";
96 recvData >> guid >> menuId >> gossipListId;
118 TC_LOG_DEBUG(
"network",
"WORLD: HandleGossipSelectOptionOpcode - {} not found or you can't interact with him.", guid.
ToString());
127 TC_LOG_DEBUG(
"network",
"WORLD: HandleGossipSelectOptionOpcode - {} not found or you can't interact with it.", guid.
ToString());
133 TC_LOG_DEBUG(
"network",
"WORLD: HandleGossipSelectOptionOpcode - unsupported {}.", guid.
ToString());
143 TC_LOG_DEBUG(
"network",
"WORLD: HandleGossipSelectOptionOpcode - Script reloaded while in use, ignoring and set new scipt id");
183 TC_LOG_DEBUG(
"network",
"WorldSession::HandleWhoOpcode: MinLevel: {}, MaxLevel: {}, Name: {}, Guild: {}, RaceFilter: 0x{:X}, ClassFilter: {}, Areas: {}, Words: {}.",
187 std::vector<std::wstring> wWords;
189 for (
size_t i = 0; i < request.
Words.
size(); ++i)
191 TC_LOG_DEBUG(
"network",
"WorldSession::HandleWhoOpcode: Word: {}", request.
Words[i].Word);
200 std::wstring wPlayerName;
201 std::wstring wGuildName;
232 if (
_player->
GetGUID() != target.GetGuid() && !target.IsVisible())
237 int32 lvl = target.GetLevel();
238 if (lvl < request.MinLevel || lvl > request.
MaxLevel)
253 std::wstring
const& wTargetName = target.GetWidePlayerName();
254 if (!(wPlayerName.empty() || wTargetName.find(wPlayerName) != std::wstring::npos))
257 std::wstring
const& wTargetGuildName = target.GetWideGuildName();
259 if (!wGuildName.empty() && wTargetGuildName.find(wGuildName) == std::wstring::npos)
269 for (
size_t i = 0; i < wWords.size(); ++i)
271 if (!wWords[i].empty())
273 if (wTargetName.find(wWords[i]) != std::wstring::npos ||
274 wTargetGuildName.find(wWords[i]) != std::wstring::npos ||
295 whoEntry.
Name = target.GetPlayerName();
296 whoEntry.
GuildName = target.GetGuildName();
297 whoEntry.
Level = target.GetLevel();
298 whoEntry.
ClassID = target.GetClass();
299 whoEntry.
Race = target.GetRace();
300 whoEntry.
Sex = target.GetGender();
301 whoEntry.
AreaID = target.GetZoneId();
320 if (
GetPlayer()->IsInCombat() && !canLogoutInCombat)
329 logoutResponse.
Instant = instantLogout;
416 TC_LOG_DEBUG(
"network",
"WORLD: Recvd ZONE_UPDATE: {}", newZone);
434 && autoReapeatSpell->m_targets.GetUnitTargetGUID() != packet.
Selection)
445 autoReapeatSpell->m_targets.SetUnitTarget(unitTarget);
447 autoReapeatSpell->m_targets.RemoveObjectTarget();
471 uint32 suggestion, contentlen, typelen;
472 std::string content, type;
474 recvData >> suggestion >> contentlen >> content;
476 recvData >> typelen >> type;
479 TC_LOG_DEBUG(
"network",
"WORLD: Received CMSG_BUG [Bug Report]");
481 TC_LOG_DEBUG(
"network",
"WORLD: Received CMSG_BUG [Suggestion]");
496 TC_LOG_DEBUG(
"network",
"WORLD: Received CMSG_RECLAIM_CORPSE");
529 TC_LOG_DEBUG(
"network",
"WORLD: Received CMSG_RESURRECT_RESPONSE");
553 vsnprintf(szStr, 1024,
Text, ap);
556 uint32 length = strlen(szStr)+1;
570 TC_LOG_DEBUG(
"network",
"HandleAreaTriggerOpcode: Player '{}' {} in flight, ignore Area Trigger ID:{}",
578 TC_LOG_DEBUG(
"network",
"HandleAreaTriggerOpcode: Player '{}' {} send unknown (by DBC) Area Trigger ID:{}",
585 TC_LOG_DEBUG(
"network",
"HandleAreaTriggerOpcode: Player '{}' {} too far, ignore Area Trigger ID: {}",
596 if (
sScriptMgr->OnAreaTrigger(player, atEntry))
609 if (
sWorld->IsFFAPvPRealm())
627 bool teleported =
false;
632 bool reviveAtTrigger =
false;
642 TC_LOG_DEBUG(
"maps",
"MAP: Player '{}' attempted to enter instance map {} but the requested difficulty was not found", player->
GetName(), at->
target_mapId);
653 reviveAtTrigger =
true;
666 TC_LOG_DEBUG(
"maps",
"MAP: Player '{}' cannot enter instance map '{}' because their permanent bind is incompatible with their group's", player->
GetName(), mapName);
671 reviveAtTrigger =
true;
675 TC_LOG_DEBUG(
"maps",
"MAP: Player '{}' cannot enter instance map {} because he has exceeded the maximum number of instances per hour.", player->
GetName(), at->
target_mapId);
676 reviveAtTrigger =
true;
680 reviveAtTrigger =
true;
684 reviveAtTrigger =
true;
712 TC_LOG_DEBUG(
"network",
"WORLD: Received CMSG_UPDATE_ACCOUNT_DATA: type {}, time {}, decompressedSize {}",
718 if (packet.
Size == 0)
724 updateAccountDataComplete.
Result = 0;
730 if (packet.
Size > 0xFFFF)
732 TC_LOG_ERROR(
"network",
"UAD: Account data packet too big, size {}", packet.
Size);
737 dest.resize(packet.
Size);
739 uLongf realSize = packet.
Size;
742 TC_LOG_ERROR(
"network",
"UAD: Failed to decompress account data");
750 updateAccountDataComplete.
Result = 0;
756 TC_LOG_DEBUG(
"network",
"WORLD: Received CMSG_REQUEST_ACCOUNT_DATA: type {}", request.
DataType);
769 uLongf destSize = compressBound(data.
Size);
775 TC_LOG_ERROR(
"network",
"RAD: Failed to compress account data");
789 TC_LOG_DEBUG(
"network",
"CMSG_SET_ACTION_BUTTON Button: {} Action: {} Type: {}", packet.
Index, action,
uint32(type));
823 if (packet.
Mask != 0)
824 TC_LOG_ERROR(
"network",
"WorldSession::HandleSetActionBarToggles in not logged state with value: {}, ignored",
uint32(packet.
Mask));
844 TC_LOG_DEBUG(
"network",
"Player '{}' ({}) in flight, ignore worldport command.",
851 TC_LOG_DEBUG(
"network",
"CMSG_WORLD_TELEPORT: Player = {}, time = {}, map = {}, pos = {}",
862 TC_LOG_DEBUG(
"network",
"Received whois command from player {} for character {}",
894 Field* fields = result->Fetch();
899 std::string email = fields[1].
GetString();
903 std::string lastip = fields[2].
GetString();
908 response.
AccountName = packet.
CharName +
"'s " +
"account is " + acc +
", e-mail: " + email +
", last ip: " + lastip;
922 std::string description =
"";
923 recvData >> spam_type;
924 recvData >> spammer_guid;
937 recvData >> description;
949 TC_LOG_DEBUG(
"network",
"REPORT SPAM: type {}, {}, unk1 {}, unk2 {}, unk3 {}, unk4 {}, message {}",
950 spam_type, spammer_guid.
ToString(), unk1, unk2, unk3, unk4, description);
958 std::string split_date =
"01/01/01";
963 data <<
uint32(0x00000000);
1018 TC_LOG_DEBUG(
"network",
"WORLD: CMSG_RESET_INSTANCES");
1035 TC_LOG_DEBUG(
"network",
"WorldSession::HandleSetDungeonDifficultyOpcode: {} sent an invalid instance mode {}!",
1044 TC_LOG_DEBUG(
"network",
"WorldSession::HandleSetDungeonDifficultyOpcode: player (Name: {}, {}) tried to reset the instance while player is inside!",
1065 Player* groupGuy = itr->GetSource();
1074 TC_LOG_DEBUG(
"network",
"WorldSession::HandleSetDungeonDifficultyOpcode: {} tried to reset the instance while group member (Name: {}, {}) is inside!",
1100 TC_LOG_DEBUG(
"network",
"WorldSession::HandleSetDungeonDifficultyOpcode: {} sent an invalid instance mode {}!",
1109 TC_LOG_DEBUG(
"network",
"WorldSession::HandleSetRaidDifficultyOpcode: player (Name: {}, {}) tried to reset the instance while player is inside!",
1130 Player* groupGuy = itr->GetSource();
1139 TC_LOG_DEBUG(
"network",
"WorldSession::HandleSetRaidDifficultyOpcode: {} tried to reset the instance while group member (Name: {}, {}) is inside!",
1161 TC_LOG_DEBUG(
"network",
"WORLD: CMSG_SET_TAXI_BENCHMARK_MODE");
1168 TC_LOG_DEBUG(
"network",
"Client used \"/timetest {}\" command", mode);
1181 TC_LOG_DEBUG(
"network",
"WORLD: CMSG_READY_FOR_ACCOUNT_DATA_TIMES");
1189 data <<
uint32(PhaseShift);
1196 recvPacket >> accept;
1200 TC_LOG_INFO(
"network",
"InstanceLockResponse: Player {} {} tried to bind himself/teleport to graveyard without a pending bind!",
1215 TC_LOG_DEBUG(
"network",
"WORLD: CMSG_UPDATE_MISSILE_TRAJECTORY");
1219 float elevation, speed;
1224 recvPacket >> guid >> spellId >> elevation >> speed;
1225 recvPacket >> firePos;
1226 recvPacket >> impactPos;
1227 recvPacket >> moveStop;
1248 recvPacket >> movementInfo;
@ CONDITION_SOURCE_TYPE_AREATRIGGER_CLIENT_TRIGGERED
#define CORPSE_RECLAIM_RADIUS
@ CORPSE_RESURRECTABLE_PVP
#define MAX_RAID_DIFFICULTY
#define MAX_DUNGEON_DIFFICULTY
DBCStorage< AreaTriggerEntry > sAreaTriggerStore(AreaTriggerEntryfmt)
DBCStorage< MapEntry > sMapStore(MapEntryfmt)
DBCStorage< AreaTableEntry > sAreaTableStore(AreaTableEntryfmt)
std::shared_ptr< PreparedResultSet > PreparedQueryResult
DatabaseWorkerPool< LoginDatabaseConnection > LoginDatabase
Accessor to the realm/login database.
DatabaseWorkerPool< CharacterDatabaseConnection > CharacterDatabase
Accessor to the character database.
@ LANG_PLAYER_NOT_EXIST_OR_OFFLINE
@ LANG_ACCOUNT_FOR_PLAYER_NOT_FOUND
@ LANG_DEBUG_AREATRIGGER_REACHED
@ LANG_INSTANCE_BIND_MISMATCH
@ LANG_YOU_NOT_HAVE_PERMISSION
@ LANG_NEED_CHARACTER_NAME
#define TC_LOG_DEBUG(filterType__,...)
#define TC_LOG_ERROR(filterType__,...)
#define TC_LOG_INFO(filterType__,...)
@ LOGIN_SEL_ACCOUNT_WHOIS
@ INSTANCE_RESET_CHANGE_DIFFICULTY
@ TRANSFER_ABORT_TOO_MANY_INSTANCES
@ TRANSFER_ABORT_DIFFICULTY
@ TRANSFER_ABORT_MAX_PLAYERS
@ TRANSFER_ABORT_ZONE_IN_COMBAT
bool normalizePlayerName(std::string &name)
@ TELE_TO_NOT_LEAVE_TRANSPORT
@ PLAYER_FLAGS_TAXI_BENCHMARK
#define ACTION_BUTTON_TYPE(X)
#define ACTION_BUTTON_ACTION(X)
@ QUEST_STATUS_INCOMPLETE
@ SPELL_AURA_PREVENT_RESURRECTION
@ UNIT_BYTE2_FLAG_FFA_PVP
@ CURRENT_AUTOREPEAT_SPELL
void wstrToLower(std::wstring &str)
bool Utf8FitTo(std::string_view str, std::wstring_view search)
bool Utf8toWStr(char const *utf8str, size_t csize, wchar_t *wstr, size_t &wsize)
#define sWhoListStorageMgr
std::vector< WhoListPlayerInfo > WhoListInfoVector
static bool IsPlayerAccount(uint32 gmlevel)
void PSendSysMessage(char const *fmt, Args &&... args)
time_t const & GetGhostTime() const
CorpseType GetType() const
virtual bool OnGossipSelectCode(Player *, uint32, uint32, char const *)
virtual bool OnGossipSelect(Player *, uint32, uint32)
uint32 GetScriptId() const
Class used to access individual fields of database query result.
std::string GetString() const
virtual bool OnGossipSelect(Player *, uint32, uint32)
virtual bool OnGossipSelectCode(Player *, uint32, uint32, char const *)
GameObjectAI * AI() const
uint32 GetScriptId() const
bool IsLeader(ObjectGuid guid) const
void SetDungeonDifficultyID(Difficulty difficulty)
void SetRaidDifficultyID(Difficulty difficulty)
void ResetInstances(uint8 method, bool isRaid, Player *SendMsgTo)
Difficulty GetRaidDifficultyID() const
GroupReference * GetFirstMember()
Difficulty GetDungeonDifficultyID() const
Difficulty GetDifficultyID(MapEntry const *mapEntry) const
bool IsNonRaidDungeon() const
@ CANNOT_ENTER_CORPSE_IN_DIFFERENT_INSTANCE
@ CANNOT_ENTER_TOO_MANY_INSTANCES
@ CANNOT_ENTER_MAX_PLAYERS
@ CANNOT_ENTER_ZONE_IN_COMBAT
@ CANNOT_ENTER_DIFFICULTY_UNAVAILABLE
@ CANNOT_ENTER_INSTANCE_BIND_MISMATCH
@ CANNOT_ENTER_UNINSTANCED_DUNGEON
@ CANNOT_ENTER_NOT_IN_RAID
static ObjectGuid const Empty
std::string ToString() const
bool IsGameObject() const
bool IsCreatureOrVehicle() const
PackedGuidReader ReadAsPacked()
void SetFlag(uint16 index, uint32 newFlag)
void RemoveFlag(uint16 index, uint32 oldFlag)
void ApplyModFlag(uint16 index, uint32 flag, bool apply)
bool HasFlag(uint16 index, uint32 flag) const
static ObjectGuid GetGUID(Object const *o)
void SetUInt32Value(uint16 index, uint32 value)
void ToggleFlag(uint16 index, uint32 flag)
ObjectGuid GetGuidValue(uint16 index) const
void RemoveActionButton(uint8 button)
WorldLocation const & GetCorpseLocation() const
void SetRestFlag(RestFlag restFlag, uint32 triggerId=0)
void SetSeer(WorldObject *target)
uint32 GetTotalPlayedTime() const
void SendDirectMessage(WorldPacket const *data) const
void ResurrectUsingRequestData()
ActionButton * AddActionButton(uint8 button, uint32 action, uint8 type)
GameObject * GetGameObjectIfCanInteractWith(ObjectGuid const &guid) const
bool InBattleground() const
void SpawnCorpseBones(bool triggerSave=true)
void SetSelection(ObjectGuid const &guid)
Used for serverside target changes, does not apply to players.
void SetRaidDifficultyID(Difficulty raid_difficulty)
void ResetInstances(uint8 method, bool isRaid)
Reset all solo instances and optionally send a message on success for each.
void SendTransferAborted(uint32 mapid, TransferAbortReason reason, uint8 arg=0) const
bool HasPendingBind() const
WorldSession * GetSession() const
OutdoorPvP * GetOutdoorPvP() const
ObjectGuid GetLootGUID() const
Difficulty GetDungeonDifficultyID() const
CinematicMgr * GetCinematicMgr() const
void UpdateVisibilityForPlayer()
void ClearResurrectRequestData()
Creature * GetNPCIfCanInteractWith(ObjectGuid const &guid, NPCFlags npcFlags) const
WorldObject * GetViewpoint() const
void RemovePet(Pet *pet, PetSaveMode mode, bool returnreagent=false)
bool TeleportToBGEntryPoint()
Corpse * GetCorpse() const
Battleground * GetBattleground() const
bool IsInAreaTriggerRadius(AreaTriggerEntry const *trigger) const
void SetMovie(uint32 movie)
void SetNeedsZoneUpdate(bool needsUpdate)
void SetPendingBind(uint32 instanceId, uint32 bindTimer)
bool TeleportTo(uint32 mapid, float x, float y, float z, float orientation, uint32 options=0)
uint32 GetCorpseReclaimDelay(bool pvp) const
void OnGossipSelect(WorldObject *source, uint32 gossipListId, uint32 menuId)
void AreaExploredOrEventHappens(uint32 questId)
void SetDungeonDifficultyID(Difficulty dungeon_difficulty)
Difficulty GetRaidDifficultyID() const
QuestStatus GetQuestStatus(uint32 quest_id) const
InstancePlayerBind * BindToInstance(InstanceSave *save, bool permanent, BindExtensionState extendState=EXTEND_STATE_NORMAL, bool load=false)
uint32 GetLevelPlayedTime() const
void SetMultiActionBars(uint8 mask)
void UpdatePvP(bool state, bool override=false)
PlayerMenu * PlayerTalkClass
Difficulty GetDifficultyID(MapEntry const *mapEntry) const
void ResurrectPlayer(float restore_percent, bool applySickness=false)
void setUInt32(uint8 index, uint32 value)
void setString(uint8 index, std::string const &value)
void SetPitch(float pitch)
void ModDst(Position const &pos)
void SetSpeed(float speed)
void ModSrc(Position const &pos)
SpellCastTargets m_targets
SpellInfo const *const m_spellInfo
void RemoveAurasByType(AuraType auraType, std::function< bool(AuraApplication const *)> const &check, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
void SetRooted(bool apply)
void RemovePvpFlag(UnitPVPStateFlags flags)
void SetStandState(UnitStandStateType state)
void SetUnitFlag(UnitFlags flags)
void RemoveUnitFlag(UnitFlags flags)
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
bool IsValidAttackTarget(WorldObject const *target, SpellInfo const *bySpell=nullptr) const
std::string const & GetName() const
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
uint32 Size
decompressed size
WorldPacket const * Write() override
std::vector< uint8 > CompressedData
std::span< uint8 const > CompressedData
uint32 Size
decompressed size
ObjectGuid Selection
Target.
UnitStandStateType StandState
WorldPacket const * Write() override
TaggedPosition< Position::XYZ > Pos
WorldPacket const * Write() override
WorldPacket const * Write() override
void HandleGossipSelectOptionOpcode(WorldPacket &recvPacket)
void LogoutPlayer(bool save)
Log the player out
void HandleMovementOpcode(OpcodeClient opcode, MovementInfo &movementInfo)
void HandleUITimeRequest(WorldPackets::Misc::UITimeRequest &recvData)
char const * GetTrinityString(uint32 entry) const
void HandleNextCinematicCamera(WorldPackets::Misc::NextCinematicCamera &packet)
void HandleSetDungeonDifficultyOpcode(WorldPackets::Misc::SetDungeonDifficulty &setDungeonDifficulty)
void SendNotification(char const *format,...) ATTR_PRINTF(2
void HandleResetInstancesOpcode(WorldPacket &recvData)
void SendPacket(WorldPacket const *packet)
Send a packet to the client.
void HandleLogoutCancelOpcode(WorldPackets::Character::LogoutCancel &logoutCancel)
AccountTypes GetSecurity() const
void HandleComplainOpcode(WorldPacket &recvData)
void HandleTogglePvP(WorldPackets::Misc::TogglePvP &togglePvP)
void void SendSetPhaseShift(uint32 phaseShift)
void HandleSetSelectionOpcode(WorldPackets::Misc::SetSelection &packet)
LocaleConstant GetSessionDbcLocale() const
void HandleSetActionButtonOpcode(WorldPackets::Spells::SetActionButton &packet)
void HandleRepopRequest(WorldPackets::Misc::RepopRequest &packet)
Player * GetPlayer() const
void HandleUpdateAccountData(WorldPackets::ClientConfig::UserClientUpdateAccountData &packet)
void SetLogoutStartTime(time_t requestTime)
Engage the logout process for the user.
void SendAreaTriggerMessage(char const *Text,...) ATTR_PRINTF(2
void HandleBugOpcode(WorldPacket &recvPacket)
AccountData const * GetAccountData(AccountDataType type) const
void HandleWorldTeleportOpcode(WorldPackets::Misc::WorldTeleport &worldTeleport)
void HandleWhoIsOpcode(WorldPackets::Who::WhoIsRequest &packet)
void HandleRequestAccountData(WorldPackets::ClientConfig::RequestAccountData &request)
void HandleCompleteMovie(WorldPackets::Misc::CompleteMovie &packet)
void HandleReadyForAccountDataTimes(WorldPacket &recvData)
void HandleLogoutRequestOpcode(WorldPackets::Character::LogoutRequest &logoutRequest)
void HandleUpdateMissileTrajectory(WorldPacket &recvPacket)
bool HasPermission(uint32 permissionId)
uint32 GetAccountId() const
void HandleInstanceLockResponse(WorldPacket &recvPacket)
void HandleWhoOpcode(WorldPackets::Who::WhoRequestPkt &whoRequest)
void HandleSetRaidDifficultyOpcode(WorldPackets::Misc::SetRaidDifficulty &setRaidDifficulty)
void HandleFarSightOpcode(WorldPacket &recvData)
void DoLootRelease(ObjectGuid lguid)
void HandlePlayedTime(WorldPackets::Character::PlayedTimeClient &packet)
void HandleSetTitleOpcode(WorldPacket &recvData)
void HandleSetActionBarToggles(WorldPackets::Character::SetActionBarToggles &packet)
void HandleSetTaxiBenchmarkOpcode(WorldPacket &recvData)
void SendAccountDataTimes(uint32 mask)
void HandleStandStateChangeOpcode(WorldPackets::Misc::StandStateChange &packet)
void HandleZoneUpdateOpcode(WorldPacket &recvPacket)
void HandleAreaTriggerOpcode(WorldPackets::AreaTrigger::AreaTrigger &packet)
void SetAccountData(AccountDataType type, time_t time, std::string const &data)
void HandleCompleteCinematic(WorldPackets::Misc::CompleteCinematic &packet)
void HandleReclaimCorpse(WorldPackets::Misc::ReclaimCorpse &packet)
void HandlePlayerLogoutOpcode(WorldPackets::Character::PlayerLogout &playerLogout)
void HandleRealmSplitOpcode(WorldPacket &recvData)
void HandleResurrectResponse(WorldPackets::Misc::ResurrectResponse &packet)
#define GLOBAL_CACHE_MASK
#define NUM_ACCOUNT_DATA_TYPES
@ SMSG_AREA_TRIGGER_MESSAGE
@ CONFIG_GM_LEVEL_IN_WHO_LIST
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
TC_GAME_API Player * FindConnectedPlayerByName(std::string_view name)
@ RBAC_PERM_WHO_SEE_ALL_SEC_LEVELS
@ RBAC_PERM_OPCODE_WORLD_TELEPORT
@ RBAC_PERM_TWO_SIDE_WHO_LIST
@ RBAC_PERM_INSTANT_LOGOUT
std::string ToString() const
void SetOrientation(float orientation)
time_t EndTimer
‍Marks if player is in an FFAPvP area (such as Gurubashi Arena)
std::string_view GuildName
Array< WhoWord, 4 > Words
std::vector< WhoEntry > Entries