diff --git a/src/game/AI/ScriptedAI.cpp b/src/game/AI/ScriptedAI.cpp index 25a1512eebb..a19306a5961 100644 --- a/src/game/AI/ScriptedAI.cpp +++ b/src/game/AI/ScriptedAI.cpp @@ -2,7 +2,7 @@ * This program is free software licensed under GPL version 2 * Please see the included DOCS/LICENSE.TXT for more information */ -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "ScriptedAI.h" #include "GridSearchers.h" @@ -346,4 +346,4 @@ void ScriptedAI::Ambush(Unit* pNewVictim, uint32 embushSpellId) m_creature->CastSpell(pNewVictim, embushSpellId, true); if (m_creature->AI()) m_creature->AI()->AttackStart(pNewVictim); -} \ No newline at end of file +} diff --git a/src/game/AccountMgr.cpp b/src/game/AccountMgr.cpp index b2195a9f427..fdde863b31e 100644 --- a/src/game/AccountMgr.cpp +++ b/src/game/AccountMgr.cpp @@ -28,7 +28,7 @@ #include "Policies/SingletonImp.h" #include "Util.h" #include "World.h" -#include "WorldSession.h" +#include "Server/WorldSession.h" #include "MasterPlayer.h" #include "Anticheat.h" #include "Crypto/Authentication/SRP6.h" @@ -376,7 +376,7 @@ void AccountMgr::LoadAccountBanList(bool silent) sLog.Out(LOG_BASIC, LOG_LVL_MINIMAL, "Loading account_banned ..."); std::unique_ptr banresult(LoginDatabase.PQuery("SELECT `id`, `unbandate`, `bandate` FROM `account_banned` WHERE `active` = 1 AND (`unbandate` > UNIX_TIMESTAMP() OR `bandate` = `unbandate`)")); - + if (!banresult) { if (!silent) @@ -539,7 +539,7 @@ AccountPersistentData& AccountMgr::GetAccountPersistentData(uint32 accountId) if (itr != m_accountPersistentData.end()) return itr->second; } - + { std::lock_guard guard(m_accountPersistentDataMutex); return m_accountPersistentData[accountId]; diff --git a/src/game/Anticheat/Anticheat.cpp b/src/game/Anticheat/Anticheat.cpp index 9c0d5cde616..fb70a8ddcb2 100644 --- a/src/game/Anticheat/Anticheat.cpp +++ b/src/game/Anticheat/Anticheat.cpp @@ -30,7 +30,7 @@ AnticheatManager* GetAnticheatLib() } #include "World.h" -#include "WorldSession.h" +#include "Server/WorldSession.h" #include "MovementAnticheat/MovementAnticheat.h" #include "WardenAnticheat/Warden.hpp" diff --git a/src/game/Anticheat/MovementAnticheat/MovementAnticheat.cpp b/src/game/Anticheat/MovementAnticheat/MovementAnticheat.cpp index 6e9e2f90007..37678ea96d9 100644 --- a/src/game/Anticheat/MovementAnticheat/MovementAnticheat.cpp +++ b/src/game/Anticheat/MovementAnticheat/MovementAnticheat.cpp @@ -6,7 +6,7 @@ #include "Chat.h" #include "Player.h" #include "GameObject.h" -#include "WorldSession.h" +#include "Server/WorldSession.h" #include "MoveSpline.h" #include "World.h" #include "MovementPacketSender.h" @@ -211,7 +211,7 @@ uint32 MovementAnticheat::ComputeCheatAction(std::stringstream& reason) uint32 action = CHEAT_ACTION_NONE; auto AddPenaltyForCheat = [&action, &reason, this](bool total, CheatType cheatType, eConfigBoolValues enabledConfig, eConfigUInt32Values thresholdConfig, eConfigUInt32Values penaltyConfig) - { + { if (sWorld.getConfig(enabledConfig)) { ASSERT(cheatType < CHEATS_COUNT); @@ -610,7 +610,7 @@ uint32 MovementAnticheat::HandlePositionTests(Player* pPlayer, MovementInfo& mov (sWorld.getConfig(CONFIG_BOOL_AC_MOVEMENT_PLAYERS_ONLY) && (m_session->GetSecurity() != SEC_PLAYER)) || !pPlayer->movespline->Finalized()) return 0; - + if (pPlayer != me) InitNewPlayer(pPlayer); @@ -682,7 +682,7 @@ uint32 MovementAnticheat::HandlePositionTests(Player* pPlayer, MovementInfo& mov cheatFlags |= flags; } - if (IsFallEndOpcode(opcode) || + if (IsFallEndOpcode(opcode) || movementInfo.HasMovementFlag(MOVEFLAG_ROOT)) m_knockBack = false; @@ -697,8 +697,8 @@ uint32 MovementAnticheat::HandlePositionTests(Player* pPlayer, MovementInfo& mov { me->m_movementInfo.moveFlags = movementInfo.moveFlags; me->m_movementInfo.CorrectData(); - } - + } + if (HAS_CHEAT(CHEAT_TYPE_OVERSPEED_JUMP) && sWorld.getConfig(CONFIG_BOOL_AC_MOVEMENT_CHEAT_OVERSPEED_JUMP_REJECT)) { @@ -733,7 +733,7 @@ uint32 MovementAnticheat::HandleFlagTests(Player* pPlayer, MovementInfo& movemen if (!sWorld.getConfig(CONFIG_BOOL_AC_MOVEMENT_ENABLED) || (sWorld.getConfig(CONFIG_BOOL_AC_MOVEMENT_PLAYERS_ONLY) && (m_session->GetSecurity() != SEC_PLAYER))) return 0; - + if (me != pPlayer) InitNewPlayer(pPlayer); @@ -941,7 +941,7 @@ bool MovementAnticheat::CheckFallReset(MovementInfo const& movementInfo) const if (!GetLastMovementInfo().HasMovementFlag(MOVEFLAG_JUMPING | MOVEFLAG_FALLINGFAR)) return true; } - + return movementInfo.fallTime != 0 || movementInfo.jump.zspeed != 0.0f; } @@ -997,7 +997,7 @@ bool MovementAnticheat::CheckMoveStart(MovementInfo const& movementInfo, uint16 !GetLastMovementInfo().HasMovementFlag(MOVEFLAG_FORWARD)) return true; } - + if (opcode == MSG_MOVE_START_BACKWARD) { if (!movementInfo.HasMovementFlag(MOVEFLAG_BACKWARD)) @@ -1065,7 +1065,7 @@ bool MovementAnticheat::CheckMoveStart(MovementInfo const& movementInfo, uint16 } else { - + if (movementInfo.HasMovementFlag(MOVEFLAG_SWIMMING) && !GetLastMovementInfo().HasMovementFlag(MOVEFLAG_SWIMMING) && !me->HasCheatOption(PLAYER_CHEAT_FLY)) @@ -1260,7 +1260,7 @@ uint32 MovementAnticheat::CheckSpeedHack(MovementInfo const& movementInfo, uint1 (opcode == CMSG_MOVE_SPLINE_DONE) || IsInKnockBack() || !GetLastMovementInfo().ctime || - me->IsTaxiFlying() || + me->IsTaxiFlying() || me->IsBeingTeleported()) return 0; @@ -1477,7 +1477,7 @@ void MovementAnticheat::CheckBotting(uint16 opcode, MovementInfo const& movement // we store turns count here m_cheatOccuranceTotal[CHEAT_TYPE_BOTTING]++; } - + m_movementPacketsCount++; } @@ -1500,7 +1500,7 @@ bool MovementAnticheat::CheckTeleport(MovementInfo const& movementInfo) const float const distance2d = movementInfo.HasMovementFlag(MOVEFLAG_ONTRANSPORT) ? GetDistance2D(GetLastMovementInfo().t_pos, movementInfo.t_pos) : GetDistance2D(GetLastMovementInfo().pos, movementInfo.pos); - + if (distance2d > 1.0f) return true; @@ -1512,7 +1512,7 @@ bool MovementAnticheat::CheckTeleport(MovementInfo const& movementInfo) const float const distanceZ = movementInfo.HasMovementFlag(MOVEFLAG_ONTRANSPORT) ? std::abs(GetLastMovementInfo().t_pos.z - movementInfo.t_pos.z) : std::abs(GetLastMovementInfo().pos.z - movementInfo.pos.z); - + if (distanceZ > 2.0f) return true; } diff --git a/src/game/Anticheat/WardenAnticheat/Warden.cpp b/src/game/Anticheat/WardenAnticheat/Warden.cpp index a928d73fbd0..a2505933d05 100644 --- a/src/game/Anticheat/WardenAnticheat/Warden.cpp +++ b/src/game/Anticheat/WardenAnticheat/Warden.cpp @@ -26,8 +26,8 @@ #include "Common.h" #include "Language.h" -#include "WorldPacket.h" -#include "WorldSession.h" +#include "Server/WorldPacket.h" +#include "Server/WorldSession.h" #include "World.h" #include "Log.h" #include "Errors.h" diff --git a/src/game/Anticheat/WardenAnticheat/WardenMac.cpp b/src/game/Anticheat/WardenAnticheat/WardenMac.cpp index fd160b77f9a..c24686461c5 100644 --- a/src/game/Anticheat/WardenAnticheat/WardenMac.cpp +++ b/src/game/Anticheat/WardenAnticheat/WardenMac.cpp @@ -24,7 +24,7 @@ #include "WardenMac.hpp" #include "WardenModuleMgr.hpp" #include "WardenScanMgr.hpp" -#include "WorldSession.h" +#include "Server/WorldSession.h" #include "World.h" #include "Database/DatabaseEnv.h" @@ -43,7 +43,7 @@ void WardenMac::LoadScriptedScans() WardenMac::WardenMac(WorldSession* session, BigNumber const& K) : m_fingerprintSaved(false), Warden(session, session->GetPlatform() == CLIENT_PLATFORM_X86 ? sWardenModuleMgr.GetMacModule() : nullptr, K) { - + } void WardenMac::Update() diff --git a/src/game/Anticheat/WardenAnticheat/WardenMac.hpp b/src/game/Anticheat/WardenAnticheat/WardenMac.hpp index b8d98895dd7..981ef6159cd 100644 --- a/src/game/Anticheat/WardenAnticheat/WardenMac.hpp +++ b/src/game/Anticheat/WardenAnticheat/WardenMac.hpp @@ -26,7 +26,7 @@ #include "Warden.hpp" #include "WardenScan.hpp" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include diff --git a/src/game/Anticheat/WardenAnticheat/WardenWin.cpp b/src/game/Anticheat/WardenAnticheat/WardenWin.cpp index 3d07586bbb0..4ab36cbb41f 100644 --- a/src/game/Anticheat/WardenAnticheat/WardenWin.cpp +++ b/src/game/Anticheat/WardenAnticheat/WardenWin.cpp @@ -28,7 +28,7 @@ #include "WardenScan.hpp" #include "../Anticheat.h" #include "World.h" -#include "WorldSession.h" +#include "Server/WorldSession.h" #include "Util.h" #include "Log.h" #include "Crypto/BigNumber.h" diff --git a/src/game/Anticheat/WardenAnticheat/WardenWin.hpp b/src/game/Anticheat/WardenAnticheat/WardenWin.hpp index 3e66db91a37..f247b9e7098 100644 --- a/src/game/Anticheat/WardenAnticheat/WardenWin.hpp +++ b/src/game/Anticheat/WardenAnticheat/WardenWin.hpp @@ -26,7 +26,7 @@ #include "Warden.hpp" #include "WardenScan.hpp" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include diff --git a/src/game/AuctionHouse/AuctionHouseMgr.cpp b/src/game/AuctionHouse/AuctionHouseMgr.cpp index 1852f73b0cc..324e6d39b2d 100644 --- a/src/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/game/AuctionHouse/AuctionHouseMgr.cpp @@ -31,8 +31,8 @@ #include "ObjectGuid.h" #include "Player.h" #include "World.h" -#include "WorldPacket.h" -#include "WorldSession.h" +#include "Server/WorldPacket.h" +#include "Server/WorldSession.h" #include "Mail.h" #include "TransactionLog.h" #include "Policies/SingletonImp.h" @@ -153,7 +153,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction) uint32 owner_accid = sObjectMgr.GetPlayerAccountIdByGUID(owner_guid); - sLog.Player(bidder_accId, LOG_GM, LOG_LVL_BASIC, + sLog.Player(bidder_accId, LOG_GM, LOG_LVL_BASIC, "GM %s (Account: %u) won item in auction: %s (Entry: %u Count: %u) and pay money: %u. Original owner %s (Account: %u)", bidder_name.c_str(), bidder_accId, pItem->GetProto()->Name1, pItem->GetEntry(), pItem->GetCount(), auction->bid, owner_name.c_str(), owner_accid); } diff --git a/src/game/Battlegrounds/BattleGround.cpp b/src/game/Battlegrounds/BattleGround.cpp index 233bdc27959..279d520dc33 100644 --- a/src/game/Battlegrounds/BattleGround.cpp +++ b/src/game/Battlegrounds/BattleGround.cpp @@ -31,7 +31,7 @@ #include "ObjectGuid.h" #include "ObjectMgr.h" #include "Mail.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "Util.h" #include "Formulas.h" #include "GridNotifiersImpl.h" @@ -690,7 +690,7 @@ void BattleGround::EndBattleGround(Team winner) if (team == winner) RewardMark(pPlayer, true); // World of Warcraft Client Patch 1.8.4 (2005-12-06) - // - Battles must now last at least ten minutes after the start of the + // - Battles must now last at least ten minutes after the start of the // battle in order for the losing team to receive a Mark of honor. else if (GetStartTime() > 10 * MINUTE * IN_MILLISECONDS) RewardMark(pPlayer, false); @@ -1199,7 +1199,7 @@ void BattleGround::DecreaseInvitedCount(Team team) } } void BattleGround::IncreaseInvitedCount(Team team) -{ +{ switch (team) { case ALLIANCE: @@ -1283,7 +1283,7 @@ bool BattleGround::AddObject(uint32 type, uint32 entry, float x, float y, float delete go; return false; } - + // add to world, so it can be later looked up from HashMapHolder go->AddToWorld(); m_bgObjects[type] = go->GetObjectGuid(); diff --git a/src/game/Battlegrounds/BattleGroundAB.cpp b/src/game/Battlegrounds/BattleGroundAB.cpp index 4039a9c8159..89038b3a39d 100644 --- a/src/game/Battlegrounds/BattleGroundAB.cpp +++ b/src/game/Battlegrounds/BattleGroundAB.cpp @@ -27,7 +27,7 @@ #include "BattleGroundMgr.h" #include "Language.h" #include "Util.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #if SUPPORTED_CLIENT_BUILD > CLIENT_BUILD_1_6_1 diff --git a/src/game/Battlegrounds/BattleGroundAV.cpp b/src/game/Battlegrounds/BattleGroundAV.cpp index 4d449909f08..d5e11cc9a27 100644 --- a/src/game/Battlegrounds/BattleGroundAV.cpp +++ b/src/game/Battlegrounds/BattleGroundAV.cpp @@ -26,7 +26,7 @@ #include "Creature.h" #include "GameObject.h" #include "Language.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "Chat.h" #include "World.h" @@ -129,7 +129,7 @@ void BattleGroundAV::initializeChallengeInvocationGoals(void) m_challengeMinReputationNeeded[i] = REP_NEUTRAL; /** Real value REP_REVERED */ // World of Warcraft Client Patch 1.6.0 (2005-07-12) - // The minimum reputation needed to send a cavalry charge has been + // The minimum reputation needed to send a cavalry charge has been // reduced to Honored. m_challengeMinReputationNeeded[BG_AV_CAVALRY_ASSAULT] = sWorld.GetWowPatch() < WOW_PATCH_106 ? REP_REVERED : REP_HONORED; m_challengeMinReputationNeeded[BG_AV_GROUND_ASSAULT] = REP_HONORED; @@ -401,12 +401,12 @@ void BattleGroundAV::HandleKillUnit(Creature* creature, Player* killer) { ChangeMineOwner(BG_AV_SOUTH_MINE, GetAVTeamIndexByTeamId(killer->GetTeam())); CompleteQuestForAll(7122); - } + } else if (killer->GetTeam() == HORDE) { ChangeMineOwner(BG_AV_SOUTH_MINE, GetAVTeamIndexByTeamId(killer->GetTeam())); CompleteQuestForAll(7124); - } + } else // Never happens, this function HandleKillUnit is only called if a player kill a unit ChangeMineOwner(BG_AV_SOUTH_MINE, BG_AV_TEAM_NEUTRAL); break; @@ -527,7 +527,7 @@ void BattleGroundAV::HandleQuestComplete(Unit* questGiver, uint32 questid, Playe sprintf(sMessageRemaining,"Thanks for the supplies, %s",player->GetName()); ((Creature*)questGiver)->MonsterSay(sMessageRemaining, 0, 0); - if (m_teamQuestStatus[teamIdx][0] == 500) + if (m_teamQuestStatus[teamIdx][0] == 500) { if (teamIdx == 0) CastSpellOnTeam(28418, ALLIANCE); @@ -537,7 +537,7 @@ void BattleGroundAV::HandleQuestComplete(Unit* questGiver, uint32 questid, Playe sprintf(sMessageRemaining,"Seasoned units are entering the battle!"); ((Creature*)questGiver)->MonsterYell(sMessageRemaining, 0, 0); } - else if (m_teamQuestStatus[teamIdx][0] == 1000) + else if (m_teamQuestStatus[teamIdx][0] == 1000) { if (teamIdx == 0) CastSpellOnTeam(28419, ALLIANCE); @@ -547,7 +547,7 @@ void BattleGroundAV::HandleQuestComplete(Unit* questGiver, uint32 questid, Playe sprintf(sMessageRemaining,"Veteran units are entering the battle!"); ((Creature*)questGiver)->MonsterYell(sMessageRemaining, 0, 0); } - else if (m_teamQuestStatus[teamIdx][0] == 1500) + else if (m_teamQuestStatus[teamIdx][0] == 1500) { if (teamIdx == 0) CastSpellOnTeam(28420, ALLIANCE); @@ -600,7 +600,7 @@ void BattleGroundAV::HandleQuestComplete(Unit* questGiver, uint32 questid, Playe if (m_nodes[i].owner == teamIdx && m_nodes[i].state == POINT_CONTROLLED) PopulateNode(i); } -*/ +*/ break; case BG_AV_QUEST_A_COMMANDER1: case BG_AV_QUEST_H_COMMANDER1: @@ -964,7 +964,7 @@ void BattleGroundAV::EndBattleGround(Team winner) RewardHonorToTeam(uint32(GetBonusHonorFromKill(towersSurvived[i] * BG_AV_KILL_SURVIVING_TOWER) * GetHonorModifier()), team[i]); } sLog.Out(LOG_BASIC, LOG_LVL_DEBUG, "BattleGroundAV: EndbattleGround: bgteam: %u towers:%u honor:%u rep:%u", i, towersSurvived[i], GetBonusHonorFromKill(towersSurvived[i] * BG_AV_KILL_SURVIVING_TOWER), towersSurvived[i] * BG_AV_REP_SURVIVING_TOWER); - + // World of Warcraft Client Patch 1.7.0 (2005-09-13) // - Alterac Valley now correctly rewards honor for owning graveyards at // the end of the game. diff --git a/src/game/Battlegrounds/BattleGroundMgr.cpp b/src/game/Battlegrounds/BattleGroundMgr.cpp index d87fef92ea0..77720347e31 100644 --- a/src/game/Battlegrounds/BattleGroundMgr.cpp +++ b/src/game/Battlegrounds/BattleGroundMgr.cpp @@ -33,7 +33,7 @@ #include "ObjectMgr.h" #include "ProgressBar.h" #include "World.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "Language.h" #include "GameEventMgr.h" #include "Policies/SingletonImp.h" @@ -175,7 +175,7 @@ GroupQueueInfo* BattleGroundQueue::AddGroup(Player* leader, Group* grp, BattleGr Player* member = itr->getSource(); if (!member) continue; // this should never happen - + if (excludedMembers && (std::find(excludedMembers->begin(), excludedMembers->end(), member->GetGUIDLow()) != excludedMembers->end())) continue; diff --git a/src/game/Battlegrounds/BattleGroundWS.cpp b/src/game/Battlegrounds/BattleGroundWS.cpp index 9b1ba9c991e..5236319c619 100644 --- a/src/game/Battlegrounds/BattleGroundWS.cpp +++ b/src/game/Battlegrounds/BattleGroundWS.cpp @@ -26,7 +26,7 @@ #include "GameObject.h" #include "ObjectMgr.h" #include "BattleGroundMgr.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "Language.h" #include "World.h" diff --git a/src/game/CMakeLists.txt b/src/game/CMakeLists.txt index 482802616b6..d313dbc47e5 100644 --- a/src/game/CMakeLists.txt +++ b/src/game/CMakeLists.txt @@ -46,7 +46,6 @@ set (game_SRCS UnitAuraProcHandler.cpp Weather.cpp World.cpp - WorldSession.cpp AI/BasicAI.cpp AI/CreatureAI.cpp AI/CreatureAIRegistry.cpp @@ -196,11 +195,10 @@ set (game_SRCS PlayerBots/BattleBotWaypoints.cpp PlayerBots/PlayerBotAI.cpp PlayerBots/PlayerBotMgr.cpp - Protocol/Opcodes.cpp - Protocol/WorldSocket.h - Protocol/WorldSocket.cpp - Protocol/WorldSocketMgr.h - Protocol/WorldSocketMgr.cpp + Server/Protocol/Opcodes.cpp + Server/WorldSession.cpp + Server/WorldSocket.cpp + Server/WorldSocketMgr.cpp Spells/Spell.cpp Spells/SpellAuras.cpp Spells/SpellEffects.cpp @@ -259,7 +257,6 @@ set (game_SRCS UnitEvents.h Weather.h World.h - WorldSession.h WorldStates.h AI/BasicAI.h AI/CreatureAI.h @@ -421,7 +418,11 @@ set (game_SRCS PlayerBots/BattleBotWaypoints.h PlayerBots/PlayerBotAI.h PlayerBots/PlayerBotMgr.h - Protocol/Opcodes.h + Server/Protocol/Opcodes.h + Server/WorldPacket.h + Server/WorldSession.h + Server/WorldSocket.h + Server/WorldSocketMgr.h Spells/Spell.h Spells/SpellAuraDefines.h Spells/SpellAuras.h @@ -504,7 +505,7 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/OutdoorPvP ${CMAKE_CURRENT_SOURCE_DIR}/PacketBroadcast ${CMAKE_CURRENT_SOURCE_DIR}/PlayerBots - ${CMAKE_CURRENT_SOURCE_DIR}/Protocol + ${CMAKE_CURRENT_SOURCE_DIR}/Server/Protocol ${CMAKE_CURRENT_SOURCE_DIR}/Spells ${CMAKE_CURRENT_SOURCE_DIR}/Threat ${CMAKE_CURRENT_SOURCE_DIR}/Transports @@ -601,15 +602,14 @@ if((${CMAKE_VERSION} VERSION_LESS "3.16") OR USE_PCH_OLD) else() if(USE_PCH) target_precompile_headers(game PRIVATE - Protocol/WorldSocket.h + Server/WorldSocket.h ../shared/Common.h - Maps/MapManager.h ../shared/Log.h ObjectAccessor.h ObjectGuid.h Database/SQLStorages.h - Protocol/Opcodes.h + Server/Protocol/Opcodes.h SharedDefines.h Guild/GuildMgr.h ObjectMgr.h diff --git a/src/game/Chat/Channel.h b/src/game/Chat/Channel.h index 7f0c9c12ebe..78d28127b81 100644 --- a/src/game/Chat/Channel.h +++ b/src/game/Chat/Channel.h @@ -24,7 +24,7 @@ #include "Common.h" #include "ObjectGuid.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "Opcodes.h" #include "Chat/AbstractPlayer.h" diff --git a/src/game/Chat/Chat.cpp b/src/game/Chat/Chat.cpp index 7f1ed538a0c..234915dc150 100644 --- a/src/game/Chat/Chat.cpp +++ b/src/game/Chat/Chat.cpp @@ -22,8 +22,8 @@ #include "Chat.h" #include "Language.h" #include "Database/DatabaseEnv.h" -#include "WorldPacket.h" -#include "WorldSession.h" +#include "Server/WorldPacket.h" +#include "Server/WorldSession.h" #include "Opcodes.h" #include "Log.h" #include "World.h" @@ -1140,7 +1140,7 @@ ChatCommand * ChatHandler::getCommandTable() { "", SEC_TICKETMASTER, true, &ChatHandler::HandleGMTicketGetByIdOrNameCommand, "", nullptr }, { nullptr, 0, false, nullptr, "", nullptr } }; - + static ChatCommand serviceCommandTable[] = { { "del_characters", SEC_ADMINISTRATOR, true, &ChatHandler::HandleServiceDeleteCharacters, "", nullptr }, @@ -1411,7 +1411,7 @@ void ChatHandler::LoadRbacPermissions() sLog.Out(LOG_DBERROR, LOG_LVL_ERROR, "Unknown RBAC permission id %u assigned to command '%s'!", permissionId, command.c_str()); continue; } - + SetPermissionMaskForCommandInTable(commandTable, command.c_str(), permissionId); } while (result->NextRow()); diff --git a/src/game/Chat/MasterPlayer.cpp b/src/game/Chat/MasterPlayer.cpp index 0537c25003d..715c571faf0 100644 --- a/src/game/Chat/MasterPlayer.cpp +++ b/src/game/Chat/MasterPlayer.cpp @@ -6,11 +6,11 @@ #include "Mail.h" #include "Bag.h" #include "ObjectAccessor.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "Opcodes.h" MasterPlayer::MasterPlayer(WorldSession* s): - m_speakTime(0), m_speakCount(0), m_social(nullptr), + m_speakTime(0), m_speakCount(0), m_social(nullptr), m_session(s), m_mailsUpdated(false) { } @@ -244,7 +244,7 @@ void MasterPlayer::LoadMailedItems(std::unique_ptr result) Item *item = NewItemOrBag(proto); - /* + /* * LoadFromDB is called from multiple places but with a different set of fields - this is workaround * so I don't need to fix the mess of queries and probably break something until a later date */ diff --git a/src/game/Commands/DebugCommands.cpp b/src/game/Commands/DebugCommands.cpp index bc8189a7cf1..1e65c90dd70 100644 --- a/src/game/Commands/DebugCommands.cpp +++ b/src/game/Commands/DebugCommands.cpp @@ -22,7 +22,7 @@ #include "Common.h" #include "Database/DatabaseEnv.h" #include "DBCStores.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "Player.h" #include "Bag.h" #include "Opcodes.h" @@ -1211,7 +1211,7 @@ bool ChatHandler::HandleDebugSetValueByNameCommand(char* args) break; } } - + } else SendSysMessage("Wrong field name."); @@ -2190,7 +2190,7 @@ bool ChatHandler::HandleDebugMonsterChatCommand(char* args) uint32 chatType; if (!ExtractUInt32(&args, chatType)) return false; - + std::ostringstream oss; oss << "Chat" << int(chatType); std::string rightText = oss.str(); @@ -2252,7 +2252,7 @@ bool ChatHandler::HandleDebugMonsterChatCommand(char* args) data << uint8(0); pTarget->SendMessageToSet(&data, true); #else // 1.11.2 client - + if (chatType == 11 || chatType == 12 || chatType == 89 || chatType == 13 || chatType == 26) { data << uint32(strlen(pSender->GetName()) + 1); diff --git a/src/game/GMTicketMgr.cpp b/src/game/GMTicketMgr.cpp index 40c9c02b478..470478985c3 100644 --- a/src/game/GMTicketMgr.cpp +++ b/src/game/GMTicketMgr.cpp @@ -23,8 +23,8 @@ #include "Log.h" #include "Language.h" #include "Opcodes.h" -#include "WorldPacket.h" -#include "WorldSession.h" +#include "Server/WorldPacket.h" +#include "Server/WorldSession.h" #include "Chat.h" #include "World.h" #include "Player.h" diff --git a/src/game/GossipDef.cpp b/src/game/GossipDef.cpp index 6720752eded..71eb0cd8576 100644 --- a/src/game/GossipDef.cpp +++ b/src/game/GossipDef.cpp @@ -23,8 +23,8 @@ #include "QuestDef.h" #include "ObjectMgr.h" #include "Opcodes.h" -#include "WorldPacket.h" -#include "WorldSession.h" +#include "Server/WorldPacket.h" +#include "Server/WorldSession.h" #include "Formulas.h" GossipMenu::GossipMenu(WorldSession* session) : m_session(session) @@ -564,7 +564,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* pQuest, ObjectGuid npcG sizeof(uint32) + // RewItemCount sizeof(uint32); // DisplayInfoID - WorldPacket data(SMSG_QUESTGIVER_QUEST_DETAILS, mainPartSize + titleLen + detailsLen + objectivesLen + + WorldPacket data(SMSG_QUESTGIVER_QUEST_DETAILS, mainPartSize + titleLen + detailsLen + objectivesLen + pQuest->GetRewChoiceItemsCount() * rewChoiceItemsPartSize + pQuest->GetRewItemsCount() * rewItemsPartSize); @@ -586,7 +586,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* pQuest, ObjectGuid npcG ItemPrototype const* IProto; auto count = pQuest->GetRewChoiceItemsCount(); // QUEST_REWARD_CHOICES_COUNT - data << uint32(count); + data << uint32(count); for (uint32 i = 0; i < count; ++i) { @@ -603,7 +603,7 @@ void PlayerMenu::SendQuestGiverQuestDetails(Quest const* pQuest, ObjectGuid npcG count = pQuest->GetRewItemsCount(); // QUEST_REWARDS_COUNT data << uint32(count); - + for (uint32 i = 0; i < count; ++i) { data << uint32(pQuest->RewItemId[i]); diff --git a/src/game/Group/Group.cpp b/src/game/Group/Group.cpp index c1e87b86631..0135c001bfd 100644 --- a/src/game/Group/Group.cpp +++ b/src/game/Group/Group.cpp @@ -21,8 +21,8 @@ #include "Common.h" #include "Opcodes.h" -#include "WorldPacket.h" -#include "WorldSession.h" +#include "Server/WorldPacket.h" +#include "Server/WorldSession.h" #include "Player.h" #include "World.h" #include "ObjectMgr.h" @@ -79,7 +79,7 @@ void Roll::targetObjectBuildLink() //============== Group ============================== //=================================================== -Group::Group() : m_Id(0), m_leaderLastOnline(0), m_groupType(GROUPTYPE_NORMAL), +Group::Group() : m_Id(0), m_leaderLastOnline(0), m_groupType(GROUPTYPE_NORMAL), m_bgGroup(nullptr), m_lootMethod(FREE_FOR_ALL), m_lootThreshold(ITEM_QUALITY_UNCOMMON), m_subGroupsCounts(nullptr), m_groupTeam(TEAM_NONE), m_LFGAreaId(0) { @@ -1347,7 +1347,7 @@ void Group::SendUpdate() markedTargets = std::make_unique(MSG_RAID_TARGET_UPDATE, (1 + TARGET_ICON_COUNT * 9)); *markedTargets << uint8(1); // 1 - full icon list, 0 - delta update } - + *markedTargets << uint8(i); *markedTargets << m_targetIcons[i]; } diff --git a/src/game/Guild/Guild.cpp b/src/game/Guild/Guild.cpp index 7aa1e7fe25e..f0cdfc81d05 100644 --- a/src/game/Guild/Guild.cpp +++ b/src/game/Guild/Guild.cpp @@ -20,8 +20,8 @@ */ #include "Database/DatabaseEnv.h" -#include "WorldPacket.h" -#include "WorldSession.h" +#include "Server/WorldPacket.h" +#include "Server/WorldSession.h" #include "Player.h" #include "Opcodes.h" #include "ObjectMgr.h" @@ -811,7 +811,7 @@ void Guild::Roster(WorldSession* session /*= nullptr*/) if (spaceLeft <= 0) break; count++; - + if (Player* pl = ObjectAccessor::FindPlayer(ObjectGuid(HIGHGUID_PLAYER, itr.first))) { data << pl->GetObjectGuid(); diff --git a/src/game/Handlers/AddonHandler.cpp b/src/game/Handlers/AddonHandler.cpp index 26cc76822d9..6e726225917 100644 --- a/src/game/Handlers/AddonHandler.cpp +++ b/src/game/Handlers/AddonHandler.cpp @@ -22,7 +22,7 @@ #include "AddonHandler.h" #include "Database/DatabaseEnv.h" #include "Opcodes.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "Log.h" #include "Policies/SingletonImp.h" #include "zlib.h" diff --git a/src/game/Handlers/AuctionHouseHandler.cpp b/src/game/Handlers/AuctionHouseHandler.cpp index 91d974ce903..ff3506e82af 100644 --- a/src/game/Handlers/AuctionHouseHandler.cpp +++ b/src/game/Handlers/AuctionHouseHandler.cpp @@ -19,8 +19,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "WorldPacket.h" -#include "WorldSession.h" +#include "Server/WorldPacket.h" +#include "Server/WorldSession.h" #include "Opcodes.h" #include "Log.h" #include "World.h" @@ -375,7 +375,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recv_data) if (GetSecurity() > SEC_PLAYER && sWorld.getConfig(CONFIG_BOOL_GM_LOG_TRADE)) { - sLog.Player(GetAccountId(), LOG_GM, LOG_LVL_BASIC, + sLog.Player(GetAccountId(), LOG_GM, LOG_LVL_BASIC, "GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)", GetPlayerName(), GetAccountId(), it->GetProto()->Name1, it->GetEntry(), it->GetCount()); } @@ -401,7 +401,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recv_data) AH->auctionHouseEntry = auctionHouseEntry; sLog.Player(this, LOG_MONEY_TRADES, LOG_LVL_MINIMAL, "[AuctionHouse]: Player %s listing %s (%u) at auctioneer %s. Initial bid: %u, buyout: %u, duration: %u, auctionhouse: %u", - pl->GetShortDescription().c_str(), it->GetGuidStr().c_str(), it->GetEntry(), + pl->GetShortDescription().c_str(), it->GetGuidStr().c_str(), it->GetEntry(), auctioneerGuid.GetString().c_str(), bid, buyout, auction_time, AH->GetHouseId()); // Log this transaction diff --git a/src/game/Handlers/BattleGroundHandler.cpp b/src/game/Handlers/BattleGroundHandler.cpp index 892f391a85d..f777aed6b89 100644 --- a/src/game/Handlers/BattleGroundHandler.cpp +++ b/src/game/Handlers/BattleGroundHandler.cpp @@ -20,13 +20,13 @@ */ #include "Common.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "Opcodes.h" #include "Log.h" #include "Player.h" #include "Group.h" #include "ObjectMgr.h" -#include "WorldSession.h" +#include "Server/WorldSession.h" #include "Object.h" #include "Chat.h" #include "BattleGroundMgr.h" @@ -165,7 +165,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recv_data) // ignore if player is already in BG if (_player->InBattleGround()) return; - + // get bg instance or bg template if instance not found BattleGround *bg = nullptr; if (instanceId) @@ -255,7 +255,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recv_data) { Player* member = itr->getSource(); if (!member) continue; // this should never happen - + if (std::find(excludedMembers.begin(), excludedMembers.end(), member->GetGUIDLow()) != excludedMembers.end()) { WorldPacket data; @@ -310,7 +310,7 @@ void WorldSession::HandleBattleGroundPlayerPositionsOpcode(WorldPacket& /*recv_d } } data.put(countPos, count); - + switch (bg->GetTypeID()) { case BATTLEGROUND_WS: diff --git a/src/game/Handlers/CharacterHandler.cpp b/src/game/Handlers/CharacterHandler.cpp index 1e050c6c91d..00ac525a6d2 100644 --- a/src/game/Handlers/CharacterHandler.cpp +++ b/src/game/Handlers/CharacterHandler.cpp @@ -21,9 +21,9 @@ #include "Common.h" #include "Database/DatabaseEnv.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "SharedDefines.h" -#include "WorldSession.h" +#include "Server/WorldSession.h" #include "Opcodes.h" #include "Log.h" #include "World.h" @@ -158,7 +158,7 @@ void WorldSession::HandleCharEnum(std::unique_ptr result) } while (result->NextRow()); } - + data.put(0, num); m_charactersCount = num; @@ -712,7 +712,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder *holder) std::string IP_str = GetRemoteAddress(); sLog.Player(this, LOG_CHAR, "Login", LOG_LVL_DETAIL, alreadyOnline ? "Player was already online" : ""); - + if (!alreadyOnline && !pCurrChar->IsStandingUp() && !pCurrChar->HasUnitState(UNIT_STATE_STUNNED)) pCurrChar->SetStandState(UNIT_STAND_STATE_STAND); diff --git a/src/game/Handlers/ChatHandler.cpp b/src/game/Handlers/ChatHandler.cpp index 75004bacde8..3d26612ca79 100644 --- a/src/game/Handlers/ChatHandler.cpp +++ b/src/game/Handlers/ChatHandler.cpp @@ -21,8 +21,8 @@ #include "Common.h" #include "Log.h" -#include "WorldPacket.h" -#include "WorldSession.h" +#include "Server/WorldPacket.h" +#include "Server/WorldSession.h" #include "World.h" #include "Opcodes.h" #include "ObjectMgr.h" @@ -235,7 +235,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recv_data) return; } } - + if (lang != LANG_ADDON && GetMasterPlayer()) GetMasterPlayer()->UpdateSpeakTime(); // Anti chat flood } @@ -244,7 +244,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recv_data) char* msg = nullptr; size_t msgLen = 0; std::string channel, to; - + // Message parsing switch (type) { diff --git a/src/game/Handlers/CombatHandler.cpp b/src/game/Handlers/CombatHandler.cpp index 853a98e7a47..5df5c67768c 100644 --- a/src/game/Handlers/CombatHandler.cpp +++ b/src/game/Handlers/CombatHandler.cpp @@ -22,8 +22,8 @@ #include "Common.h" #include "Log.h" #include "Opcodes.h" -#include "WorldPacket.h" -#include "WorldSession.h" +#include "Server/WorldPacket.h" +#include "Server/WorldSession.h" #include "CreatureAI.h" #include "ObjectGuid.h" #include "Player.h" diff --git a/src/game/Handlers/DuelHandler.cpp b/src/game/Handlers/DuelHandler.cpp index b32bd03a016..18c10748ace 100644 --- a/src/game/Handlers/DuelHandler.cpp +++ b/src/game/Handlers/DuelHandler.cpp @@ -20,8 +20,8 @@ */ #include "Common.h" -#include "WorldPacket.h" -#include "WorldSession.h" +#include "Server/WorldPacket.h" +#include "Server/WorldSession.h" #include "Log.h" #include "Opcodes.h" #include "UpdateData.h" diff --git a/src/game/Handlers/GMTicketHandler.cpp b/src/game/Handlers/GMTicketHandler.cpp index 783027b617b..1e13700bc2e 100644 --- a/src/game/Handlers/GMTicketHandler.cpp +++ b/src/game/Handlers/GMTicketHandler.cpp @@ -21,7 +21,7 @@ #include "Common.h" #include "Language.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "Log.h" #include "GMTicketMgr.h" #include "Player.h" diff --git a/src/game/Handlers/GroupHandler.cpp b/src/game/Handlers/GroupHandler.cpp index 2d60d4caa6a..0032166727f 100644 --- a/src/game/Handlers/GroupHandler.cpp +++ b/src/game/Handlers/GroupHandler.cpp @@ -23,8 +23,8 @@ #include "Database/DatabaseEnv.h" #include "Opcodes.h" #include "Log.h" -#include "WorldPacket.h" -#include "WorldSession.h" +#include "Server/WorldPacket.h" +#include "Server/WorldSession.h" #include "World.h" #include "ObjectMgr.h" #include "Player.h" diff --git a/src/game/Handlers/GuildHandler.cpp b/src/game/Handlers/GuildHandler.cpp index 92bebdeb27b..a1e4ba5ba69 100644 --- a/src/game/Handlers/GuildHandler.cpp +++ b/src/game/Handlers/GuildHandler.cpp @@ -20,8 +20,8 @@ */ #include "Common.h" -#include "WorldPacket.h" -#include "WorldSession.h" +#include "Server/WorldPacket.h" +#include "Server/WorldSession.h" #include "World.h" #include "ObjectMgr.h" #include "Log.h" diff --git a/src/game/Handlers/ItemHandler.cpp b/src/game/Handlers/ItemHandler.cpp index 62b2260ae34..b5f7f70e80a 100644 --- a/src/game/Handlers/ItemHandler.cpp +++ b/src/game/Handlers/ItemHandler.cpp @@ -20,8 +20,8 @@ */ #include "Common.h" -#include "WorldPacket.h" -#include "WorldSession.h" +#include "Server/WorldPacket.h" +#include "Server/WorldSession.h" #include "Opcodes.h" #include "Log.h" #include "ObjectMgr.h" @@ -517,7 +517,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket& recv_data) } // prevent selling item in bank slot - if (_player->IsBankPos(pItem->GetPos())) + if (_player->IsBankPos(pItem->GetPos())) { _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, pCreature, itemGuid, 0); return; @@ -1139,7 +1139,7 @@ void WorldSession::HandleItemNameQueryOpcode(WorldPacket& recv_data) name = il->Name[loc_idx].c_str(); } } - + size_t const nameLen = strlen(name) + 1; WorldPacket data(SMSG_ITEM_NAME_QUERY_RESPONSE, (4 + nameLen)); @@ -1232,7 +1232,7 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recv_data) CharacterDatabase.BeginTransaction(_player->GetGUIDLow()); CharacterDatabase.PExecute("INSERT INTO character_gifts VALUES ('%u', '%u', '%u', '%u')", item->GetOwnerGuid().GetCounter(), item->GetGUIDLow(), item->GetEntry(), item->GetUInt32Value(ITEM_FIELD_FLAGS)); - + item->SetEntry(gift->GetProto()->WrappedGift); item->SetGuidValue(ITEM_FIELD_GIFTCREATOR, _player->GetObjectGuid()); item->SetUInt32Value(ITEM_FIELD_FLAGS, ITEM_DYNFLAG_WRAPPED); diff --git a/src/game/Handlers/LootHandler.cpp b/src/game/Handlers/LootHandler.cpp index 86465179273..dfd870a5f9d 100644 --- a/src/game/Handlers/LootHandler.cpp +++ b/src/game/Handlers/LootHandler.cpp @@ -21,7 +21,7 @@ #include "Common.h" #include "Opcodes.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "Log.h" #include "Corpse.h" #include "GameObject.h" @@ -29,7 +29,7 @@ #include "Player.h" #include "ObjectAccessor.h" #include "ObjectGuid.h" -#include "WorldSession.h" +#include "Server/WorldSession.h" #include "LootMgr.h" #include "Object.h" #include "Group.h" @@ -71,7 +71,7 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket& recv_data) return true; }; - + if (!go || (ShouldCheckDistance() && !go->IsWithinDistInMap(_player, INTERACTION_DISTANCE))) { player->SendLootRelease(lguid); @@ -312,7 +312,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recv_data*/) Player* playerGroup = itr->getSource(); if (!playerGroup) continue; - + if (player->IsWithinLootXPDist(playerGroup)) playersNear.push_back(playerGroup); } @@ -675,7 +675,7 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket& recv_data) _player->SendLootError(lootGuid, LOOT_ERROR_DIDNT_KILL); return; } - + if (!_player->IsAtGroupRewardDistance(creature)) { _player->SendLootError(lootGuid, LOOT_ERROR_TOO_FAR); diff --git a/src/game/Handlers/MailHandler.cpp b/src/game/Handlers/MailHandler.cpp index 04fa8918581..1833c1b0d6f 100644 --- a/src/game/Handlers/MailHandler.cpp +++ b/src/game/Handlers/MailHandler.cpp @@ -33,8 +33,8 @@ #include "Item.h" #include "Player.h" #include "World.h" -#include "WorldPacket.h" -#include "WorldSession.h" +#include "Server/WorldPacket.h" +#include "Server/WorldSession.h" #include "Opcodes.h" #include "Chat.h" #include "Anticheat.h" @@ -134,7 +134,7 @@ void WorldSession::HandleSendMail(WorldPacket& recv_data) { ObjectGuid mailboxGuid; uint32 unk1, unk2; - + recv_data >> mailboxGuid; if (!CheckMailBox(mailboxGuid)) { @@ -301,7 +301,7 @@ void WorldSession::HandleSendMailCallback(WorldSession::AsyncMailSendRequest* re } // prevent sending item from bank slot - if (_player->IsBankPos(item->GetPos())) + if (_player->IsBankPos(item->GetPos())) { SendMailResult(0, MAIL_SEND, MAIL_ERR_INTERNAL_ERROR); return; @@ -763,7 +763,7 @@ void WorldSession::HandleGetMailList(WorldPacket& recv_data) constexpr uint32 averageSizePerMail = sizeof(uint32) /*Message Id*/ + - sizeof(uint8) /*Message Type*/ + + sizeof(uint8) /*Message Type*/ + sizeof(uint64) /*Sender Guid*/ + 32 /*Subject (max 64)*/ + sizeof(uint32) /*Item Text Id*/ + diff --git a/src/game/Handlers/MiscHandler.cpp b/src/game/Handlers/MiscHandler.cpp index aaca8179f8b..f2975868b35 100644 --- a/src/game/Handlers/MiscHandler.cpp +++ b/src/game/Handlers/MiscHandler.cpp @@ -23,7 +23,7 @@ #include "Language.h" #include "Database/DatabaseEnv.h" #include "Database/DatabaseImpl.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "Opcodes.h" #include "Log.h" #include "Player.h" @@ -31,7 +31,7 @@ #include "World.h" #include "GuildMgr.h" #include "ObjectMgr.h" -#include "WorldSession.h" +#include "Server/WorldSession.h" #include "ScriptMgr.h" #include #include "ObjectAccessor.h" @@ -158,7 +158,7 @@ class WhoListClientQueryTask if (!(wguildName.empty() || wgname.find(wguildName) != std::wstring::npos)) continue; - + uint32 pzoneId = pPlayer->GetCachedZoneId(); bool zShow = true; @@ -823,12 +823,12 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data) if (!pPlayer->IsGameMaster() && !pPlayer->HasCheatOption(PLAYER_CHEAT_TRIGGER_PASS)) { // World of Warcraft Client Patch 1.4.1 (2005-05-03) - // - Added minimum level requirements to all instances to prevent + // - Added minimum level requirements to all instances to prevent // exploitive behavior.The minimum levels are very generous and should // not affect the normal course of gameplay. bool const bLevelCheck = pPlayer->GetLevel() < pTeleTrigger->requiredLevel && !sWorld.getConfig(CONFIG_BOOL_INSTANCE_IGNORE_LEVEL) && sWorld.GetWowPatch() >= WOW_PATCH_104; bool const bConditionCheck = pTeleTrigger->requiredCondition && !IsConditionSatisfied(pTeleTrigger->requiredCondition, pPlayer, pPlayer->GetMap(), pPlayer, CONDITION_FROM_AREATRIGGER); - + if (bLevelCheck || bConditionCheck) { if (pTeleTrigger->message.empty()) diff --git a/src/game/Handlers/MovementHandler.cpp b/src/game/Handlers/MovementHandler.cpp index e3cd97fc681..4eaf849b842 100644 --- a/src/game/Handlers/MovementHandler.cpp +++ b/src/game/Handlers/MovementHandler.cpp @@ -20,8 +20,8 @@ */ #include "Common.h" -#include "WorldPacket.h" -#include "WorldSession.h" +#include "Server/WorldPacket.h" +#include "Server/WorldSession.h" #include "Opcodes.h" #include "Log.h" #include "Player.h" @@ -301,7 +301,7 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvData) // currently being moved by server if (!pMover->movespline->Finalized()) return; - + Player* pPlayerMover = pMover->ToPlayer(); // ignore, waiting processing in WorldSession::HandleMoveWorldportAckOpcode and WorldSession::HandleMoveTeleportAck @@ -978,7 +978,7 @@ void WorldSession::HandleMoveNotActiveMoverOpcode(WorldPacket& recvData) // ignore, waiting processing in WorldSession::HandleMoveWorldportAckOpcode and WorldSession::HandleMoveTeleportAck if (pPlayerMover && pPlayerMover->IsBeingTeleported()) return; - + if (pPlayerMover) { if ((m_moveRejectTime = _player->GetCheatData()->HandleFlagTests(pPlayerMover, movementInfo, recvData.GetOpcode())) || @@ -1174,7 +1174,7 @@ void WorldSession::HandleMoverRelocation(Unit* pMover, MovementInfo& movementInf } else if (pPlayerMover->CanFreeMove()) pPlayerMover->SaveNoUndermapPosition(pMover->m_movementInfo.GetPos().x, pMover->m_movementInfo.GetPos().y, pMover->m_movementInfo.GetPos().z + 3.0f, pMover->m_movementInfo.GetPos().o); - + // Antiundermap2: teleport to graveyard if (pMover->m_movementInfo.GetPos().z < -500.0f && !pPlayerMover->IsGameMaster()) { diff --git a/src/game/Handlers/NPCHandler.cpp b/src/game/Handlers/NPCHandler.cpp index 6af1a333a26..f60c56c442d 100644 --- a/src/game/Handlers/NPCHandler.cpp +++ b/src/game/Handlers/NPCHandler.cpp @@ -22,8 +22,8 @@ #include "Common.h" #include "Language.h" #include "Database/DatabaseEnv.h" -#include "WorldPacket.h" -#include "WorldSession.h" +#include "Server/WorldPacket.h" +#include "Server/WorldSession.h" #include "Opcodes.h" #include "Log.h" #include "ObjectMgr.h" @@ -293,7 +293,7 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket& recv_data) SendTrainingFailure(guid, spellId, TRAIN_FAIL_UNAVAILABLE); return; } - + // Try to find the spell in npc_trainer. TrainerSpell const* trainer_spell = cSpells ? cSpells->Find(spellId) : nullptr; @@ -307,7 +307,7 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket& recv_data) SendTrainingFailure(guid, spellId, TRAIN_FAIL_UNAVAILABLE); return; } - + // Can't be learned, cheat? Or double learn with lags... if (_player->GetTrainerSpellState(trainer_spell) != TRAINER_SPELL_GREEN) { @@ -472,7 +472,7 @@ void WorldSession::SendSpiritResurrect() float orientation = _player->GetOrientation(); // World of Warcraft Client Patch 1.8.0 (2005-10-11) - // - All graveyards that needed adjustment were changed so that a + // - All graveyards that needed adjustment were changed so that a // character's spirit comes into the world facing toward the Spirit Healer. #if SUPPORTED_CLIENT_BUILD > CLIENT_BUILD_1_7_1 if (float facing = sObjectMgr.GetWorldSafeLocFacing(corpseGrave->ID)) diff --git a/src/game/Handlers/PetHandler.cpp b/src/game/Handlers/PetHandler.cpp index 0fb097d30b2..6e353fcda2d 100644 --- a/src/game/Handlers/PetHandler.cpp +++ b/src/game/Handlers/PetHandler.cpp @@ -20,8 +20,8 @@ */ #include "Common.h" -#include "WorldPacket.h" -#include "WorldSession.h" +#include "Server/WorldPacket.h" +#include "Server/WorldSession.h" #include "ObjectMgr.h" #include "SpellMgr.h" #include "Log.h" @@ -140,8 +140,8 @@ void WorldSession::HandlePetAction(WorldPacket& recv_data) pCharmedUnit->SendPetCastFail(spellid, SPELL_FAILED_BAD_IMPLICIT_TARGETS); return; } - - if (pUnitTarget == pCharmedUnit && + + if (pUnitTarget == pCharmedUnit && // Cannot cast negative spells on yourself. Handle it here since casting negative // spells on yourself is frequently used within the core itself for certain mechanics. ((explicitlySelectedTarget && !spellInfo->IsPositiveSpell(pCharmedUnit, pUnitTarget)) || diff --git a/src/game/Handlers/PetitionsHandler.cpp b/src/game/Handlers/PetitionsHandler.cpp index a27d3cd2eab..ba00e8b6c3d 100644 --- a/src/game/Handlers/PetitionsHandler.cpp +++ b/src/game/Handlers/PetitionsHandler.cpp @@ -21,8 +21,8 @@ #include "Common.h" #include "Language.h" -#include "WorldPacket.h" -#include "WorldSession.h" +#include "Server/WorldPacket.h" +#include "Server/WorldSession.h" #include "World.h" #include "ObjectMgr.h" #include "Log.h" diff --git a/src/game/Handlers/QueryHandler.cpp b/src/game/Handlers/QueryHandler.cpp index 0cb1239fbd1..98169d68548 100644 --- a/src/game/Handlers/QueryHandler.cpp +++ b/src/game/Handlers/QueryHandler.cpp @@ -22,8 +22,8 @@ #include "Common.h" #include "Database/DatabaseEnv.h" #include "Database/DatabaseImpl.h" -#include "WorldPacket.h" -#include "WorldSession.h" +#include "Server/WorldPacket.h" +#include "Server/WorldSession.h" #include "Opcodes.h" #include "Log.h" #include "World.h" @@ -288,7 +288,7 @@ void WorldSession::HandleGameObjectQueryOpcode(WorldPacket& recv_data) data.append(info->raw.data, 24); // these are read as int32 #else data.append(info->raw.data, 16); // these are read as int32 -#endif +#endif //data << float(info->size); // [-ZERO] go size: not in Zero SendPacket(&data); } diff --git a/src/game/Handlers/QuestHandler.cpp b/src/game/Handlers/QuestHandler.cpp index 63e4dbff37d..1c6085f993e 100644 --- a/src/game/Handlers/QuestHandler.cpp +++ b/src/game/Handlers/QuestHandler.cpp @@ -21,8 +21,8 @@ #include "Common.h" #include "Log.h" -#include "WorldPacket.h" -#include "WorldSession.h" +#include "Server/WorldPacket.h" +#include "Server/WorldSession.h" #include "Opcodes.h" #include "World.h" #include "ObjectMgr.h" diff --git a/src/game/Handlers/SkillHandler.cpp b/src/game/Handlers/SkillHandler.cpp index 226477c353e..e79cfc2643d 100644 --- a/src/game/Handlers/SkillHandler.cpp +++ b/src/game/Handlers/SkillHandler.cpp @@ -24,8 +24,8 @@ #include "Opcodes.h" #include "Log.h" #include "Player.h" -#include "WorldPacket.h" -#include "WorldSession.h" +#include "Server/WorldPacket.h" +#include "Server/WorldSession.h" #include "UpdateMask.h" #include "Anticheat.h" diff --git a/src/game/Handlers/SpellHandler.cpp b/src/game/Handlers/SpellHandler.cpp index 26bfdfcf757..b695134a681 100644 --- a/src/game/Handlers/SpellHandler.cpp +++ b/src/game/Handlers/SpellHandler.cpp @@ -21,8 +21,8 @@ #include "Common.h" #include "DBCStores.h" -#include "WorldPacket.h" -#include "WorldSession.h" +#include "Server/WorldPacket.h" +#include "Server/WorldSession.h" #include "SpellMgr.h" #include "Log.h" #include "Opcodes.h" @@ -385,7 +385,7 @@ void WorldSession::HandleCancelAuraOpcode(WorldPacket& recvPacket) if (spellInfo->HasAttribute(SPELL_ATTR_DO_NOT_DISPLAY)) return; - + if (spellInfo->HasAttribute(SPELL_ATTR_EX_NO_AURA_ICON) && !spellInfo->activeIconID) return; diff --git a/src/game/Handlers/TaxiHandler.cpp b/src/game/Handlers/TaxiHandler.cpp index cd1fb2477d4..19d9e90e29f 100644 --- a/src/game/Handlers/TaxiHandler.cpp +++ b/src/game/Handlers/TaxiHandler.cpp @@ -21,8 +21,8 @@ #include "Common.h" #include "Database/DatabaseEnv.h" -#include "WorldPacket.h" -#include "WorldSession.h" +#include "Server/WorldPacket.h" +#include "Server/WorldSession.h" #include "Opcodes.h" #include "Log.h" #include "ObjectMgr.h" diff --git a/src/game/Handlers/TradeHandler.cpp b/src/game/Handlers/TradeHandler.cpp index 6e4f2f26769..ba8e2187e8f 100644 --- a/src/game/Handlers/TradeHandler.cpp +++ b/src/game/Handlers/TradeHandler.cpp @@ -20,8 +20,8 @@ */ #include "Common.h" -#include "WorldPacket.h" -#include "WorldSession.h" +#include "Server/WorldPacket.h" +#include "Server/WorldSession.h" #include "World.h" #include "Log.h" #include "Opcodes.h" @@ -683,7 +683,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) // OK start trade _player->m_trade = new TradeData(_player, pOther); pOther->m_trade = new TradeData(pOther, _player); - + // Set the scam prevention, a delay of 200 ms should suffice _player->m_trade->SetScamPreventionDelay(200); pOther->m_trade->SetScamPreventionDelay(200); @@ -749,7 +749,7 @@ void WorldSession::HandleSetTradeItemOpcode(WorldPacket& recvPacket) } // prevent trading item from bank slot - if (_player->IsBankPos(bag, slot)) + if (_player->IsBankPos(bag, slot)) { SendTradeStatus(TRADE_STATUS_TRADE_CANCELED); return; diff --git a/src/game/LFG/LFGHandler.cpp b/src/game/LFG/LFGHandler.cpp index 21d9be766b7..e16230c0f7d 100644 --- a/src/game/LFG/LFGHandler.cpp +++ b/src/game/LFG/LFGHandler.cpp @@ -17,12 +17,12 @@ */ #include "Common.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "Opcodes.h" #include "Log.h" #include "Player.h" #include "ObjectMgr.h" -#include "WorldSession.h" +#include "Server/WorldSession.h" #include "Object.h" #include "World.h" #include "Group.h" diff --git a/src/game/LFG/LFGMgr.cpp b/src/game/LFG/LFGMgr.cpp index d73cacd53f6..1cc7ea770b1 100644 --- a/src/game/LFG/LFGMgr.cpp +++ b/src/game/LFG/LFGMgr.cpp @@ -24,8 +24,8 @@ #include "Map.h" #include "ObjectMgr.h" #include "World.h" -#include "WorldPacket.h" -#include "WorldSession.h" +#include "Server/WorldPacket.h" +#include "Server/WorldSession.h" #include "Language.h" #include "Group.h" #include "LFGMgr.h" diff --git a/src/game/LFG/LFGQueue.cpp b/src/game/LFG/LFGQueue.cpp index 7e202af654e..2df2d713335 100644 --- a/src/game/LFG/LFGQueue.cpp +++ b/src/game/LFG/LFGQueue.cpp @@ -19,7 +19,7 @@ #include "LFGQueue.h" #include "World.h" #include "LFGMgr.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "Player.h" #include "ObjectMgr.h" #include "Group.h" @@ -151,7 +151,7 @@ void LFGQueue::Update() sWorld.GetMessager().AddMessage([groupId = qGroup->first](World* world) { Group* group = sObjectMgr.GetGroupById(groupId); - + WorldPacket data; LFGMgr::BuildInProgressPacket(data); diff --git a/src/game/Mail/Mail.cpp b/src/game/Mail/Mail.cpp index 596e4829db4..d59f5794e7f 100644 --- a/src/game/Mail/Mail.cpp +++ b/src/game/Mail/Mail.cpp @@ -29,7 +29,7 @@ */ #include "Mail.h" -#include "WorldSession.h" +#include "Server/WorldSession.h" #include "Opcodes.h" #include "Log.h" #include "World.h" diff --git a/src/game/Maps/GridNotifiers.cpp b/src/game/Maps/GridNotifiers.cpp index 55298600c26..907fbe576d9 100644 --- a/src/game/Maps/GridNotifiers.cpp +++ b/src/game/Maps/GridNotifiers.cpp @@ -20,8 +20,8 @@ */ #include "GridNotifiers.h" -#include "WorldPacket.h" -#include "WorldSession.h" +#include "Server/WorldPacket.h" +#include "Server/WorldSession.h" #include "UpdateData.h" #include "Map.h" #include "Transport.h" diff --git a/src/game/Maps/GridNotifiersImpl.h b/src/game/Maps/GridNotifiersImpl.h index 06b025e8079..f9b250ebc68 100644 --- a/src/game/Maps/GridNotifiersImpl.h +++ b/src/game/Maps/GridNotifiersImpl.h @@ -23,7 +23,7 @@ #define MANGOS_GRIDNOTIFIERSIMPL_H #include "GridNotifiers.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "Corpse.h" #include "Player.h" #include "UpdateData.h" @@ -208,7 +208,7 @@ inline void MaNGOS::DynamicObjectUpdater::VisitHelper(Unit* target) PersistentAreaAura* Aur = new PersistentAreaAura(i_dynobject.GetObjectGuid(), spellInfo, eff_index, holder, target, pCasterUnit); holder->AddAura(Aur, eff_index); - + target->AddAuraToModList(Aur); Aur->ApplyModifier(true,true); } diff --git a/src/game/Maps/ZoneScript.cpp b/src/game/Maps/ZoneScript.cpp index 6239286beae..99c346a979c 100644 --- a/src/game/Maps/ZoneScript.cpp +++ b/src/game/Maps/ZoneScript.cpp @@ -21,7 +21,7 @@ #include "Map.h" #include "MapManager.h" #include "Group.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "GridNotifiers.h" #include "GridNotifiersImpl.h" #include "CellImpl.h" @@ -49,14 +49,14 @@ bool OPvPCapturePoint::HandlePlayerEnter(Player* plr) plr->SendUpdateWorldState(m_capturePoint->GetGOInfo()->capturePoint.worldstate3, m_neutralValuePct); /* IMPORTANT! EP_UI_TOWER_SLIDER_POS: Should always be sent last and only when the value (m_valuePct) has been updated. - + ------------------------------------------------------------ (m_minValue)(-m_minValue) (m_maxValue) [240] [-240] (-m_maxValue) Alliance [1200]<=========|===[0]===|=========>[-1200] Horde Blue Grey Red ------------------------------------------------------------ - + The Client does auto handle the direction indicator: If the previous value was 0 and the new value 1 , the indicator points to the left (Alliance). If the previous value was 0 and the new value -1 , the indicator points to the right (Horde). @@ -160,7 +160,7 @@ bool OPvPCapturePoint::SetCapturePointData(uint32 entry, uint32 mapId, float x, return false; } - Map* map = GetMap(); + Map* map = GetMap(); if (map->GetId() != mapId) map = const_cast(sMapMgr.FindMap(mapId, sMapMgr.GetContinentInstanceId(mapId, x, y))); if (!map) @@ -317,7 +317,7 @@ bool OPvPCapturePoint::Update(uint32 diff) itr = playersPerTeam.erase(itr); continue; } - + ++itr; } } diff --git a/src/game/Movement/MovementPacketSender.cpp b/src/game/Movement/MovementPacketSender.cpp index c9b690ad0bf..30625fd2f1d 100644 --- a/src/game/Movement/MovementPacketSender.cpp +++ b/src/game/Movement/MovementPacketSender.cpp @@ -18,8 +18,8 @@ #include "MovementPacketSender.h" #include "Player.h" #include "Opcodes.h" -#include "WorldPacket.h" -#include "WorldSession.h" +#include "Server/WorldPacket.h" +#include "Server/WorldSession.h" #include "Anticheat.h" #include "MoveSpline.h" @@ -52,7 +52,7 @@ void MovementPacketSender::AddSpeedChangeToController(Unit* unit, UnitMoveType m return; } - float newSpeedFlat = newRate * baseMoveSpeed[mtype]; + float newSpeedFlat = newRate * baseMoveSpeed[mtype]; uint32 mCounter = unit->GetMovementCounterAndInc(); PlayerMovementPendingChange pendingChange; pendingChange.movementCounter = mCounter; @@ -343,7 +343,7 @@ void MovementPacketSender::SendMovementFlagChangeToController(Unit* unit, Player #if SUPPORTED_CLIENT_BUILD > CLIENT_BUILD_1_9_4 data << pendingChange.movementCounter; #endif - + mover->GetCheatData()->LogMovementPacket(false, data); mover->GetSession()->SendPacket(&data); } diff --git a/src/game/Movement/WaypointMovementGenerator.cpp b/src/game/Movement/WaypointMovementGenerator.cpp index 3fba85d3e58..8100da9362e 100644 --- a/src/game/Movement/WaypointMovementGenerator.cpp +++ b/src/game/Movement/WaypointMovementGenerator.cpp @@ -22,7 +22,7 @@ #include "Creature.h" #include "CreatureAI.h" #include "WaypointManager.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "ScriptMgr.h" #include "MoveSplineInit.h" #include "MoveSpline.h" diff --git a/src/game/Movement/spline/MoveSplineInit.cpp b/src/game/Movement/spline/MoveSplineInit.cpp index b88324f5a60..51ec82251b6 100644 --- a/src/game/Movement/spline/MoveSplineInit.cpp +++ b/src/game/Movement/spline/MoveSplineInit.cpp @@ -20,7 +20,7 @@ #include "MoveSpline.h" #include "packet_builder.h" #include "Opcodes.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "Unit.h" #include "Transport.h" #include "ObjectMgr.h" @@ -135,7 +135,7 @@ int32 MoveSplineInit::Launch() unit.m_movementInfo.SetMovementFlags((MovementFlags)moveFlags); move_spline.SetMovementOrigin(movementType); move_spline.Initialize(args); - + WorldPacket data(SMSG_MONSTER_MOVE, 64); #if SUPPORTED_CLIENT_BUILD > CLIENT_BUILD_1_8_4 data << unit.GetPackGUID(); @@ -174,13 +174,13 @@ int32 MoveSplineInit::Launch() MovementPacketSender::SendToggleRunWalkToAll(&unit, true); if (moveFlags & MOVEFLAG_WALK_MODE && !(oldMoveFlags & MOVEFLAG_WALK_MODE)) // Switch to walk mode MovementPacketSender::SendToggleRunWalkToAll(&unit, false); - + unit.SendMovementMessageToSet(std::move(data), true); // Restore correct walk mode for players if (unit.GetTypeId() == TYPEID_PLAYER && (moveFlags & MOVEFLAG_WALK_MODE) != (oldMoveFlags & MOVEFLAG_WALK_MODE)) MovementPacketSender::SendToggleRunWalkToAll(&unit, !(oldMoveFlags & MOVEFLAG_WALK_MODE)); - + return move_spline.Duration(); } diff --git a/src/game/Movement/spline/packet_builder.cpp b/src/game/Movement/spline/packet_builder.cpp index b8a691869eb..ea1d368ec7e 100644 --- a/src/game/Movement/spline/packet_builder.cpp +++ b/src/game/Movement/spline/packet_builder.cpp @@ -18,7 +18,7 @@ #include "packet_builder.h" #include "MoveSpline.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "World.h" namespace Movement diff --git a/src/game/Objects/Creature.cpp b/src/game/Objects/Creature.cpp index 901b61b02a6..62bbe3c640c 100644 --- a/src/game/Objects/Creature.cpp +++ b/src/game/Objects/Creature.cpp @@ -21,7 +21,7 @@ #include "Creature.h" #include "Database/DatabaseEnv.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "World.h" #include "ObjectMgr.h" #include "ScriptMgr.h" @@ -241,7 +241,7 @@ void Creature::AddToWorld() if (GetDeathState() == ALIVE || GetDeathState() == JUST_ALIVED) m_creatureGroup->OnRespawn(this); } - + Unit::AddToWorld(); if (!m_AI) @@ -617,7 +617,7 @@ bool Creature::UpdateEntry(uint32 entry, GameEventCreatureData const* eventData SetVisibilityModifier(VISIBILITY_DISTANCE_GIGANTIC); if (sWorld.getConfig(CONFIG_BOOL_VISIBILITY_FORCE_ACTIVE_OBJECTS)) SetActiveObjectState(true); - } + } else if (HasExtraFlag(CREATURE_FLAG_EXTRA_INFINITE_AOI)) { SetVisibilityModifier(MAX_VISIBILITY_DISTANCE); @@ -1894,7 +1894,7 @@ bool Creature::LoadFromDB(uint32 guidlow, Map* map, bool force) if (data->spawn_flags & SPAWN_FLAG_ACTIVE) m_isActiveObject = true; - + if (data->visibility_mod) m_visibilityModifier = data->visibility_mod; @@ -2010,7 +2010,7 @@ void Creature::LoadDefaultEquipment(GameEventCreatureData const* eventData) if (HasStaticFlag(CREATURE_STATIC_FLAG_CAN_WIELD_LOOT)) { GenerateLootForBody(nullptr, nullptr); - + bool hasMainHand = false; bool hasOffHand = false; bool hasRanged = false; @@ -2478,7 +2478,7 @@ void Creature::CallForHelp(float radius) { if (radius <= 0.0f || !GetVictim() || IsPet() || IsCharmed()) return; - + MaNGOS::CallOfHelpCreatureInRangeDo u_do(this, GetVictim(), radius); MaNGOS::CreatureWorker worker(this, u_do); Cell::VisitGridObjects(this, worker, radius); diff --git a/src/game/Objects/GameObject.cpp b/src/game/Objects/GameObject.cpp index 6a4eaf46614..6e5f93dd7ce 100644 --- a/src/game/Objects/GameObject.cpp +++ b/src/game/Objects/GameObject.cpp @@ -27,7 +27,7 @@ #include "Spell.h" #include "Group.h" #include "Opcodes.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "World.h" #include "Database/DatabaseEnv.h" #include "LootMgr.h" @@ -1154,7 +1154,7 @@ bool GameObject::IsVisibleForInState(WorldObject const* pDetector, WorldObject c return false; } } - + } // check distance @@ -1514,7 +1514,7 @@ void GameObject::Use(Unit* user) if (user->GetTypeId() != TYPEID_PLAYER) return; - + if (!user->IsWithinLOSInMap(this, false)) return; @@ -1892,7 +1892,7 @@ void GameObject::Use(Unit* user) if (!sScriptMgr.OnProcessEvent(info->flagdrop.eventID, player, this, true)) GetMap()->ScriptsStart(sEventScripts, info->flagdrop.eventID, player->GetObjectGuid(), GetObjectGuid()); } - + spellId = info->flagdrop.pickupSpell; } break; @@ -2184,7 +2184,7 @@ bool GameObject::PlayerCanUse(Player* pPlayer) { if (pPlayer->IsGameMaster()) return true; - + if (!IsVisible()) return false; @@ -2412,7 +2412,7 @@ void GameObject::GetLosCheckPosition(float& x, float& y, float& z) const z = pos.z; return; } - + GetPosition(x, y, z); z += 1.0f; } diff --git a/src/game/Objects/Item.cpp b/src/game/Objects/Item.cpp index 325e759fdbe..2d538648e57 100644 --- a/src/game/Objects/Item.cpp +++ b/src/game/Objects/Item.cpp @@ -24,7 +24,7 @@ #include "ObjectMgr.h" #include "ObjectGuid.h" #include "Opcodes.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "Database/DatabaseEnv.h" #include "ItemEnchantmentMgr.h" #include "GuildMgr.h" @@ -1024,7 +1024,7 @@ void Item::SetEnchantment(EnchantmentSlot slot, uint32 id, uint32 duration, uint if ((GetEnchantmentId(slot) == id) && (GetEnchantmentDuration(slot) == duration) && (GetEnchantmentCharges(slot) == charges)) return; - + if (slot < MAX_INSPECTED_ENCHANTMENT_SLOT && !casterGuid.IsEmpty()) { if (Player* owner = GetOwner()) @@ -1314,6 +1314,6 @@ void Item::GetLocalizedNameWithSuffix(std::string& name, ItemPrototype const* pr } } } - + } -} \ No newline at end of file +} diff --git a/src/game/Objects/Object.cpp b/src/game/Objects/Object.cpp index 291d4ba1e42..f9f14028c9c 100644 --- a/src/game/Objects/Object.cpp +++ b/src/game/Objects/Object.cpp @@ -21,7 +21,7 @@ #include "Object.h" #include "SharedDefines.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "Opcodes.h" #include "Log.h" #include "World.h" @@ -298,7 +298,7 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData& data, Player* target) c buf << GetGUID(); #endif buf << uint8(m_objectTypeId); - + BuildMovementUpdate(&buf, updateFlags); #if SUPPORTED_CLIENT_BUILD <= CLIENT_BUILD_1_8_4 @@ -566,7 +566,7 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint8 updateFlags) const if (IsCreature()) m.moveFlags = m.moveFlags & ~MOVEFLAG_ROOT; *data << m; - + if (Unit const* unit = ToUnit()) { *data << float(unit->GetSpeed(MOVE_WALK)); @@ -589,7 +589,7 @@ void Object::BuildValuesUpdate(uint8 updatetype, ByteBuffer* data, UpdateMask* u { if (!target) return; - + bool const ShowHealthValues = sWorld.getConfig(CONFIG_BOOL_OBJECT_HEALTH_VALUE_SHOW); bool IsActivateToQuest = false; @@ -827,7 +827,7 @@ void Object::BuildValuesUpdate(uint8 updatetype, ByteBuffer* data, UpdateMask* u continue; } } - *data << m_uint32Values[index]; + *data << m_uint32Values[index]; } else if (index == UNIT_FIELD_TARGET+1) { @@ -1021,7 +1021,7 @@ uint16 Object::GetUpdateFieldFlagsForTarget(Player const* target, uint16 const*& if (plr->IsInSameRaidWith(target)) visibleFlag |= UF_FLAG_GROUP_ONLY; } - + break; } /* @@ -1782,7 +1782,7 @@ bool WorldObject::CanReachWithMeleeSpellAttack(WorldObject const* pVictim, float if (!pVictim || !pVictim->IsInWorld()) return false; - float reach = IsUnit() && pVictim->IsUnit() ? + float reach = IsUnit() && pVictim->IsUnit() ? static_cast(this)->GetCombatReachToTarget(static_cast(pVictim), true, flat_mod) : ATTACK_DISTANCE; // This check is not related to bounding radius @@ -1821,7 +1821,7 @@ float WorldObject::GetLeewayBonusRadius() const { if ((pPlayer->GetXZFlagBasedSpeed() > LEEWAY_MIN_MOVE_SPEED) || pPlayer->m_movementInfo.HasMovementFlag(MOVEFLAG_JUMPING)) return LEEWAY_BONUS_RANGE; - } + } return 0.0f; } @@ -1903,7 +1903,7 @@ bool WorldObject::GetRandomPoint(float x, float y, float z, float distance, floa rand_z = z; return true; } - + Map const* pMap = GetMap(); Unit const* pUnit = ToUnit(); @@ -1940,7 +1940,7 @@ bool WorldObject::GetRandomPoint(float x, float y, float z, float distance, floa } } } - + { // Otherwise, we find a position on the ground, or in water, or in lava (not for players) uint32 moveAllowed = NAV_GROUND | NAV_WATER; @@ -2405,7 +2405,7 @@ Creature* Map::SummonCreature(uint32 entry, float x, float y, float z, float ang // Active state set before added to map pCreature->SetActiveObjectState(asActiveObject); pCreature->Summon(spwtype, despwtime); - + // Creature Linking, Initial load is handled like respawn if (pCreature->IsLinkingEventTrigger()) GetCreatureLinkingHolder()->DoCreatureLinkingEvent(LINKING_EVENT_RESPAWN, pCreature); @@ -3513,7 +3513,7 @@ ReputationRank WorldObject::GetReactionTo(WorldObject const* target) const return REP_FRIENDLY; // always friendly to charmer or owner - if (IsUnit() && target->IsUnit() && + if (IsUnit() && target->IsUnit() && static_cast(this)->GetCharmerOrOwnerOrOwnGuid() == static_cast(target)->GetCharmerOrOwnerOrOwnGuid()) return REP_FRIENDLY; diff --git a/src/game/Objects/Pet.cpp b/src/game/Objects/Pet.cpp index 54b334fbbd6..e6da7d02729 100644 --- a/src/game/Objects/Pet.cpp +++ b/src/game/Objects/Pet.cpp @@ -24,7 +24,7 @@ #include "Database/DatabaseEnv.h" #include "Log.h" #include "Opcodes.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "ObjectMgr.h" #include "SpellMgr.h" #include "Formulas.h" @@ -643,7 +643,7 @@ void Pet::SetDeathState(DeathState s) // overwrite virtual ModifyPower(POWER_HAPPINESS, -HAPPINESS_LEVEL_SIZE); SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); - + // Despawn after 1 hour for hunter pets. if (GetPetType() == HUNTER_PET) m_corpseDecayTimer = 3600000; @@ -1144,7 +1144,7 @@ void Pet::DelayedUnsummon(uint32 timeMSToDespawn, PetSaveMode mode) if (timeMSToDespawn) { UnsummonPetDelayEvent *pEvent = new UnsummonPetDelayEvent(*this, mode); - + m_Events.AddEvent(pEvent, m_Events.CalculateTime(timeMSToDespawn)); return; } @@ -1264,7 +1264,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature) #else SetInt32Value(UNIT_MOD_CAST_SPEED, creature->GetInt32Value(UNIT_MOD_CAST_SPEED)); #endif - + SetLoyaltyLevel(REBELLIOUS); } return true; diff --git a/src/game/Objects/Player.cpp b/src/game/Objects/Player.cpp index a26cd208ac3..e13326e534a 100644 --- a/src/game/Objects/Player.cpp +++ b/src/game/Objects/Player.cpp @@ -31,8 +31,8 @@ #include "Opcodes.h" #include "SpellMgr.h" #include "World.h" -#include "WorldPacket.h" -#include "WorldSession.h" +#include "Server/WorldPacket.h" +#include "Server/WorldSession.h" #include "UpdateMask.h" #include "QuestDef.h" #include "GossipDef.h" @@ -6797,7 +6797,7 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) // on a ffa realm, ffa is toggled together with pvp flag if (sWorld.IsFFAPvPRealm()) SetFFAPvP(IsPvP() && !IsGameMaster() && !HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING)); - + if ((zoneEntry->Flags & AREA_FLAG_CAPITAL) && !pvpInfo.inPvPEnforcedArea) // in capital city SetRestType(REST_TYPE_IN_CITY); else if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) && GetRestType() != REST_TYPE_IN_TAVERN) @@ -9814,7 +9814,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16& dest, ItemPrototype con if (not_loading) { // World of Warcraft Client Patch 1.6.0 (2005-07-12) - // - It will no longer be possible to swap any equipment while stunned. + // - It will no longer be possible to swap any equipment while stunned. // May be here should be more stronger checks; STUNNED checked // ROOT, CONFUSED, DISTRACTED, FLEEING this needs to be checked. #if SUPPORTED_CLIENT_BUILD > CLIENT_BUILD_1_5_1 @@ -13017,7 +13017,7 @@ void Player::AddQuest(Quest const* pQuest, Object* questGiver) GetMap()->ScriptsStart(sQuestStartScripts, pQuest->GetQuestStartScript(), pQuestGiver->GetObjectGuid(), GetObjectGuid()); } - + // remove start item if not need if (questGiver && questGiver->IsType(TYPEMASK_ITEM)) { diff --git a/src/game/Objects/Player.h b/src/game/Objects/Player.h index 5566aaec7ab..8380c95d3ac 100644 --- a/src/game/Objects/Player.h +++ b/src/game/Objects/Player.h @@ -27,7 +27,7 @@ #include "Database/DatabaseEnv.h" #include "GroupReference.h" #include "MapReference.h" -#include "WorldSession.h" +#include "Server/WorldSession.h" #include "Pet.h" #include "Item.h" #include "Util.h" // for Tokens typedef @@ -797,7 +797,7 @@ class Player final: public Unit void SetPvPDeath(bool on) { if (on) m_ExtraFlags |= PLAYER_EXTRA_PVP_DEATH; else m_ExtraFlags &= ~PLAYER_EXTRA_PVP_DEATH; } bool IsGMVisible() const { return !(m_ExtraFlags & PLAYER_EXTRA_GM_INVISIBLE); } void SetGMVisible(bool on, bool notify = false); - + void SetCheatFly(bool on, bool notify = false); void SetCheatFixedZ(bool on, bool notify = false); void SetCheatBeastmaster(bool on, bool notify = false); @@ -1229,7 +1229,7 @@ class Player final: public Unit /*********************************************************/ /*** SAVE SYSTEM ***/ /*********************************************************/ - + private: void _SaveAuras(); void _SaveInventory(); @@ -1293,7 +1293,7 @@ class Player final: public Unit void UnsummonPetTemporaryIfAny(); void ResummonPetTemporaryUnSummonedIfAny(); bool IsPetNeedBeTemporaryUnsummoned() const; - + /*********************************************************/ /*** SPELL SYSTEM ***/ /*********************************************************/ @@ -1812,7 +1812,7 @@ class Player final: public Unit /*** ENVIRONMENTAL SYSTEM ***/ /*********************************************************/ - protected: + protected: uint8 m_environmentFlags = ENVIRONMENT_FLAG_NONE; float m_environmentBreathingMultiplier = 1.0f; MirrorTimer m_mirrorTimers[MirrorTimer::NUM_TIMERS] = { MirrorTimer::FATIGUE, MirrorTimer::BREATH, MirrorTimer::FEIGNDEATH, MirrorTimer::ENVIRONMENTAL }; @@ -1882,7 +1882,7 @@ class Player final: public Unit /*********************************************************/ /*** TAXI SYSTEM ***/ /*********************************************************/ - + private: PlayerTaxi m_taxi; public: @@ -2375,7 +2375,7 @@ class Player final: public Unit public: void SendTransferAborted(uint8 reason) const; void SendInstanceResetWarning(uint32 mapId, uint32 resetTime) const; - + void ResetInstances(InstanceResetMethod method); void ResetPersonalInstanceOnLeaveDungeon(uint32 mapId); void SendResetInstanceSuccess(uint32 MapId) const; diff --git a/src/game/Objects/SpellCaster.cpp b/src/game/Objects/SpellCaster.cpp index 383a01a158a..d42619fb3a9 100644 --- a/src/game/Objects/SpellCaster.cpp +++ b/src/game/Objects/SpellCaster.cpp @@ -24,7 +24,7 @@ #include "Spell.h" #include "SpellAuras.h" #include "World.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "Opcodes.h" Unit* SpellCaster::SelectMagnetTarget(Unit* victim, Spell* spell, SpellEffectIndex eff) @@ -351,7 +351,7 @@ float SpellCaster::MeleeSpellMissChance(Unit const* pVictim, WeaponAttackType at // Bonuses from attacker aura and ratings hitChance += pUnit->GetWeaponBasedAuraModifier(attType, SPELL_AURA_MOD_HIT_CHANCE); - } + } // There is some code in 1.12 that explicitly adds a modifier that causes the first 1% of +hit gained from // talents or gear to be ignored against monsters with more than 10 Defense Skill above the attacking playerÂ’s Weapon Skill. @@ -433,7 +433,7 @@ SpellMissInfo SpellCaster::MeleeSpellHitResult(Unit const* pVictim, SpellEntry c } // Check creatures flags_extra for disable parry if (Creature const* pCreatureVictim = pVictim->ToCreature()) - { + { if (pCreatureVictim->HasExtraFlag(CREATURE_FLAG_EXTRA_NO_PARRY)) canParry = false; if (pCreatureVictim->HasExtraFlag(CREATURE_FLAG_EXTRA_NO_BLOCK)) @@ -567,10 +567,10 @@ int32 SpellCaster::MagicSpellHitChance(Unit const* pVictim, SpellEntry const* sp modOwner->ApplySpellMod(spell->Id, SPELLMOD_RESIST_MISS_CHANCE, modHitChance, spellPtr); } } - + // Chance hit from victim SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE auras modHitChance += pVictim->GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE, schoolMask); - + // Reduce spell hit chance for Area of effect spells from victim SPELL_AURA_MOD_AOE_AVOIDANCE aura if (spell->IsAreaOfEffectSpell()) { @@ -583,14 +583,14 @@ int32 SpellCaster::MagicSpellHitChance(Unit const* pVictim, SpellEntry const* sp resist_mech = pVictim->GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_MECHANIC_RESISTANCE, spell->Mechanic); // Apply mod modHitChance -= resist_mech; - + // Chance resist debuff modHitChance -= pVictim->GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_DEBUFF_RESISTANCE, int32(spell->Dispel)); - + // Increase hit chance from attacker SPELL_AURA_MOD_SPELL_HIT_CHANCE and attacker ratings if (Unit* pUnit = ToUnit()) modHitChance += int32(pUnit->m_modSpellHitChance); - + // Nostalrius: sorts binaires. if (spell->IsBinary()) { @@ -708,7 +708,7 @@ uint32 SpellCaster::SpellCriticalDamageBonus(SpellEntry const* spellProto, uint3 if (Player* modOwner = pUnit->GetSpellModOwner()) modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_CRIT_DAMAGE_BONUS, crit_bonus, spell); } - + if (!pVictim) return damage += crit_bonus; @@ -1258,7 +1258,7 @@ float SpellCaster::SpellHealingBonusDone(Unit const* pVictim, SpellEntry const* if (Player* modOwner = pUnit->GetSpellModOwner()) modOwner->ApplySpellMod(spellProto->Id, damagetype == DOT ? SPELLMOD_DOT : SPELLMOD_DAMAGE, heal, spell); } - + return heal < 0 ? 0 : heal; } @@ -1286,7 +1286,7 @@ float SpellCaster:: SpellBaseHealingBonusDone(SpellSchoolMask schoolMask) } } } - + return AdvertisedBenefit; } @@ -1467,7 +1467,7 @@ int32 SpellCaster::SpellBaseDamageBonusDone(SpellSchoolMask schoolMask) } } } - + return DoneAdvertisedBenefit; } diff --git a/src/game/Objects/Unit.cpp b/src/game/Objects/Unit.cpp index 07ec6aa25a4..01fcfce2112 100644 --- a/src/game/Objects/Unit.cpp +++ b/src/game/Objects/Unit.cpp @@ -25,8 +25,8 @@ #include "Player.h" #include "Log.h" #include "Opcodes.h" -#include "WorldPacket.h" -#include "WorldSession.h" +#include "Server/WorldPacket.h" +#include "Server/WorldSession.h" #include "World.h" #include "ObjectMgr.h" #include "ObjectGuid.h" @@ -655,7 +655,7 @@ uint32 Unit::DealDamage(Unit* pVictim, uint32 damage, CleanDamage const* cleanDa if (damagetype != SELF_DAMAGE) #endif RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); - + // feign death does not break from environmental damage, tested on classic if (damagetype != SELF_DAMAGE) RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH); @@ -890,7 +890,7 @@ uint32 Unit::DealDamage(Unit* pVictim, uint32 damage, CleanDamage const* cleanDa // skip channeled spell (processed differently below) if (i == CURRENT_CHANNELED_SPELL) continue; - + if (Spell* spell = pVictim->GetCurrentSpell(CurrentSpellTypes(i))) { if (spell->getState() == SPELL_STATE_PREPARING) diff --git a/src/game/Objects/UpdateData.cpp b/src/game/Objects/UpdateData.cpp index e4dc2f28813..c47fb62cc0a 100644 --- a/src/game/Objects/UpdateData.cpp +++ b/src/game/Objects/UpdateData.cpp @@ -22,7 +22,7 @@ #include "Common.h" #include "UpdateData.h" #include "ByteBuffer.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "Log.h" #include "Opcodes.h" #include "World.h" diff --git a/src/game/OutdoorPvP/OutdoorPvPEP.cpp b/src/game/OutdoorPvP/OutdoorPvPEP.cpp index 59b299e1d93..39fd33315d8 100644 --- a/src/game/OutdoorPvP/OutdoorPvPEP.cpp +++ b/src/game/OutdoorPvP/OutdoorPvPEP.cpp @@ -16,7 +16,7 @@ */ #include "OutdoorPvP/OutdoorPvPEP.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "Player.h" #include "GameObject.h" #include "ObjectMgr.h" @@ -246,11 +246,11 @@ void OPvPCapturePointEP_EWT::SummonSquadAtEastWallTower(uint32 team) ct = EP_EWT_Summons_A; else ct = EP_EWT_Summons_H; - + for (uint8 i = 0; i < EP_SummonsNum; ++i) { DelCreature(i); - + bool asActiveObject = false; switch (ct[i].entry) { @@ -260,9 +260,9 @@ void OPvPCapturePointEP_EWT::SummonSquadAtEastWallTower(uint32 team) case NPC_LORDAERON_FIGHTER: asActiveObject = true; } - + AddCreature(i, ct[i].entry, ct[i].teamval, ct[i].map, ct[i].x, ct[i].y, ct[i].z, ct[i].o, 0, asActiveObject); - + if (ct[i].entry == NPC_LORDAERON_SOLDIER || ct[i].entry == NPC_LORDAERON_FIGHTER) { if (Creature* pCreature = m_PvP->GetCreature(m_Creatures[i])) @@ -724,7 +724,7 @@ void OPvPCapturePointEP_CGT::SummonSpiritOfVictory(uint32 team) { DelCreature(CROWN_GUARD_TOWER_SPIRITOFVICTORY); // The only Creature to delete here. AddCreature(CROWN_GUARD_TOWER_SPIRITOFVICTORY, EP_CGT_SpiritOfVictory.entry, team, EP_CGT_SpiritOfVictory.map, EP_CGT_SpiritOfVictory.x, EP_CGT_SpiritOfVictory.y, EP_CGT_SpiritOfVictory.z, EP_CGT_SpiritOfVictory.o, 0, true); - + if (Creature* pCreature = m_PvP->GetCreature(m_Creatures[CROWN_GUARD_TOWER_SPIRITOFVICTORY])) { pCreature->RemoveAllAuras(); @@ -941,7 +941,7 @@ void OPvPCapturePointEP_PWT::HandlePlayerLeave(Player* pPlayer) void OPvPCapturePointEP_PWT::SummonFlightMaster(uint32 team) { AddCreature(PLAGUEWOOD_TOWER_FLIGHTMASTER, EP_PWT_FlightMaster.entry, team, EP_PWT_FlightMaster.map, EP_PWT_FlightMaster.x, EP_PWT_FlightMaster.y, EP_PWT_FlightMaster.z, EP_PWT_FlightMaster.o); - + if (Creature* pCreature = m_PvP->GetCreature(m_Creatures[PLAGUEWOOD_TOWER_FLIGHTMASTER])) { pCreature->SetFactionTemplateId(team == ALLIANCE ? 774 : 775); diff --git a/src/game/OutdoorPvP/OutdoorPvPSI.cpp b/src/game/OutdoorPvP/OutdoorPvPSI.cpp index 6f2f66e5565..1b9c8c2ef18 100644 --- a/src/game/OutdoorPvP/OutdoorPvPSI.cpp +++ b/src/game/OutdoorPvP/OutdoorPvPSI.cpp @@ -16,7 +16,7 @@ */ #include "OutdoorPvP/OutdoorPvPSI.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "Player.h" #include "ObjectMgr.h" #include "ZoneScriptMgr.h" diff --git a/src/game/PacketBroadcast/PlayerBroadcaster.cpp b/src/game/PacketBroadcast/PlayerBroadcaster.cpp index f5a8cda1b96..f1c5dbde854 100644 --- a/src/game/PacketBroadcast/PlayerBroadcaster.cpp +++ b/src/game/PacketBroadcast/PlayerBroadcaster.cpp @@ -1,8 +1,8 @@ #include "PlayerBroadcaster.h" #include "MovementBroadcaster.h" -#include "WorldPacket.h" -#include "WorldSocket.h" +#include "Server/WorldPacket.h" +#include "Server/WorldSocket.h" #include "Player.h" uint32 PlayerBroadcaster::num_bcaster_created = 0; diff --git a/src/game/PacketBroadcast/PlayerBroadcaster.h b/src/game/PacketBroadcast/PlayerBroadcaster.h index 93ae06a3d51..90b4b3c0a8d 100644 --- a/src/game/PacketBroadcast/PlayerBroadcaster.h +++ b/src/game/PacketBroadcast/PlayerBroadcaster.h @@ -2,7 +2,7 @@ #define MANGOS_PLAYER_BROADCASTER_H #include "ObjectGuid.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "Opcodes.h" #include #include diff --git a/src/game/PlayerBots/BattleBotAI.cpp b/src/game/PlayerBots/BattleBotAI.cpp index 997bcec0aee..b936cb1d85f 100644 --- a/src/game/PlayerBots/BattleBotAI.cpp +++ b/src/game/PlayerBots/BattleBotAI.cpp @@ -25,7 +25,7 @@ #include "ObjectMgr.h" #include "PlayerBotMgr.h" #include "Opcodes.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "World.h" #include "Spell.h" #include "SpellAuras.h" @@ -233,7 +233,7 @@ float BattleBotAI::GetMaxAggroDistanceForMap() const BattleGround* bg = me->GetBattleGround(); if (!bg || bg->GetTypeID() != BATTLEGROUND_AV) return 50.0f; - + return 30.0f; } @@ -534,7 +534,7 @@ void BattleBotAI::UpdateWaypointMovement() return; if (StartNewPathToObjective()) - return; + return; if (StartNewPathFromBeginning()) return; @@ -772,7 +772,7 @@ void BattleBotAI::UpdateAI(uint32 const diff) } } } - + if (me->IsDead()) { if (!m_wasDead) @@ -781,7 +781,7 @@ void BattleBotAI::UpdateAI(uint32 const diff) OnJustDied(); return; } - + if (me->InBattleGround()) { if (me->GetDeathState() == CORPSE) @@ -799,7 +799,7 @@ void BattleBotAI::UpdateAI(uint32 const diff) //me->SendCreateUpdateToPlayer(pLeader); } } - + return; } else @@ -838,7 +838,7 @@ void BattleBotAI::UpdateAI(uint32 const diff) me->ClearTarget(); Unit* pVictim = me->GetVictim(); - + // Prevent battelbot from chasing target entered stealth mode if (pVictim && !pVictim->IsVisibleForOrDetect(me, me, false)) { @@ -910,7 +910,7 @@ void BattleBotAI::UpdateAI(uint32 const diff) if (UseMount()) return; - + UpdateWaypointMovement(); } return; @@ -923,7 +923,7 @@ void BattleBotAI::UpdateAI(uint32 const diff) return; } - if (!pVictim || !IsValidHostileTarget(pVictim) || + if (!pVictim || !IsValidHostileTarget(pVictim) || !pVictim->IsWithinDist(me, VISIBILITY_DISTANCE_SMALL)) { if (Unit* pNewVictim = SelectAttackTarget(pVictim)) @@ -1299,7 +1299,7 @@ void BattleBotAI::UpdateOutOfCombatAI_Paladin() m_isBuffing = true; return; } - } + } } } @@ -1333,7 +1333,7 @@ void BattleBotAI::UpdateInCombatAI_Paladin() { me->CastSpell(me, m_spells.paladin.pSeal, false); } - + if (Unit* pVictim = me->GetVictim()) { if (hasSeal && m_spells.paladin.pJudgement && @@ -1550,7 +1550,7 @@ void BattleBotAI::UpdateInCombatAI_Shaman() if (DoCastSpell(pVictim, m_spells.shaman.pFlameShock) == SPELL_CAST_OK) return; } - + if (m_spells.shaman.pLightningBolt && !me->CanReachWithMeleeAutoAttack(pVictim) && CanTryToCastSpell(pVictim, m_spells.shaman.pLightningBolt)) @@ -1920,7 +1920,7 @@ void BattleBotAI::UpdateInCombatAI_Mage() { if (DoCastSpell(me, m_spells.mage.pPresenceOfMind) == SPELL_CAST_OK) return; - } + } if (m_spells.mage.pScorch && (pVictim->GetHealthPercent() < 20.0f) && @@ -3163,7 +3163,7 @@ void BattleBotAI::UpdateInCombatAI_Druid() me->HasAuraType(SPELL_AURA_MOD_SHAPESHIFT)) me->RemoveSpellsCausingAura(SPELL_AURA_MOD_SHAPESHIFT); } - + if (Unit* pVictim = me->GetVictim()) { ShapeshiftForm const form = me->GetShapeshiftForm(); @@ -3267,7 +3267,7 @@ void BattleBotAI::UpdateInCombatAI_Druid() if (DoCastSpell(pVictim, m_spells.druid.pClaw) == SPELL_CAST_OK) return; } - + break; } case FORM_BEAR: diff --git a/src/game/PlayerBots/BattleBotWaypoints.cpp b/src/game/PlayerBots/BattleBotWaypoints.cpp index c8b3e68937a..086167b11c7 100644 --- a/src/game/PlayerBots/BattleBotWaypoints.cpp +++ b/src/game/PlayerBots/BattleBotWaypoints.cpp @@ -16,7 +16,7 @@ #include "BattleBotAI.h" #include "BattleBotWaypoints.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "Opcodes.h" #include "Player.h" #include "GameObject.h" @@ -104,7 +104,7 @@ void WSG_AtAllianceFlag(BattleBotAI* pAI) } } } - + pAI->MoveToNextPoint(); } @@ -206,7 +206,7 @@ void AtFlag(BattleBotAI* pAI, std::vector const& vFlagIds) } } } - + pAI->MoveToNextPoint(); } @@ -1750,7 +1750,7 @@ std::vector const vPaths_NoReverseAllowed = void BattleBotAI::MovementInform(uint32 movementType, uint32 data) { if (movementType == POINT_MOTION_TYPE) - { + { if (m_currentPath && m_currentPath->at(data).pFunc) (*m_currentPath->at(data).pFunc)(this); else @@ -1926,7 +1926,7 @@ bool BattleBotAI::StartNewPathToPosition(Position const& targetPosition, std::ve } } } - + if (std::find(vPaths_NoReverseAllowed.begin(), vPaths_NoReverseAllowed.end(), pPath) != vPaths_NoReverseAllowed.end()) continue; @@ -1963,7 +1963,7 @@ bool BattleBotAI::StartNewPathToPosition(Position const& targetPosition, std::ve { if (closestPoint == 0) return false; - + } else { @@ -2054,7 +2054,7 @@ bool BattleBotAI::StartNewPathToObjective() { if (GameObject* pGO = me->GetMap()->GetGameObject(bg->GetSingleGameObjectGuid(BG_AV_SNOWFALL_GY, NEUTRAL_CONTROLLED))) if (me->IsWithinDist(pGO, VISIBILITY_DISTANCE_LARGE)) - return StartNewPathToPosition(pGO->GetPosition(), vPaths_AV); + return StartNewPathToPosition(pGO->GetPosition(), vPaths_AV); } if (!bg->IsActiveEvent(BG_AV_NodeEventCaptainDead_A, 0)) @@ -2102,7 +2102,7 @@ bool BattleBotAI::StartNewPathToObjective() if (me->IsWithinDist(pGO, VISIBILITY_DISTANCE_LARGE)) return StartNewPathToPosition(pGO->GetPosition(), vPaths_AV); } - + // Chance to defend. if (roll_chance_u(25)) { diff --git a/src/game/PlayerBots/CombatBotBaseAI.cpp b/src/game/PlayerBots/CombatBotBaseAI.cpp index 7e7607697a0..8426e08e945 100644 --- a/src/game/PlayerBots/CombatBotBaseAI.cpp +++ b/src/game/PlayerBots/CombatBotBaseAI.cpp @@ -5,7 +5,7 @@ #include "Group.h" #include "PlayerBotMgr.h" #include "Opcodes.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "Spell.h" #include "SpellAuras.h" #include "Chat.h" @@ -1797,7 +1797,7 @@ void CombatBotBaseAI::PopulateSpellData() } return pHighestRank; }; - + SpellEntry const* pPoisonSpell = nullptr; std::vector vPoisons; if (hasDeadlyPoison && (pPoisonSpell = GetHighestRankOfPoisonByName("Deadly Poison", me->GetLevel()))) @@ -2225,7 +2225,7 @@ bool CombatBotBaseAI::IsValidBuffTarget(Unit const* pTarget, SpellEntry const* p if (it == i.first) return false; } - + return true; } @@ -2647,7 +2647,7 @@ void CombatBotBaseAI::EquipRandomGearInEmptySlots() for (auto& itr : itemsPerSlot) { bool hasPrimaryStatItem = false; - + for (auto const& pItem : itr.second) { for (auto const& stat : pItem->ItemStat) @@ -2891,8 +2891,8 @@ void CombatBotBaseAI::AddHunterAmmo() AddItemToInventory(pAmmoProto->ItemId, pAmmoProto->GetMaxStackSize()); me->SetAmmo(pAmmoProto->ItemId); } - } - } + } + } } } diff --git a/src/game/PlayerBots/PartyBotAI.cpp b/src/game/PlayerBots/PartyBotAI.cpp index 465215183bc..6bea2147422 100644 --- a/src/game/PlayerBots/PartyBotAI.cpp +++ b/src/game/PlayerBots/PartyBotAI.cpp @@ -22,7 +22,7 @@ #include "PlayerBotMgr.h" #include "Opcodes.h" #include "World.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "Spell.h" #include "SpellAuras.h" #include "Chat.h" @@ -98,7 +98,7 @@ void PartyBotAI::CloneFromPlayer(Player const* pPlayer) { me->SatisfyItemRequirements(pItem->GetProto()); me->StoreNewItemInBestSlots(pItem->GetEntry(), 1, pItem->GetEnchantmentId(EnchantmentSlot(0))); - } + } } } @@ -137,7 +137,7 @@ bool PartyBotAI::IsValidDistancingTarget(Unit* pTarget, Unit* pEnemy) pTarget->GetDistance(pEnemy) >= 15.0f) return true; } - + return false; } @@ -299,7 +299,7 @@ bool PartyBotAI::CanTryToCastSpell(Unit const* pTarget, SpellEntry const* pSpell { float const myThreat = pEnemy->GetThreatManager().getThreat(me); float const victimThreat = pEnemy->GetThreatManager().getThreat(pEnemy->GetVictim()); - + if (victimThreat < (myThreat + me->GetMaxHealth())) return false; } @@ -543,7 +543,7 @@ void PartyBotAI::AddToPlayerGroup() me->RemoveFromGroup(); group->AddMember(me->GetObjectGuid(), me->GetName()); - } + } } void PartyBotAI::OnPacketReceived(WorldPacket const* packet) @@ -678,7 +678,7 @@ void PartyBotAI::UpdateAI(uint32 const diff) m_receivedBgInvite = false; return; } - + // Remain idle until we can join battleground. return; } @@ -720,7 +720,7 @@ void PartyBotAI::UpdateAI(uint32 const diff) me->CastSpell(me, PB_SPELL_HONORLESS_TARGET, true); } } - + return; } @@ -848,7 +848,7 @@ void PartyBotAI::UpdateAI(uint32 const diff) me->CastSpell(me, (*auraList.begin())->GetId(), true); me->SetCheatOption(PLAYER_CHEAT_NO_CAST_TIME, oldStateCastTime); me->SetCheatOption(PLAYER_CHEAT_NO_POWER, oldStatePower); - } + } } } else if (me->IsMounted()) @@ -1030,7 +1030,7 @@ void PartyBotAI::UpdateOutOfCombatAI_Paladin() me->ClearTarget(); return; } - } + } } } @@ -1233,7 +1233,7 @@ void PartyBotAI::UpdateInCombatAI_Paladin() if (DoCastSpell(me, m_spells.paladin.pBlessingOfFreedom) == SPELL_CAST_OK) return; } - + if (GetRole() != ROLE_HEALER && me->GetHealthPercent() < 30.0f) HealInjuredTarget(me); @@ -1788,7 +1788,7 @@ void PartyBotAI::UpdateInCombatAI_Mage() { if (DoCastSpell(me, m_spells.mage.pPresenceOfMind) == SPELL_CAST_OK) return; - } + } if (m_spells.mage.pScorch && (pVictim->GetHealthPercent() < 20.0f) && @@ -2796,7 +2796,7 @@ void PartyBotAI::UpdateInCombatAI_Rogue() if (m_spells.rogue.pRupture) vSpells.push_back(m_spells.rogue.pRupture); } - + if (!vSpells.empty()) { SpellEntry const* pComboSpell = SelectRandomContainerElement(vSpells); @@ -3045,7 +3045,7 @@ void PartyBotAI::UpdateInCombatAI_Druid() if (DoCastSpell(me, m_spells.druid.pBarkskin) == SPELL_CAST_OK) return; } - + if (form == FORM_NONE) { if (m_spells.druid.pHibernate && @@ -3118,7 +3118,7 @@ void PartyBotAI::UpdateInCombatAI_Druid() Unit* pVictim = me->GetVictim(); if (!pVictim) return; - + if (form != FORM_NONE && me->HasUnitState(UNIT_STATE_ROOT) && me->HasAuraType(SPELL_AURA_MOD_SHAPESHIFT) && @@ -3127,7 +3127,7 @@ void PartyBotAI::UpdateInCombatAI_Druid() if (GetRole() == ROLE_HEALER) return; - + switch (form) { case FORM_CAT: @@ -3230,7 +3230,7 @@ void PartyBotAI::UpdateInCombatAI_Druid() if (DoCastSpell(pVictim, m_spells.druid.pClaw) == SPELL_CAST_OK) return; } - + break; } case FORM_BEAR: diff --git a/src/game/PlayerBots/PlayerBotAI.cpp b/src/game/PlayerBots/PlayerBotAI.cpp index ec535488dd9..a72123661cf 100644 --- a/src/game/PlayerBots/PlayerBotAI.cpp +++ b/src/game/PlayerBots/PlayerBotAI.cpp @@ -24,7 +24,7 @@ #include "MapManager.h" #include "MoveSpline.h" #include "Opcodes.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" bool PlayerBotAI::OnSessionLoaded(PlayerBotEntry* entry, WorldSession* sess) { diff --git a/src/game/PlayerBots/PlayerBotAI.h b/src/game/PlayerBots/PlayerBotAI.h index ffe73b702fd..713c23dbeeb 100644 --- a/src/game/PlayerBots/PlayerBotAI.h +++ b/src/game/PlayerBots/PlayerBotAI.h @@ -18,7 +18,7 @@ #define MANGOS_PLAYERBOTAI_H #include "PlayerAI.h" -#include "WorldSession.h" +#include "Server/WorldSession.h" struct PlayerBotEntry; class WorldSession; diff --git a/src/game/PlayerBots/PlayerBotMgr.cpp b/src/game/PlayerBots/PlayerBotMgr.cpp index a8895ff61ea..755d410b8c7 100644 --- a/src/game/PlayerBots/PlayerBotMgr.cpp +++ b/src/game/PlayerBots/PlayerBotMgr.cpp @@ -3,7 +3,7 @@ #include "PlayerBotMgr.h" #include "ObjectMgr.h" #include "World.h" -#include "WorldSession.h" +#include "Server/WorldSession.h" #include "AccountMgr.h" #include "Config/Config.h" #include "Chat.h" @@ -1895,10 +1895,10 @@ bool ChatHandler::HandleBattleBotAddCommand(char* args, uint8 bg) return false; } - + ExtractUInt32(&args, botLevel); - + if (char* tempStr = ExtractArg(&args)) { if (strcmp(tempStr, "temp") == 0) diff --git a/src/game/ReputationMgr.cpp b/src/game/ReputationMgr.cpp index 105268fb717..c8dc6b02cab 100644 --- a/src/game/ReputationMgr.cpp +++ b/src/game/ReputationMgr.cpp @@ -22,7 +22,7 @@ #include "ReputationMgr.h" #include "Player.h" #include "Opcodes.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "ObjectMgr.h" #include diff --git a/src/game/Protocol/Opcodes.cpp b/src/game/Server/Protocol/Opcodes.cpp similarity index 100% rename from src/game/Protocol/Opcodes.cpp rename to src/game/Server/Protocol/Opcodes.cpp diff --git a/src/game/Protocol/Opcodes.h b/src/game/Server/Protocol/Opcodes.h similarity index 99% rename from src/game/Protocol/Opcodes.h rename to src/game/Server/Protocol/Opcodes.h index 124fce72ff5..c18407fcbd1 100644 --- a/src/game/Protocol/Opcodes.h +++ b/src/game/Server/Protocol/Opcodes.h @@ -32,7 +32,7 @@ // if this class definition not complite then VS for x64 release use different size for // struct OpcodeHandler in this header and Opcode.cpp and get totally wrong data from // table opcodeTable in source when Opcode.h included but WorldSession.h not included -#include "WorldSession.h" +#include "../WorldSession.h" // List of Opcodes #if SUPPORTED_CLIENT_BUILD > CLIENT_BUILD_1_11_2 diff --git a/src/game/Protocol/Opcodes_1_10_2.h b/src/game/Server/Protocol/Opcodes_1_10_2.h similarity index 100% rename from src/game/Protocol/Opcodes_1_10_2.h rename to src/game/Server/Protocol/Opcodes_1_10_2.h diff --git a/src/game/Protocol/Opcodes_1_11_2.h b/src/game/Server/Protocol/Opcodes_1_11_2.h similarity index 100% rename from src/game/Protocol/Opcodes_1_11_2.h rename to src/game/Server/Protocol/Opcodes_1_11_2.h diff --git a/src/game/Protocol/Opcodes_1_12_1.h b/src/game/Server/Protocol/Opcodes_1_12_1.h similarity index 100% rename from src/game/Protocol/Opcodes_1_12_1.h rename to src/game/Server/Protocol/Opcodes_1_12_1.h diff --git a/src/game/Protocol/Opcodes_1_5_1.h b/src/game/Server/Protocol/Opcodes_1_5_1.h similarity index 100% rename from src/game/Protocol/Opcodes_1_5_1.h rename to src/game/Server/Protocol/Opcodes_1_5_1.h diff --git a/src/game/Protocol/Opcodes_1_6_1.h b/src/game/Server/Protocol/Opcodes_1_6_1.h similarity index 100% rename from src/game/Protocol/Opcodes_1_6_1.h rename to src/game/Server/Protocol/Opcodes_1_6_1.h diff --git a/src/game/Protocol/Opcodes_1_7_1.h b/src/game/Server/Protocol/Opcodes_1_7_1.h similarity index 100% rename from src/game/Protocol/Opcodes_1_7_1.h rename to src/game/Server/Protocol/Opcodes_1_7_1.h diff --git a/src/game/Protocol/Opcodes_1_8_4.h b/src/game/Server/Protocol/Opcodes_1_8_4.h similarity index 100% rename from src/game/Protocol/Opcodes_1_8_4.h rename to src/game/Server/Protocol/Opcodes_1_8_4.h diff --git a/src/game/Protocol/Opcodes_1_9_4.h b/src/game/Server/Protocol/Opcodes_1_9_4.h similarity index 100% rename from src/game/Protocol/Opcodes_1_9_4.h rename to src/game/Server/Protocol/Opcodes_1_9_4.h diff --git a/src/shared/WorldPacket.h b/src/game/Server/WorldPacket.h similarity index 100% rename from src/shared/WorldPacket.h rename to src/game/Server/WorldPacket.h diff --git a/src/game/WorldSession.cpp b/src/game/Server/WorldSession.cpp similarity index 99% rename from src/game/WorldSession.cpp rename to src/game/Server/WorldSession.cpp index 78f173e9df5..28b7949ea73 100644 --- a/src/game/WorldSession.cpp +++ b/src/game/Server/WorldSession.cpp @@ -19,10 +19,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/** \file - \ingroup u2w -*/ - #include "WorldSocket.h" #include "Common.h" #include "Database/DatabaseEnv.h" @@ -31,18 +27,18 @@ #include "WorldPacket.h" #include "WorldSession.h" #include "Player.h" -#include "ObjectMgr.h" +#include "../ObjectMgr.h" #include "Group.h" #include "Guild.h" #include "GuildMgr.h" -#include "World.h" +#include "../World.h" #include "BattleGroundMgr.h" #include "MapManager.h" -#include "SocialMgr.h" +#include "../SocialMgr.h" #include "PlayerBotMgr.h" #include "PlayerBotAI.h" #include "Anticheat.h" -#include "Language.h" +#include "../Language.h" #include "Chat.h" #include "MasterPlayer.h" #include "Crypto/Hash/MD5.h" @@ -203,7 +199,7 @@ void WorldSession::SendMovementPacket(WorldPacket const* packet) SendPacketImpl(packet); return; } - + std::lock_guard guard(m_movementPacketCompressorMutex); if (m_movementPacketCompressor.CanAddPacket(*packet)) m_movementPacketCompressor.AddPacket(*packet); @@ -457,7 +453,7 @@ bool WorldSession::Update(PacketFilter& updater) m_movePacketsSentThisInterval = 0; } #endif - + if (sWorld.getConfig(CONFIG_BOOL_LIMIT_PLAY_TIME) && GetPlayer() && GetPlayer()->IsInWorld()) CheckPlayedTimeLimit(currTime); @@ -671,7 +667,7 @@ void WorldSession::LogoutPlayer(bool Save) _player->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_LEAVE_WORLD_CANCELS); } - + if (_player->IsInLFG()) sWorld.GetLFGQueue().GetMessager().AddMessage([playerGuid = _player->GetObjectGuid()](LFGQueue* queue) @@ -1229,7 +1225,7 @@ void WorldSession::ProcessAnticheatAction(char const* detector, char const* reas sWorld.SendGMText(LANG_GM_ANNOUNCE_COLOR, detector, oss.str().c_str()); } - + sLog.Player(this, LOG_ANTICHEAT, detector, LOG_LVL_MINIMAL, "[%s] Player %s, Cheat %s, Penalty: %s", detector, playerDesc.c_str(), reason, action); } diff --git a/src/game/WorldSession.h b/src/game/Server/WorldSession.h similarity index 99% rename from src/game/WorldSession.h rename to src/game/Server/WorldSession.h index 0dad3ee09cb..81f7519c905 100644 --- a/src/game/WorldSession.h +++ b/src/game/Server/WorldSession.h @@ -23,17 +23,17 @@ #define __WORLDSESSION_H #include "Common.h" -#include "SharedDefines.h" -#include "ObjectGuid.h" +#include "../SharedDefines.h" +#include "../ObjectGuid.h" #include "AuctionHouseMgr.h" #include "ItemDefines.h" -#include "GossipDef.h" -#include "Chat/AbstractPlayer.h" -#include "SniffFile.h" -#include "ClientDefines.h" +#include "../GossipDef.h" +#include "../Chat/AbstractPlayer.h" +#include "../SniffFile.h" +#include "../ClientDefines.h" #include "Crypto/BigNumber.h" -#include "AccountData.h" -#include "PacketProcessing.h" +#include "../AccountData.h" +#include "../PacketProcessing.h" #include "UpdateData.h" #include "LockedQueue.h" @@ -368,7 +368,7 @@ class WorldSession bool CheckMailBox(ObjectGuid guid); void SendMailResult(uint32 mailId, MailResponseType mailAction, MailResponseResult mailError, uint32 equipError = 0, uint32 item_guid = 0, uint32 item_count = 0); void SendNewMail(); - + // Trade void SendTradeStatus(TradeStatus status); void SendUpdateTrade(bool trader_state = true); @@ -770,7 +770,7 @@ class WorldSession void HandleAreaSpiritHealerQueryOpcode(WorldPacket& recv_data); void HandleAreaSpiritHealerQueueOpcode(WorldPacket& recv_data); void HandleSelfResOpcode(WorldPacket& recv_data); - + private: // private trade method void MoveItems(Item* myItems[], Item* hisItems[]); @@ -840,7 +840,7 @@ class WorldSession uint32 m_movePacketsSentThisInterval = 0; time_t m_movePacketTrackingIntervalStart = 0; #endif - + // Clustering system (TODO remove this) public: MasterPlayer* GetMasterPlayer() const { return m_masterPlayer; } diff --git a/src/game/Protocol/WorldSocket.cpp b/src/game/Server/WorldSocket.cpp similarity index 99% rename from src/game/Protocol/WorldSocket.cpp rename to src/game/Server/WorldSocket.cpp index dfc5e46ec8c..c3c74b838d4 100644 --- a/src/game/Protocol/WorldSocket.cpp +++ b/src/game/Server/WorldSocket.cpp @@ -29,7 +29,7 @@ #include "AccountMgr.h" #include "SharedDefines.h" #include "AddonHandler.h" -#include "Opcodes.h" +#include "../Protocol/Opcodes.h" #include "Crypto/Hash/SHA1.h" #include "Database/SqlPreparedStatement.h" #include "Database/DatabaseEnv.h" diff --git a/src/game/Protocol/WorldSocket.h b/src/game/Server/WorldSocket.h similarity index 100% rename from src/game/Protocol/WorldSocket.h rename to src/game/Server/WorldSocket.h diff --git a/src/game/Protocol/WorldSocketMgr.cpp b/src/game/Server/WorldSocketMgr.cpp similarity index 98% rename from src/game/Protocol/WorldSocketMgr.cpp rename to src/game/Server/WorldSocketMgr.cpp index 46c728f2dae..3f49b768dbc 100644 --- a/src/game/Protocol/WorldSocketMgr.cpp +++ b/src/game/Server/WorldSocketMgr.cpp @@ -20,14 +20,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/** \file WorldSocketMgr.cpp -* \ingroup u2w -* \author Derex -*/ - #include "WorldSocket.h" #include "WorldSocketMgr.h" -#include "WorldSocket.h" #include "Log.h" #include "Policies/SingletonImp.h" #include "IO/Networking/AsyncSocketAcceptor.h" diff --git a/src/game/Protocol/WorldSocketMgr.h b/src/game/Server/WorldSocketMgr.h similarity index 100% rename from src/game/Protocol/WorldSocketMgr.h rename to src/game/Server/WorldSocketMgr.h diff --git a/src/game/SniffFile.h b/src/game/SniffFile.h index 41a122457a6..0eed24f3fd2 100644 --- a/src/game/SniffFile.h +++ b/src/game/SniffFile.h @@ -18,7 +18,7 @@ #define _SNIFF_FILE_H #include "Common.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "Timer.h" struct LoggedPacket diff --git a/src/game/SocialMgr.cpp b/src/game/SocialMgr.cpp index 7540e76be60..68740e166b4 100644 --- a/src/game/SocialMgr.cpp +++ b/src/game/SocialMgr.cpp @@ -23,7 +23,7 @@ #include "Policies/SingletonImp.h" #include "Database/DatabaseEnv.h" #include "Opcodes.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "MasterPlayer.h" #include "ObjectAccessor.h" #include "ObjectMgr.h" diff --git a/src/game/Spells/Spell.cpp b/src/game/Spells/Spell.cpp index fa4138f67e5..6c5fbcd40dc 100644 --- a/src/game/Spells/Spell.cpp +++ b/src/game/Spells/Spell.cpp @@ -22,8 +22,8 @@ #include "Spell.h" #include "Log.h" #include "Opcodes.h" -#include "WorldPacket.h" -#include "WorldSession.h" +#include "Server/WorldPacket.h" +#include "Server/WorldSession.h" #include "World.h" #include "GridNotifiers.h" #include "GridNotifiersImpl.h" diff --git a/src/game/Spells/SpellAuras.cpp b/src/game/Spells/SpellAuras.cpp index 480a8489abe..99e236c1c1a 100644 --- a/src/game/Spells/SpellAuras.cpp +++ b/src/game/Spells/SpellAuras.cpp @@ -20,8 +20,8 @@ */ #include "Common.h" -#include "WorldPacket.h" -#include "WorldSession.h" +#include "Server/WorldPacket.h" +#include "Server/WorldSession.h" #include "Opcodes.h" #include "Log.h" #include "World.h" diff --git a/src/game/Spells/SpellEffects.cpp b/src/game/Spells/SpellEffects.cpp index 4937cf02cf7..0a9ef985666 100644 --- a/src/game/Spells/SpellEffects.cpp +++ b/src/game/Spells/SpellEffects.cpp @@ -21,7 +21,7 @@ #include "Common.h" #include "SharedDefines.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "Opcodes.h" #include "Log.h" #include "World.h" @@ -353,7 +353,7 @@ void Spell::EffectDummy(SpellEffectIndex effIdx) { if (!m_casterUnit) return; - + Unit* pCaster = m_casterUnit; uint32 spellId = PickRandomValue(9002, 9003, 9004); pCaster->m_Events.AddLambdaEventAtOffset([pCaster, spellId] @@ -631,7 +631,7 @@ void Spell::EffectDummy(SpellEffectIndex effIdx) { if (!unitTarget) return; - + switch (unitTarget->GetEntry()) { case 1891: // Pyrewood Watcher @@ -838,7 +838,7 @@ void Spell::EffectDummy(SpellEffectIndex effIdx) ? 17269 // Create Resonating Skull : 17270; // Create Bone Dust - + m_casterUnit->CastSpell(m_casterUnit, spellId, true, nullptr); return; } @@ -852,7 +852,7 @@ void Spell::EffectDummy(SpellEffectIndex effIdx) if (m_casterUnit->GetThreatManager().getThreat(unitTarget)) m_casterUnit->GetThreatManager().modifyThreatPercent(unitTarget, -100); - + uint32 spellId = PickRandomValue(17863, 17939, 17943, 17944, 17946, 17948); m_casterUnit->CastSpell(unitTarget, spellId, true); return; @@ -881,7 +881,7 @@ void Spell::EffectDummy(SpellEffectIndex effIdx) break; } } - + return; } case 19411: // Lava Bomb @@ -908,7 +908,7 @@ void Spell::EffectDummy(SpellEffectIndex effIdx) if (!m_originalCaster) return; - + int32 damage; if (unitTarget->IsPlayer()) // damage from 100 - 500 based on proximity - max range 25 damage = dither(100 + ((25 - std::min(m_originalCaster->GetCombatDistance(unitTarget), 25.f)) / 25.f) * 400); @@ -1751,7 +1751,7 @@ void Spell::EffectPowerBurn(SpellEffectIndex effIdx) if (Player* modOwner = m_casterUnit->GetSpellModOwner()) modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_MULTIPLE_VALUE, multiplier); } - + newDamage = newDamage * multiplier; m_damage += newDamage; } @@ -1941,7 +1941,7 @@ void Spell::EffectPersistentAA(SpellEffectIndex effIdx) if (GameObject* pGo = ToGameObject(pCaster)) if (Unit* pOwner = pGo->GetOwner()) pCaster = pOwner; - + if (!pCaster) pCaster = m_caster; @@ -3343,12 +3343,12 @@ void Spell::EffectWeaponDmg(SpellEffectIndex effIdx) break; } } - + float weaponDamagePercentMod = 1.0f; // SPELL_EFFECT_WEAPON_PERCENT_DAMAGE pct that is applied to both fixed bonus damage bonus of other effects and to base weapon swing damage bool normalized = false; // whether the spell has SPELL_EFFECT_NORMALIZED_WEAPON_DMG float bonus = 0.f; // fixed bonus damage from SPELL_EFFECT_WEAPON_DAMAGE, SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL, // and SPELL_EFFECT_NORMALIZED_WEAPON_DMG. (If creature and has no weapon, also from SPELL_EFFECT_WEAPON_PERCENT_DAMAGE) - + for (uint8 j = 0; j < MAX_EFFECT_INDEX; ++j) { switch (m_spellInfo->Effect[j]) @@ -3774,7 +3774,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex effIdx) bool gender = unitTarget->GetGender(); uint32 spellId = 0; - uint32 spells[8] = { + uint32 spells[8] = { gender == GENDER_MALE ? 24708u : 24709u, // Pirate gender == GENDER_MALE ? 24711u : 24710u, // Ninja gender == GENDER_MALE ? 24712u : 24713u, // Leper @@ -4461,7 +4461,7 @@ void Spell::EffectScriptEffect(SpellEffectIndex effIdx) { if (!unitTarget || !unitTarget->CanHaveThreatList() || !m_casterUnit) return; - + if (unitTarget->GetThreatManager().getThreat(m_casterUnit)) unitTarget->GetThreatManager().addThreat(m_casterUnit, damage * m_casterUnit->GetAttackTime(BASE_ATTACK) / 1000); } diff --git a/src/game/Transports/Transport.cpp b/src/game/Transports/Transport.cpp index 2eec243d2b8..363c831ea7f 100644 --- a/src/game/Transports/Transport.cpp +++ b/src/game/Transports/Transport.cpp @@ -21,7 +21,7 @@ #include "Geometry.h" #include "ObjectMgr.h" #include "Path.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "World.h" #include "GameObjectAI.h" #include "MapReference.h" @@ -156,7 +156,7 @@ bool ShipTransport::TeleportTransport(uint32 newMapid, float x, float y, float z creature->NearTeleportTo(x, y, z, o); } } - + break; } case TYPEID_PLAYER: diff --git a/src/game/Weather.cpp b/src/game/Weather.cpp index 959954fb3ca..54a06bff036 100644 --- a/src/game/Weather.cpp +++ b/src/game/Weather.cpp @@ -24,12 +24,12 @@ #include "Policies/SingletonImp.h" #include "Weather.h" -#include "WorldSession.h" +#include "Server/WorldSession.h" #include "Player.h" #include "Map.h" #include "Opcodes.h" #include "World.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "Log.h" #include "Util.h" #include "ProgressBar.h" diff --git a/src/game/World.cpp b/src/game/World.cpp index 2bc6ab1173b..752f83171b3 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -30,8 +30,8 @@ #include "SystemConfig.h" #include "Log.h" #include "Opcodes.h" -#include "WorldSession.h" -#include "WorldPacket.h" +#include "Server/WorldSession.h" +#include "Server/WorldPacket.h" #include "Weather.h" #include "Player.h" #include "TransactionLog.h" diff --git a/src/game/World.h b/src/game/World.h index e26adda43ad..d7fc51564ce 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -32,7 +32,7 @@ #include "SharedDefines.h" #include "ObjectGuid.h" #include "Chat/AbstractPlayer.h" -#include "WorldPacket.h" +#include "Server/WorldPacket.h" #include "Multithreading/Messager.h" #include "LFGQueue.h" #include "LockedQueue.h" diff --git a/src/game/pchdef.h b/src/game/pchdef.h index e995e828cdd..f3b962966b2 100644 --- a/src/game/pchdef.h +++ b/src/game/pchdef.h @@ -1,5 +1,5 @@ //add here most rarely modified headers to speed up debug build compilation -#include "WorldSocket.h" +#include "Server/WorldSocket.h" #include "Common.h" #include "MapManager.h" diff --git a/src/mangosd/Master.cpp b/src/mangosd/Master.cpp index 01ecb661e07..88f8133cf60 100644 --- a/src/mangosd/Master.cpp +++ b/src/mangosd/Master.cpp @@ -27,7 +27,6 @@ #include "Common.h" #include "Master.h" -#include "WorldSocket.h" #include "WorldRunnable.h" #include "World.h" #include "Log.h" @@ -42,7 +41,7 @@ #include "Util.h" #include "MassMailMgr.h" #include "DBCStores.h" -#include "WorldSocketMgr.h" +#include "Server/WorldSocketMgr.h" #include "IO/Context/IoContext.h" #include "IO/Multithreading/CreateThread.h" #include "IO/Networking/AsyncSocketAcceptor.h" diff --git a/src/shared/CMakeLists.txt b/src/shared/CMakeLists.txt index 34016de1140..85669285b85 100644 --- a/src/shared/CMakeLists.txt +++ b/src/shared/CMakeLists.txt @@ -38,7 +38,6 @@ set (shared_SRCS Timer.h Util.h WheatyExceptionReport.h - WorldPacket.h Config/Config.h Config/ConfigEnv.h Crypto/BigNumber.h