diff options
61 files changed, 1371 insertions, 1160 deletions
diff --git a/README.md b/README.md index f1fadcd0d8b..07f3495e0e7 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ website at [TrinityCore.org](http://www.trinitycore.org). + CMake ≥ 2.8.11.2 / 2.8.9 (Windows / Linux) + OpenSSL ≥ 1.0.0 + GCC ≥ 4.7.2 (Linux only) -+ MS Visual Studio ≥ 12 (2013 Update 3) (Windows only) ++ MS Visual Studio ≥ 12 (2013 Update 4) (Windows only) ## Install diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql index 076fe87130b..96679742390 100644 --- a/sql/base/auth_database.sql +++ b/sql/base/auth_database.sql @@ -252,7 +252,7 @@ CREATE TABLE `battlenet_components` ( LOCK TABLES `battlenet_components` WRITE; /*!40000 ALTER TABLE `battlenet_components` DISABLE KEYS */; -INSERT INTO `battlenet_components` VALUES ('Bnet','Mc64',37165),('Bnet','Win',37165),('Bnet','Wn64',37165),('WoW','base',19793),('WoW','deDE',0),('WoW','enCN',0),('WoW','enGB',0),('WoW','enTW',0),('WoW','enUS',0),('WoW','esES',0),('WoW','esMX',0),('WoW','frFR',0),('WoW','itIT',0),('WoW','koKR',0),('WoW','Mc64',19802),('WoW','ptBR',0),('WoW','ptPT',0),('WoW','ruRU',0),('WoW','Win',19802),('WoW','Wn64',19802),('WoW','zhCN',0),('WoW','zhTW',0); +INSERT INTO `battlenet_components` VALUES ('Bnet','Mc64',37165),('Bnet','Win',37165),('Bnet','Wn64',37165),('WoW','base',19793),('WoW','deDE',0),('WoW','enCN',0),('WoW','enGB',0),('WoW','enTW',0),('WoW','enUS',0),('WoW','esES',0),('WoW','esMX',0),('WoW','frFR',0),('WoW','itIT',0),('WoW','koKR',0),('WoW','Mc64',19831),('WoW','ptBR',0),('WoW','ptPT',0),('WoW','ruRU',0),('WoW','Win',19831),('WoW','Wn64',19831),('WoW','zhCN',0),('WoW','zhTW',0); /*!40000 ALTER TABLE `battlenet_components` ENABLE KEYS */; UNLOCK TABLES; diff --git a/sql/updates/auth/2015_04_04_00_auth.sql b/sql/updates/auth/2015_04_04_00_auth.sql new file mode 100644 index 00000000000..fd6a887b876 --- /dev/null +++ b/sql/updates/auth/2015_04_04_00_auth.sql @@ -0,0 +1 @@ +UPDATE `battlenet_components` SET `Build`=19831 WHERE `Program`='WoW' AND `Platform` IN ('Win','Wn64','Mc64') AND `Build`=19802; diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index c27fc6e2088..5ee5e64a7b2 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -52,6 +52,7 @@ #include "World.h" #include "WorldPacket.h" #include "CombatPackets.h" +#include "MiscPackets.h" #include "Transport.h" @@ -2146,10 +2147,9 @@ bool Creature::LoadCreaturesAddon(bool reload) void Creature::SendZoneUnderAttackMessage(Player* attacker) { uint32 enemy_team = attacker->GetTeam(); - - WorldPacket data(SMSG_ZONE_UNDER_ATTACK, 4); - data << (uint32)GetAreaId(); - sWorld->SendGlobalMessage(&data, NULL, (enemy_team == ALLIANCE ? HORDE : ALLIANCE)); + WorldPackets::Misc::ZoneUnderAttack packet; + packet.AreaID = GetAreaId(); + sWorld->SendGlobalMessage(packet.Write(), NULL, (enemy_team == ALLIANCE ? HORDE : ALLIANCE)); } void Creature::SetInCombatWithZone() diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 87ca9110e24..dbb8c99d7c9 100644 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -20,6 +20,7 @@ #include "DatabaseEnv.h" #include "Log.h" #include "WorldPacket.h" +#include "SpellPackets.h" #include "ObjectMgr.h" #include "SpellMgr.h" #include "Pet.h" @@ -297,15 +298,16 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petEntry, uint32 petnumber, bool c /// @todo pets should be summoned from real cast instead of just faking it? if (summonSpellId) { - WorldPacket data(SMSG_SPELL_GO, (8+8+4+4+2)); - data << owner->GetPackGUID(); - data << owner->GetPackGUID(); - data << uint8(0); - data << uint32(summonSpellId); - data << uint32(256); // CAST_FLAG_UNKNOWN3 - data << uint32(0); - data << uint32(getMSTime()); - owner->SendMessageToSet(&data, true); + WorldPackets::Spells::SpellGo spellGo; + WorldPackets::Spells::SpellCastData& castData = spellGo.Cast; + + castData.CasterGUID = owner->GetGUID(); + castData.CasterUnit = owner->GetGUID(); + castData.SpellID = summonSpellId; + castData.CastFlags = CAST_FLAG_UNKNOWN_9; + castData.CastTime = getMSTime(); + + owner->SendMessageToSet(spellGo.Write(), true); } owner->SetMinion(this, true); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index b29694431ac..a9596d28960 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -97,6 +97,7 @@ #include "ItemPackets.h" #include "QuestPackets.h" #include "LootPackets.h" +#include "TradePackets.h" #define ZONE_UPDATE_INTERVAL (1*IN_MILLISECONDS) @@ -315,6 +316,8 @@ void TradeData::SetItem(TradeSlots slot, Item* item) SetAccepted(false); GetTraderData()->SetAccepted(false); + UpdateServerStateIndex(); + Update(); // need remove possible trader spell applied to changed item @@ -338,6 +341,8 @@ void TradeData::SetSpell(uint32 spell_id, Item* castItem /*= NULL*/) SetAccepted(false); GetTraderData()->SetAccepted(false); + UpdateServerStateIndex(); + Update(true); // send spell info to item owner Update(false); // send spell info to caster self } @@ -349,9 +354,9 @@ void TradeData::SetMoney(uint64 money) if (!m_player->HasEnoughMoney(money)) { - TradeStatusInfo info; - info.Status = TRADE_STATUS_CLOSE_WINDOW; - info.Result = EQUIP_ERR_NOT_ENOUGH_MONEY; + WorldPackets::Trade::TradeStatus info; + info.Status = TRADE_STATUS_FAILED; + info.BagResult = EQUIP_ERR_NOT_ENOUGH_MONEY; m_player->GetSession()->SendTradeStatus(info); return; } @@ -361,6 +366,8 @@ void TradeData::SetMoney(uint64 money) SetAccepted(false); GetTraderData()->SetAccepted(false); + UpdateServerStateIndex(); + Update(true); } @@ -378,8 +385,8 @@ void TradeData::SetAccepted(bool state, bool crosssend /*= false*/) if (!state) { - TradeStatusInfo info; - info.Status = TRADE_STATUS_BACK_TO_TRADE; + WorldPackets::Trade::TradeStatus info; + info.Status = TRADE_STATUS_UNACCEPTED; if (crosssend) m_trader->GetSession()->SendTradeStatus(info); else @@ -8412,9 +8419,10 @@ void Player::RemovedInsignia(Player* looterPlr) void Player::SendLootRelease(ObjectGuid guid) { - WorldPacket data(SMSG_LOOT_RELEASE, (8+1)); - data << guid << uint8(1); - SendDirectMessage(&data); + WorldPackets::Loot::LootReleaseResponse packet; + packet.LootObj = guid; + packet.Owner = GetGUID(); + SendDirectMessage(packet.Write()); } void Player::SendLoot(ObjectGuid guid, LootType loot_type) @@ -10156,7 +10164,7 @@ bool Player::HasItemOrGemWithLimitCategoryEquipped(uint32 limitCategory, uint32 return false; } -InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count /*= NULL*/, uint32* itemLimitCategory /*= NULL*/) const +InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count /*= nullptr*/, uint32* offendingItemId /*= nullptr*/) const { ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(entry); if (!pProto) @@ -10202,8 +10210,8 @@ InventoryResult Player::CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item { if (no_space_count) *no_space_count = count + curcount - limitEntry->Quantity; - if (itemLimitCategory) - *itemLimitCategory = pProto->GetItemLimitCategory(); + if (offendingItemId) + *offendingItemId = pProto->GetId(); return EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED_IS; } } @@ -10734,7 +10742,7 @@ InventoryResult Player::CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &des } ////////////////////////////////////////////////////////////////////////// -InventoryResult Player::CanStoreItems(Item** items, int count, uint32* itemLimitCategory) const +InventoryResult Player::CanStoreItems(Item** items, int count, uint32* offendingItemId) const { Item* item2; @@ -10788,7 +10796,7 @@ InventoryResult Player::CanStoreItems(Item** items, int count, uint32* itemLimit ItemTemplate const* pBagProto; // item is 'one item only' - InventoryResult res = CanTakeMoreSimilarItems(item, itemLimitCategory); + InventoryResult res = CanTakeMoreSimilarItems(item, offendingItemId); if (res != EQUIP_ERR_OK) return res; @@ -26262,221 +26270,8 @@ bool Player::CanUseMastery() const return HasSpell(MasterySpells[getClass()]); } -void Player::ReadMovementInfo(WorldPacket& data, MovementInfo* mi, Movement::ExtraMovementStatusElement* extras /*= NULL*/) +void Player::ValidateMovementInfo(MovementInfo* mi) { - MovementStatusElements const* sequence = GetMovementStatusElementsSequence(data.GetOpcode()); - if (!sequence) - { - TC_LOG_ERROR("network", "Player::ReadMovementInfo: No movement sequence found for opcode %s", GetOpcodeNameForLogging(static_cast<OpcodeClient>(data.GetOpcode())).c_str()); - return; - } - - bool hasMovementFlags = false; - bool hasMovementFlags2 = false; - bool hasTimestamp = false; - bool hasOrientation = false; - bool hasTransportData = false; - bool hasTransportPrevTime = false; - bool hasTransportVehicleId = false; - bool hasPitch = false; - bool hasFallData = false; - bool hasFallDirection = false; - bool hasSplineElevation = false; - - ObjectGuid guid; - ObjectGuid tguid; - - for (; *sequence != MSEEnd; ++sequence) - { - MovementStatusElements const& element = *sequence; - - switch (element) - { - case MSEHasGuidByte0: - case MSEHasGuidByte1: - case MSEHasGuidByte2: - case MSEHasGuidByte3: - case MSEHasGuidByte4: - case MSEHasGuidByte5: - case MSEHasGuidByte6: - case MSEHasGuidByte7: - guid[element - MSEHasGuidByte0] = data.ReadBit(); - break; - case MSEHasTransportGuidByte0: - case MSEHasTransportGuidByte1: - case MSEHasTransportGuidByte2: - case MSEHasTransportGuidByte3: - case MSEHasTransportGuidByte4: - case MSEHasTransportGuidByte5: - case MSEHasTransportGuidByte6: - case MSEHasTransportGuidByte7: - if (hasTransportData) - tguid[element - MSEHasTransportGuidByte0] = data.ReadBit(); - break; - case MSEGuidByte0: - case MSEGuidByte1: - case MSEGuidByte2: - case MSEGuidByte3: - case MSEGuidByte4: - case MSEGuidByte5: - case MSEGuidByte6: - case MSEGuidByte7: - data.ReadByteSeq(guid[element - MSEGuidByte0]); - break; - case MSETransportGuidByte0: - case MSETransportGuidByte1: - case MSETransportGuidByte2: - case MSETransportGuidByte3: - case MSETransportGuidByte4: - case MSETransportGuidByte5: - case MSETransportGuidByte6: - case MSETransportGuidByte7: - if (hasTransportData) - data.ReadByteSeq(tguid[element - MSETransportGuidByte0]); - break; - case MSEHasMovementFlags: - hasMovementFlags = !data.ReadBit(); - break; - case MSEHasMovementFlags2: - hasMovementFlags2 = !data.ReadBit(); - break; - case MSEHasTimestamp: - hasTimestamp = !data.ReadBit(); - break; - case MSEHasOrientation: - hasOrientation = !data.ReadBit(); - break; - case MSEHasTransportData: - hasTransportData = data.ReadBit(); - break; - case MSEHasTransportPrevTime: - if (hasTransportData) - hasTransportPrevTime = data.ReadBit(); - break; - case MSEHasTransportVehicleId: - if (hasTransportData) - hasTransportVehicleId = data.ReadBit(); - break; - case MSEHasPitch: - hasPitch = !data.ReadBit(); - break; - case MSEHasFallData: - hasFallData = data.ReadBit(); - break; - case MSEHasFallDirection: - if (hasFallData) - hasFallDirection = data.ReadBit(); - break; - case MSEHasSplineElevation: - hasSplineElevation = !data.ReadBit(); - break; - case MSEHasSpline: - data.ReadBit(); - break; - case MSEMovementFlags: - if (hasMovementFlags) - mi->flags = data.ReadBits(30); - break; - case MSEMovementFlags2: - if (hasMovementFlags2) - mi->flags2 = data.ReadBits(12); - break; - case MSETimestamp: - if (hasTimestamp) - data >> mi->time; - break; - case MSEPositionX: - data >> mi->pos.m_positionX; - break; - case MSEPositionY: - data >> mi->pos.m_positionY; - break; - case MSEPositionZ: - data >> mi->pos.m_positionZ; - break; - case MSEOrientation: - if (hasOrientation) - mi->pos.SetOrientation(data.read<float>()); - break; - case MSETransportPositionX: - if (hasTransportData) - data >> mi->transport.pos.m_positionX; - break; - case MSETransportPositionY: - if (hasTransportData) - data >> mi->transport.pos.m_positionY; - break; - case MSETransportPositionZ: - if (hasTransportData) - data >> mi->transport.pos.m_positionZ; - break; - case MSETransportOrientation: - if (hasTransportData) - mi->transport.pos.SetOrientation(data.read<float>()); - break; - case MSETransportSeat: - if (hasTransportData) - data >> mi->transport.seat; - break; - case MSETransportTime: - if (hasTransportData) - data >> mi->transport.time; - break; - case MSETransportPrevTime: - if (hasTransportData && hasTransportPrevTime) - data >> mi->transport.prevTime; - break; - case MSETransportVehicleId: - if (hasTransportData && hasTransportVehicleId) - data >> mi->transport.vehicleId; - break; - case MSEPitch: - if (hasPitch) - mi->pitch = G3D::wrap(data.read<float>(), float(-M_PI), float(M_PI)); - break; - case MSEFallTime: - if (hasFallData) - data >> mi->jump.fallTime; - break; - case MSEFallVerticalSpeed: - if (hasFallData) - data >> mi->jump.zspeed; - break; - case MSEFallCosAngle: - if (hasFallData && hasFallDirection) - data >> mi->jump.cosAngle; - break; - case MSEFallSinAngle: - if (hasFallData && hasFallDirection) - data >> mi->jump.sinAngle; - break; - case MSEFallHorizontalSpeed: - if (hasFallData && hasFallDirection) - data >> mi->jump.xyspeed; - break; - case MSESplineElevation: - if (hasSplineElevation) - data >> mi->splineElevation; - break; - case MSECounter: - data.read_skip<uint32>(); /// @TODO: Maybe compare it with m_movementCounter to verify that packets are sent & received in order? - break; - case MSEZeroBit: - case MSEOneBit: - data.ReadBit(); - break; - case MSEExtraElement: - extras->ReadNextElement(data); - break; - default: - ASSERT(Movement::PrintInvalidSequenceElement(element, __FUNCTION__)); - break; - } - } - - mi->guid = guid; - mi->transport.guid = tguid; - //! Anti-cheat checks. Please keep them in seperate if () blocks to maintain a clear overview. //! Might be subject to latency, so just remove improper flags. #ifdef TRINITY_DEBUG @@ -26484,7 +26279,7 @@ void Player::ReadMovementInfo(WorldPacket& data, MovementInfo* mi, Movement::Ext { \ if (check) \ { \ - TC_LOG_DEBUG("entities.unit", "Player::ReadMovementInfo: Violation of MovementFlags found (%s). " \ + TC_LOG_DEBUG("entities.unit", "Player::ValidateMovementInfo: Violation of MovementFlags found (%s). " \ "MovementFlags: %u, MovementFlags2: %u for player %s. Mask %u will be removed.", \ STRINGIZE(check), mi->GetMovementFlags(), mi->GetExtraMovementFlags(), GetGUID().ToString().c_str(), maskToRemove); \ mi->RemoveMovementFlag((maskToRemove)); \ @@ -26541,21 +26336,18 @@ void Player::ReadMovementInfo(WorldPacket& data, MovementInfo* mi, Movement::Ext e.g. aerial combat. */ - REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY) && ToPlayer()->GetSession()->GetSecurity() == SEC_PLAYER && - !ToPlayer()->m_mover->HasAuraType(SPELL_AURA_FLY) && - !ToPlayer()->m_mover->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED), + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY) && GetSession()->GetSecurity() == SEC_PLAYER && + !m_mover->HasAuraType(SPELL_AURA_FLY) && + !m_mover->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED), MOVEMENTFLAG_FLYING | MOVEMENTFLAG_CAN_FLY); REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_DISABLE_GRAVITY | MOVEMENTFLAG_CAN_FLY) && mi->HasMovementFlag(MOVEMENTFLAG_FALLING), MOVEMENTFLAG_FALLING); - REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_FALLING) && (!hasFallData || !hasFallDirection), MOVEMENTFLAG_FALLING); - - REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_SPLINE_ELEVATION) && - (!hasSplineElevation || G3D::fuzzyEq(mi->splineElevation, 0.0f)), MOVEMENTFLAG_SPLINE_ELEVATION); + REMOVE_VIOLATING_FLAGS(mi->HasMovementFlag(MOVEMENTFLAG_SPLINE_ELEVATION) && G3D::fuzzyEq(mi->splineElevation, 0.0f), MOVEMENTFLAG_SPLINE_ELEVATION); // Client first checks if spline elevation != 0, then verifies flag presence - if (hasSplineElevation) + if (G3D::fuzzyNe(mi->splineElevation, 0.0f)) mi->AddMovementFlag(MOVEMENTFLAG_SPLINE_ELEVATION); #undef REMOVE_VIOLATING_FLAGS diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 974e8581a85..098b653574b 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1033,20 +1033,22 @@ enum CharDeleteMethod enum ReferAFriendError { - ERR_REFER_A_FRIEND_NONE = 0x00, - ERR_REFER_A_FRIEND_NOT_REFERRED_BY = 0x01, - ERR_REFER_A_FRIEND_TARGET_TOO_HIGH = 0x02, - ERR_REFER_A_FRIEND_INSUFFICIENT_GRANTABLE_LEVELS = 0x03, - ERR_REFER_A_FRIEND_TOO_FAR = 0x04, - ERR_REFER_A_FRIEND_DIFFERENT_FACTION = 0x05, - ERR_REFER_A_FRIEND_NOT_NOW = 0x06, - ERR_REFER_A_FRIEND_GRANT_LEVEL_MAX_I = 0x07, - ERR_REFER_A_FRIEND_SUMMON_LEVEL_MAX_I = 0x08, - ERR_REFER_A_FRIEND_SUMMON_COOLDOWN = 0x09, - ERR_REFER_A_FRIEND_SUMMON_OFFLINE_S = 0x0A, - ERR_REFER_A_FRIEND_INSUF_EXPAN_LVL = 0x0B, - ERR_REFER_A_FRIEND_NOT_IN_LFG = 0x0C, - ERR_REFER_A_FRIEND_NO_XREALM = 0x0D + ERR_REFER_A_FRIEND_NONE = 0, + ERR_REFER_A_FRIEND_NOT_REFERRED_BY = 1, + ERR_REFER_A_FRIEND_TARGET_TOO_HIGH = 2, + ERR_REFER_A_FRIEND_INSUFFICIENT_GRANTABLE_LEVELS = 3, + ERR_REFER_A_FRIEND_TOO_FAR = 4, + ERR_REFER_A_FRIEND_DIFFERENT_FACTION = 5, + ERR_REFER_A_FRIEND_NOT_NOW = 6, + ERR_REFER_A_FRIEND_GRANT_LEVEL_MAX_I = 7, + ERR_REFER_A_FRIEND_NO_TARGET = 8, + ERR_REFER_A_FRIEND_NOT_IN_GROUP = 9, + ERR_REFER_A_FRIEND_SUMMON_LEVEL_MAX_I = 10, + ERR_REFER_A_FRIEND_SUMMON_COOLDOWN = 11, + ERR_REFER_A_FRIEND_INSUF_EXPAN_LVL = 12, + ERR_REFER_A_FRIEND_SUMMON_OFFLINE_S = 13, + ERR_REFER_A_FRIEND_NO_XREALM = 14, + ERR_REFER_A_FRIEND_MAP_INCOMING_TRANSFER_NOT_ALLOWED = 15 }; enum PlayerRestState @@ -1148,19 +1150,6 @@ struct BGData bool HasTaxiPath() const { return taxiPath[0] && taxiPath[1]; } }; -struct TradeStatusInfo -{ - TradeStatusInfo() : Status(TRADE_STATUS_BUSY), TraderGuid(), Result(EQUIP_ERR_OK), - IsTargetResult(false), ItemLimitCategoryId(0), Slot(0) { } - - TradeStatus Status; - ObjectGuid TraderGuid; - InventoryResult Result; - bool IsTargetResult; - uint32 ItemLimitCategoryId; - uint8 Slot; -}; - struct VoidStorageItem { VoidStorageItem() @@ -1192,7 +1181,7 @@ class TradeData public: // constructors TradeData(Player* player, Player* trader) : m_player(player), m_trader(trader), m_accepted(false), m_acceptProccess(false), - m_money(0), m_spell(0), m_spellCastItem() { } + m_money(0), m_spell(0), m_spellCastItem(), m_clientStateIndex(1), m_serverStateIndex(1) { } Player* GetTrader() const { return m_trader; } TradeData* GetTraderData() const; @@ -1217,6 +1206,12 @@ class TradeData bool IsInAcceptProcess() const { return m_acceptProccess; } void SetInAcceptProcess(bool state) { m_acceptProccess = state; } + uint32 GetClientStateIndex() const { return m_clientStateIndex; } + void UpdateClientStateIndex() { ++m_clientStateIndex; } + + uint32 GetServerStateIndex() const { return m_serverStateIndex; } + void UpdateServerStateIndex() { m_serverStateIndex = rand32(); } + private: // internal functions void Update(bool for_trader = true); @@ -1235,6 +1230,9 @@ class TradeData ObjectGuid m_spellCastItem; // applied spell cast by item use ObjectGuid m_items[TRADE_SLOT_COUNT]; // traded items from m_player side including non-traded slot + + uint32 m_clientStateIndex; + uint32 m_serverStateIndex; }; struct ResurrectionData @@ -1480,11 +1478,11 @@ class Player : public Unit, public GridObject<Player> bool CanNoReagentCast(SpellInfo const* spellInfo) const; bool HasItemOrGemWithIdEquipped(uint32 item, uint32 count, uint8 except_slot = NULL_SLOT) const; bool HasItemOrGemWithLimitCategoryEquipped(uint32 limitCategory, uint32 count, uint8 except_slot = NULL_SLOT) const; - InventoryResult CanTakeMoreSimilarItems(Item* pItem, uint32* itemLimitCategory = NULL) const { return CanTakeMoreSimilarItems(pItem->GetEntry(), pItem->GetCount(), pItem, NULL, itemLimitCategory); } - InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count, uint32* itemLimitCategory = NULL) const { return CanTakeMoreSimilarItems(entry, count, NULL, NULL, itemLimitCategory); } + InventoryResult CanTakeMoreSimilarItems(Item* pItem, uint32* offendingItemId = nullptr) const { return CanTakeMoreSimilarItems(pItem->GetEntry(), pItem->GetCount(), pItem, nullptr, offendingItemId); } + InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count, uint32* offendingItemId = nullptr) const { return CanTakeMoreSimilarItems(entry, count, nullptr, nullptr, offendingItemId); } InventoryResult CanStoreNewItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 item, uint32 count, uint32* no_space_count = NULL) const; InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, Item* pItem, bool swap = false) const; - InventoryResult CanStoreItems(Item** items, int count, uint32* itemLimitCategory) const; + InventoryResult CanStoreItems(Item** items, int count, uint32* offendingItemId) const; InventoryResult CanEquipNewItem(uint8 slot, uint16& dest, uint32 item, bool swap) const; InventoryResult CanEquipItem(uint8 slot, uint16& dest, Item* pItem, bool swap, bool not_loading = true) const; @@ -1508,7 +1506,7 @@ class Player : public Unit, public GridObject<Player> void AutoStoreLoot(uint32 loot_id, LootStore const& store, bool broadcast = false) { AutoStoreLoot(NULL_BAG, NULL_SLOT, loot_id, store, broadcast); } void StoreLootItem(uint8 lootSlot, Loot* loot); - InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count = NULL, uint32* itemLimitCategory = NULL) const; + InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count = nullptr, uint32* offendingItemId = nullptr) const; InventoryResult CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 entry, uint32 count, Item* pItem = NULL, bool swap = false, uint32* no_space_count = NULL) const; void AddRefundReference(ObjectGuid it); @@ -2595,7 +2593,7 @@ class Player : public Unit, public GridObject<Player> bool IsInWhisperWhiteList(ObjectGuid guid); void RemoveFromWhisperWhiteList(ObjectGuid guid) { WhisperList.remove(guid); } - void ReadMovementInfo(WorldPacket& data, MovementInfo* mi, Movement::ExtraMovementStatusElement* extras = NULL); + void ValidateMovementInfo(MovementInfo* mi); /*! These methods send different packets to the client in apply and unapply case. These methods are only sent to the current unit. diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 910b1c747da..f384a42ff28 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -15656,9 +15656,9 @@ void Unit::SendChangeCurrentVictimOpcode(HostileReference* pHostileReference) void Unit::SendClearThreatListOpcode() { TC_LOG_DEBUG("entities.unit", "WORLD: Send SMSG_THREAT_CLEAR Message"); - WorldPacket data(SMSG_THREAT_CLEAR, 8); - data << GetPackGUID(); - SendMessageToSet(&data, false); + WorldPackets::Combat::ThreatClear packet; + packet.UnitGUID = GetGUID(); + SendMessageToSet(packet.Write(), false); } void Unit::SendRemoveFromThreatListOpcode(HostileReference* pHostileReference) diff --git a/src/server/game/Handlers/BlackMarketHandler.cpp b/src/server/game/Handlers/BlackMarketHandler.cpp index f2b549c58c3..82763e561c8 100644 --- a/src/server/game/Handlers/BlackMarketHandler.cpp +++ b/src/server/game/Handlers/BlackMarketHandler.cpp @@ -1,19 +1,19 @@ /* -* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at your -* option) any later version. -* -* This program is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with this program. If not, see <http://www.gnu.org/licenses/>. -*/ + * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ #include "BlackMarketPackets.h" #include "ObjectMgr.h" diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index 1217aeaed3a..cf04bfcbbb1 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -887,7 +887,7 @@ void WorldSession::HandleMoveUnRootAck(WorldPacket& recvData) MovementInfo movementInfo; movementInfo.guid = guid; - ReadMovementInfo(recvData, &movementInfo); + ValidateMovementInfo(recvData, &movementInfo); recvData.read_skip<float>(); // unk2 */ } @@ -912,7 +912,7 @@ void WorldSession::HandleMoveRootAck(WorldPacket& recvData) recvData.read_skip<uint32>(); // unk MovementInfo movementInfo; - ReadMovementInfo(recvData, &movementInfo); + ValidateMovementInfo(recvData, &movementInfo); */ } @@ -1346,7 +1346,7 @@ void WorldSession::HandleMoveSetCanFlyAckOpcode(WorldPacket& recvData) TC_LOG_DEBUG("network", "WORLD: CMSG_MOVE_SET_CAN_FLY_ACK"); MovementInfo movementInfo; - _player->ReadMovementInfo(recvData, &movementInfo); + _player->ValidateMovementInfo(&movementInfo); _player->m_mover->m_movementInfo.flags = movementInfo.GetMovementFlags(); } diff --git a/src/server/game/Handlers/MovementHandler.cpp b/src/server/game/Handlers/MovementHandler.cpp index 23c1ed1c2d9..0bf3deede07 100644 --- a/src/server/game/Handlers/MovementHandler.cpp +++ b/src/server/game/Handlers/MovementHandler.cpp @@ -38,7 +38,6 @@ void WorldSession::HandleMoveWorldportAckOpcode(WorldPackets::Movement::WorldPortResponse& /*packet*/) { - TC_LOG_DEBUG("network", "WORLD: got MSG_MOVE_WORLDPORT_ACK."); HandleMoveWorldportAckOpcode(); } @@ -252,9 +251,9 @@ void WorldSession::HandleMovementOpcodes(WorldPackets::Movement::ClientPlayerMov // ignore, waiting processing in WorldSession::HandleMoveWorldportAckOpcode and WorldSession::HandleMoveTeleportAck if (plrMover && plrMover->IsBeingTeleported()) - { return; - } + + GetPlayer()->ValidateMovementInfo(&packet.movementInfo); MovementInfo& movementInfo = packet.movementInfo; @@ -264,6 +263,7 @@ void WorldSession::HandleMovementOpcodes(WorldPackets::Movement::ClientPlayerMov TC_LOG_ERROR("network", "HandleMovementOpcodes: guid error"); return; } + if (!movementInfo.pos.IsPositionValid()) { TC_LOG_ERROR("network", "HandleMovementOpcodes: Invalid Position"); @@ -394,6 +394,8 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPackets::Movement::MovementSpe { OpcodeClient opcode = packet.GetOpcode(); + GetPlayer()->ValidateMovementInfo(&packet.movementInfo); + // now can skip not our packet if (_player->GetGUID() != packet.movementInfo.guid) { @@ -465,8 +467,6 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPackets::Movement::MovementSpe void WorldSession::HandleSetActiveMoverOpcode(WorldPackets::Movement::SetActiveMover& packet) { - TC_LOG_DEBUG("network", "WORLD: Recvd CMSG_SET_ACTIVE_MOVER"); - if (GetPlayer()->IsInWorld()) if (_player->m_mover->GetGUID() != packet.ActiveMover) TC_LOG_DEBUG("network", "HandleSetActiveMoverOpcode: incorrect mover guid: mover is %s and should be %s" , packet.ActiveMover.ToString().c_str(), _player->m_mover->GetGUID().ToString().c_str()); @@ -480,49 +480,42 @@ void WorldSession::HandleMountSpecialAnimOpcode(WorldPacket& /*recvData*/) GetPlayer()->SendMessageToSet(&data, false); } -void WorldSession::HandleMoveKnockBackAck(WorldPacket& recvData) +void WorldSession::HandleMoveKnockBackAck(WorldPackets::Movement::MovementAck& movementAck) { - TC_LOG_DEBUG("network", "CMSG_MOVE_KNOCK_BACK_ACK"); + GetPlayer()->ValidateMovementInfo(&movementAck.movementInfo); - MovementInfo movementInfo; - GetPlayer()->ReadMovementInfo(recvData, &movementInfo); - - if (_player->m_mover->GetGUID() != movementInfo.guid) + if (_player->m_mover->GetGUID() != movementAck.movementInfo.guid) return; - _player->m_movementInfo = movementInfo; + _player->m_movementInfo = movementAck.movementInfo; - WorldPacket data(SMSG_MOVE_UPDATE_KNOCK_BACK, 66); - _player->WriteMovementInfo(data); - _player->SendMessageToSet(&data, false); + WorldPackets::Movement::MoveUpdateKnockBack updateKnockBack; + updateKnockBack.movementInfo = &_player->m_movementInfo; + _player->SendMessageToSet(updateKnockBack.Write(), false); } void WorldSession::HandleMoveHoverAck(WorldPacket& recvData) { - TC_LOG_DEBUG("network", "CMSG_MOVE_HOVER_ACK"); - ObjectGuid guid; // guid - unused recvData >> guid.ReadAsPacked(); recvData.read_skip<uint32>(); // unk MovementInfo movementInfo; - GetPlayer()->ReadMovementInfo(recvData, &movementInfo); + GetPlayer()->ValidateMovementInfo(&movementInfo); recvData.read_skip<uint32>(); // unk2 } void WorldSession::HandleMoveWaterWalkAck(WorldPacket& recvData) { - TC_LOG_DEBUG("network", "CMSG_MOVE_WATER_WALK_ACK"); - ObjectGuid guid; // guid - unused recvData >> guid.ReadAsPacked(); recvData.read_skip<uint32>(); // unk MovementInfo movementInfo; - GetPlayer()->ReadMovementInfo(recvData, &movementInfo); + GetPlayer()->ValidateMovementInfo(&movementInfo); recvData.read_skip<uint32>(); // unk2 } @@ -542,10 +535,8 @@ void WorldSession::HandleSummonResponseOpcode(WorldPacket& recvData) void WorldSession::HandleSetCollisionHeightAck(WorldPacket& recvPacket) { - TC_LOG_DEBUG("network", "CMSG_MOVE_SET_COLLISION_HEIGHT_ACK"); - static MovementStatusElements const heightElement = MSEExtraFloat; Movement::ExtraMovementStatusElement extra(&heightElement); MovementInfo movementInfo; - GetPlayer()->ReadMovementInfo(recvPacket, &movementInfo, &extra); + GetPlayer()->ValidateMovementInfo(&movementInfo); } diff --git a/src/server/game/Handlers/ReferAFriendHandler.cpp b/src/server/game/Handlers/ReferAFriendHandler.cpp index 4610f737fce..a7cee1e25b9 100644 --- a/src/server/game/Handlers/ReferAFriendHandler.cpp +++ b/src/server/game/Handlers/ReferAFriendHandler.cpp @@ -20,18 +20,13 @@ #include "ObjectMgr.h" #include "Opcodes.h" #include "Log.h" +#include "ReferAFriendPackets.h" -void WorldSession::HandleGrantLevel(WorldPacket& recvData) +void WorldSession::HandleGrantLevel(WorldPackets::RaF::GrantLevel& grantLevel) { - TC_LOG_DEBUG("network", "WORLD: CMSG_GRANT_LEVEL"); - - ObjectGuid guid; - recvData >> guid.ReadAsPacked(); - - Player* target = ObjectAccessor::GetObjectInWorld(guid, _player); + Player* target = ObjectAccessor::GetObjectInWorld(grantLevel.Target, _player); // check cheating - /* TODO: 6.x update lfg system uint8 levels = _player->GetGrantableLevels(); uint8 error = 0; if (!target) @@ -48,31 +43,28 @@ void WorldSession::HandleGrantLevel(WorldPacket& recvData) error = ERR_REFER_A_FRIEND_GRANT_LEVEL_MAX_I; else if (target->GetGroup() != _player->GetGroup()) error = ERR_REFER_A_FRIEND_NOT_IN_GROUP; + else if (target->getLevel() >= GetMaxLevelForExpansion(target->GetSession()->GetExpansion())) + error = ERR_REFER_A_FRIEND_INSUF_EXPAN_LVL; if (error) { - WorldPacket data(SMSG_REFER_A_FRIEND_FAILURE, 24); - data << uint32(error); + WorldPackets::RaF::ReferAFriendFailure failure; + failure.Reason = error; if (error == ERR_REFER_A_FRIEND_NOT_IN_GROUP) - data << target->GetName(); + failure.Str = target->GetName(); - SendPacket(&data); + SendPacket(failure.Write()); return; - }*/ + } - WorldPacket data2(SMSG_PROPOSE_LEVEL_GRANT, 8); - data2 << _player->GetPackGUID(); - target->GetSession()->SendPacket(&data2); + WorldPackets::RaF::ProposeLevelGrant proposeLevelGrant; + proposeLevelGrant.Sender = _player->GetGUID(); + target->SendDirectMessage(proposeLevelGrant.Write()); } -void WorldSession::HandleAcceptGrantLevel(WorldPacket& recvData) +void WorldSession::HandleAcceptGrantLevel(WorldPackets::RaF::AcceptLevelGrant& acceptLevelGrant) { - TC_LOG_DEBUG("network", "WORLD: CMSG_ACCEPT_LEVEL_GRANT"); - - ObjectGuid guid; - recvData >> guid.ReadAsPacked(); - - Player* other = ObjectAccessor::GetObjectInWorld(guid, _player); + Player* other = ObjectAccessor::GetObjectInWorld(acceptLevelGrant.Granter, _player); if (!(other && other->GetSession())) return; diff --git a/src/server/game/Handlers/TaxiHandler.cpp b/src/server/game/Handlers/TaxiHandler.cpp index 6b1d40d23d6..74d18eadfe7 100644 --- a/src/server/game/Handlers/TaxiHandler.cpp +++ b/src/server/game/Handlers/TaxiHandler.cpp @@ -210,7 +210,7 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recvData) recvData.read_skip<uint32>(); // unk MovementInfo movementInfo; // used only for proper packet read - _player->ReadMovementInfo(recvData, &movementInfo); + _player->ValidateMovementInfo(&movementInfo); // in taxi flight packet received in 2 case: // 1) end taxi path in far (multi-node) flight diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp index b06f89797cf..517d02f852a 100644 --- a/src/server/game/Handlers/TradeHandler.cpp +++ b/src/server/game/Handlers/TradeHandler.cpp @@ -31,65 +31,19 @@ #include "AccountMgr.h" #include "TradePackets.h" -void WorldSession::SendTradeStatus(TradeStatusInfo const& info) +void WorldSession::SendTradeStatus(WorldPackets::Trade::TradeStatus& info) { - Player* trader = GetPlayer()->GetTrader(); - - WorldPacket data(SMSG_TRADE_STATUS, 13); - data.WriteBit(trader ? (trader->GetSession()->GetBattlenetAccountId() == GetBattlenetAccountId()) : 0); // IsSameBnetAccount, used for trading heirlooms and other battle.net bound items with your other accounts - data.WriteBits(info.Status, 5); - - switch (info.Status) - { - case TRADE_STATUS_BEGIN_TRADE: - data.WriteBit(info.TraderGuid[2]); - data.WriteBit(info.TraderGuid[4]); - data.WriteBit(info.TraderGuid[6]); - data.WriteBit(info.TraderGuid[0]); - data.WriteBit(info.TraderGuid[1]); - data.WriteBit(info.TraderGuid[3]); - data.WriteBit(info.TraderGuid[7]); - data.WriteBit(info.TraderGuid[5]); - - data.WriteByteSeq(info.TraderGuid[4]); - data.WriteByteSeq(info.TraderGuid[1]); - data.WriteByteSeq(info.TraderGuid[2]); - data.WriteByteSeq(info.TraderGuid[3]); - data.WriteByteSeq(info.TraderGuid[0]); - data.WriteByteSeq(info.TraderGuid[7]); - data.WriteByteSeq(info.TraderGuid[6]); - data.WriteByteSeq(info.TraderGuid[5]); - break; - case TRADE_STATUS_OPEN_WINDOW: - data << uint32(0); // CGTradeInfo::m_tradeID - break; - case TRADE_STATUS_CLOSE_WINDOW: - data.WriteBit(info.IsTargetResult); // bool isTargetError; used for: EQUIP_ERR_BAG_FULL, EQUIP_ERR_CANT_CARRY_MORE_OF_THIS, EQUIP_ERR_MISSING_REAGENT, EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_COUNT_EXCEEDED - data << uint32(info.Result); // InventoryResult - data << uint32(info.ItemLimitCategoryId); // ItemLimitCategory.dbc entry - break; - case TRADE_STATUS_WRONG_REALM: - case TRADE_STATUS_NOT_ON_TAPLIST: - data << uint8(info.Slot); // Trade slot; -1 here clears CGTradeInfo::m_tradeMoney - break; - case TRADE_STATUS_CURRENCY: // Not implemented - case TRADE_STATUS_CURRENCY_NOT_TRADABLE: // Not implemented - // Blizzard never implemented these, you can only trade currency with the field9 & 1 in CurrencyTypes.DBC, and only two test currencies have that flag - data << uint32(0); // Trading Currency Id - data << uint32(0); // Trading Currency Amount - default: - data.FlushBits(); - break; - } - - SendPacket(&data); + info.Clear(); // reuse packet + Player* trader = _player->GetTrader(); + info.PartnerIsSameBnetAccount = trader && trader->GetSession()->GetBattlenetAccountId() == GetBattlenetAccountId(); + SendPacket(info.Write()); } -void WorldSession::HandleIgnoreTradeOpcode(WorldPacket& /*recvPacket*/) +void WorldSession::HandleIgnoreTradeOpcode(WorldPackets::Trade::IgnoreTrade& /*ignoreTrade*/) { } -void WorldSession::HandleBusyTradeOpcode(WorldPacket& /*recvPacket*/) +void WorldSession::HandleBusyTradeOpcode(WorldPackets::Trade::BusyTrade& /*busyTrade*/) { } @@ -97,106 +51,44 @@ void WorldSession::SendUpdateTrade(bool trader_data /*= true*/) { TradeData* view_trade = trader_data ? _player->GetTradeData()->GetTraderData() : _player->GetTradeData(); - ByteBuffer itemData(7*2 + 7*4 + 3*4 + 3*4 + 1); - - uint8 count = 0; - for (uint8 i = 0; i < TRADE_SLOT_COUNT; ++i) - if (view_trade->GetItem(TradeSlots(i))) - ++count; - - WorldPacket data(SMSG_TRADE_UPDATED, 4*6 + 8 + 1 + 3 + count * 70); - data << uint32(0); // CGTradeInfo::m_tradeID - data << uint32(0); // unk 2 - data << uint64(view_trade->GetMoney()); // trader gold - data << uint32(view_trade->GetSpell()); // spell casted on lowest slot item - data << uint32(TRADE_SLOT_COUNT); // trade slots count/number?, = next field in most cases - data << uint32(0); // unk 5 - data << uint8(trader_data); // 1 means traders data, 0 means own - data << uint32(TRADE_SLOT_COUNT); // trade slots count/number?, = prev field in most cases - data.WriteBits(count, 22); + WorldPackets::Trade::TradeUpdated tradeUpdated; + tradeUpdated.WhichPlayer = trader_data; + tradeUpdated.ClientStateIndex = view_trade->GetClientStateIndex(); + tradeUpdated.CurrentStateIndex = view_trade->GetServerStateIndex(); + tradeUpdated.Gold = view_trade->GetMoney(); + tradeUpdated.ProposedEnchantment = view_trade->GetSpell(); for (uint8 i = 0; i < TRADE_SLOT_COUNT; ++i) { - Item* item = view_trade->GetItem(TradeSlots(i)); - if (!item) - continue; - - ObjectGuid giftCreatorGuid = item->GetGuidValue(ITEM_FIELD_GIFTCREATOR); - ObjectGuid creatorGuid = item->GetGuidValue(ITEM_FIELD_CREATOR); - - data.WriteBit(giftCreatorGuid[7]); - data.WriteBit(giftCreatorGuid[1]); - bool notWrapped = data.WriteBit(!item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED)); - data.WriteBit(giftCreatorGuid[3]); - - if (notWrapped) + if (Item* item = view_trade->GetItem(TradeSlots(i))) { - data.WriteBit(creatorGuid[7]); - data.WriteBit(creatorGuid[1]); - data.WriteBit(creatorGuid[4]); - data.WriteBit(creatorGuid[6]); - data.WriteBit(creatorGuid[2]); - data.WriteBit(creatorGuid[3]); - data.WriteBit(creatorGuid[5]); - data.WriteBit(item->GetTemplate()->GetLockID() != 0); - data.WriteBit(creatorGuid[0]); - - itemData.WriteByteSeq(creatorGuid[1]); - - itemData << uint32(item->GetEnchantmentId(PERM_ENCHANTMENT_SLOT)); - for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+MAX_GEM_SOCKETS /*3*/; ++enchant_slot) - itemData << uint32(item->GetEnchantmentId(EnchantmentSlot(enchant_slot))); - itemData << uint32(item->GetUInt32Value(ITEM_FIELD_MAXDURABILITY)); - - itemData.WriteByteSeq(creatorGuid[6]); - itemData.WriteByteSeq(creatorGuid[2]); - itemData.WriteByteSeq(creatorGuid[7]); - itemData.WriteByteSeq(creatorGuid[4]); - - itemData << uint32(item->GetUInt32Value(ITEM_FIELD_DURABILITY)); - itemData << uint32(item->GetItemRandomPropertyId()); - - itemData.WriteByteSeq(creatorGuid[3]); - - itemData << uint32(0); // unk7 - - itemData.WriteByteSeq(creatorGuid[0]); - - itemData << uint32(item->GetSpellCharges()); - itemData << uint32(item->GetItemSuffixFactor()); + WorldPackets::Trade::TradeUpdated::TradeItem tradeItem; + tradeItem.Slot = i; + tradeItem.EntryID = item->GetEntry(); + tradeItem.StackCount = item->GetCount(); + tradeItem.GiftCreator = item->GetGuidValue(ITEM_FIELD_GIFTCREATOR); + if (!item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED)) + { + WorldPackets::Trade::TradeUpdated::UnwrappedTradeItem* unwrappedItem = &tradeItem.Unwrapped.Value; + unwrappedItem->Item.Initalize(item); + unwrappedItem->EnchantID = item->GetEnchantmentId(PERM_ENCHANTMENT_SLOT); + unwrappedItem->OnUseEnchantmentID = item->GetEnchantmentId(USE_ENCHANTMENT_SLOT); + unwrappedItem->Creator = item->GetGuidValue(ITEM_FIELD_CREATOR); + unwrappedItem->Charges = item->GetSpellCharges(); + unwrappedItem->Lock = item->GetTemplate()->GetLockID() && !item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_UNLOCKED); + unwrappedItem->MaxDurability = item->GetUInt32Value(ITEM_FIELD_MAXDURABILITY); + unwrappedItem->Durability = item->GetUInt32Value(ITEM_FIELD_DURABILITY); + for (uint32 s = SOCK_ENCHANTMENT_SLOT; s < MAX_GEM_SOCKETS; ++s) + unwrappedItem->SocketEnchant[s] = item->GetEnchantmentId(EnchantmentSlot(s + SOCK_ENCHANTMENT_SLOT)); + + tradeItem.Unwrapped.HasValue = true; + } - itemData.WriteByteSeq(creatorGuid[5]); + tradeUpdated.Items.push_back(tradeItem); } - - data.WriteBit(giftCreatorGuid[6]); - data.WriteBit(giftCreatorGuid[4]); - data.WriteBit(giftCreatorGuid[2]); - data.WriteBit(giftCreatorGuid[0]); - data.WriteBit(giftCreatorGuid[5]); - - itemData.WriteByteSeq(giftCreatorGuid[6]); - itemData.WriteByteSeq(giftCreatorGuid[1]); - itemData.WriteByteSeq(giftCreatorGuid[7]); - itemData.WriteByteSeq(giftCreatorGuid[4]); - - itemData << uint32(item->GetTemplate()->GetId()); - - itemData.WriteByteSeq(giftCreatorGuid[0]); - - itemData << uint32(item->GetCount()); - - itemData.WriteByteSeq(giftCreatorGuid[5]); - - itemData << uint8(i); - - itemData.WriteByteSeq(giftCreatorGuid[2]); - itemData.WriteByteSeq(giftCreatorGuid[3]); } - data.FlushBits(); - data.append(itemData); - - SendPacket(&data); + SendPacket(tradeUpdated.Write()); } //============================================================== @@ -328,7 +220,7 @@ static void clearAcceptTradeMode(Item* *myItems, Item* *hisItems) } } -void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/) +void WorldSession::HandleAcceptTradeOpcode(WorldPackets::Trade::AcceptTrade& acceptTrade) { TradeData* my_trade = _player->m_trade; if (!my_trade) @@ -346,10 +238,18 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/) // set before checks for propertly undo at problems (it already set in to client) my_trade->SetAccepted(true); - TradeStatusInfo info; + WorldPackets::Trade::TradeStatus info; + if (his_trade->GetServerStateIndex() != acceptTrade.StateIndex) + { + info.Status = TRADE_STATUS_STATE_CHANGED; + SendTradeStatus(info); + my_trade->SetAccepted(false); + return; + } + if (!_player->IsWithinDistInMap(trader, TRADE_DISTANCE, false)) { - info.Status = TRADE_STATUS_TARGET_TO_FAR; + info.Status = TRADE_STATUS_TOO_FAR_AWAY; SendTradeStatus(info); my_trade->SetAccepted(false); return; @@ -358,8 +258,8 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/) // not accept case incorrect money amount if (!_player->HasEnoughMoney(my_trade->GetMoney())) { - info.Status = TRADE_STATUS_CLOSE_WINDOW; - info.Result = EQUIP_ERR_NOT_ENOUGH_MONEY; + info.Status = TRADE_STATUS_FAILED; + info.BagResult = EQUIP_ERR_NOT_ENOUGH_MONEY; SendTradeStatus(info); my_trade->SetAccepted(false, true); return; @@ -368,8 +268,8 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/) // not accept case incorrect money amount if (!trader->HasEnoughMoney(his_trade->GetMoney())) { - info.Status = TRADE_STATUS_CLOSE_WINDOW; - info.Result = EQUIP_ERR_NOT_ENOUGH_MONEY; + info.Status = TRADE_STATUS_FAILED; + info.BagResult = EQUIP_ERR_NOT_ENOUGH_MONEY; trader->GetSession()->SendTradeStatus(info); his_trade->SetAccepted(false, true); return; @@ -377,8 +277,8 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/) if (_player->GetMoney() >= uint64(MAX_MONEY_AMOUNT) - his_trade->GetMoney()) { - info.Status = TRADE_STATUS_CLOSE_WINDOW; - info.Result = EQUIP_ERR_TOO_MUCH_GOLD; + info.Status = TRADE_STATUS_FAILED; + info.BagResult = EQUIP_ERR_TOO_MUCH_GOLD; SendTradeStatus(info); my_trade->SetAccepted(false, true); return; @@ -386,8 +286,8 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/) if (trader->GetMoney() >= uint64(MAX_MONEY_AMOUNT) - my_trade->GetMoney()) { - info.Status = TRADE_STATUS_CLOSE_WINDOW; - info.Result = EQUIP_ERR_TOO_MUCH_GOLD; + info.Status = TRADE_STATUS_FAILED; + info.BagResult = EQUIP_ERR_TOO_MUCH_GOLD; trader->GetSession()->SendTradeStatus(info); his_trade->SetAccepted(false, true); return; @@ -400,15 +300,15 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/) { if (!item->CanBeTraded(false, true)) { - info.Status = TRADE_STATUS_TRADE_CANCELED; + info.Status = TRADE_STATUS_CANCELLED; SendTradeStatus(info); return; } if (item->IsBindedNotWith(trader)) { - info.Status = TRADE_STATUS_CLOSE_WINDOW; - info.Result = EQUIP_ERR_TRADE_BOUND_ITEM; + info.Status = TRADE_STATUS_FAILED; + info.BagResult = EQUIP_ERR_TRADE_BOUND_ITEM; SendTradeStatus(info); return; } @@ -418,7 +318,7 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/) { if (!item->CanBeTraded(false, true)) { - info.Status = TRADE_STATUS_TRADE_CANCELED; + info.Status = TRADE_STATUS_CANCELLED; SendTradeStatus(info); return; } @@ -514,36 +414,36 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/) } // inform partner client - info.Status = TRADE_STATUS_TRADE_ACCEPT; + info.Status = TRADE_STATUS_ACCEPTED; trader->GetSession()->SendTradeStatus(info); // test if item will fit in each inventory - TradeStatusInfo myCanCompleteInfo, hisCanCompleteInfo; - hisCanCompleteInfo.Result = trader->CanStoreItems(myItems, TRADE_SLOT_TRADED_COUNT, &hisCanCompleteInfo.ItemLimitCategoryId); - myCanCompleteInfo.Result = _player->CanStoreItems(hisItems, TRADE_SLOT_TRADED_COUNT, &myCanCompleteInfo.ItemLimitCategoryId); + WorldPackets::Trade::TradeStatus myCanCompleteInfo, hisCanCompleteInfo; + hisCanCompleteInfo.BagResult = trader->CanStoreItems(myItems, TRADE_SLOT_TRADED_COUNT, &hisCanCompleteInfo.ItemID); + myCanCompleteInfo.BagResult = _player->CanStoreItems(hisItems, TRADE_SLOT_TRADED_COUNT, &myCanCompleteInfo.ItemID); clearAcceptTradeMode(myItems, hisItems); // in case of missing space report error - if (myCanCompleteInfo.Result != EQUIP_ERR_OK) + if (myCanCompleteInfo.BagResult != EQUIP_ERR_OK) { clearAcceptTradeMode(my_trade, his_trade); - myCanCompleteInfo.Status = TRADE_STATUS_CLOSE_WINDOW; + myCanCompleteInfo.Status = TRADE_STATUS_FAILED; trader->GetSession()->SendTradeStatus(myCanCompleteInfo); - myCanCompleteInfo.IsTargetResult = true; + myCanCompleteInfo.FailureForYou = true; SendTradeStatus(myCanCompleteInfo); my_trade->SetAccepted(false); his_trade->SetAccepted(false); return; } - else if (hisCanCompleteInfo.Result != EQUIP_ERR_OK) + else if (hisCanCompleteInfo.BagResult != EQUIP_ERR_OK) { clearAcceptTradeMode(my_trade, his_trade); - hisCanCompleteInfo.Status = TRADE_STATUS_CLOSE_WINDOW; + hisCanCompleteInfo.Status = TRADE_STATUS_FAILED; SendTradeStatus(hisCanCompleteInfo); - hisCanCompleteInfo.IsTargetResult = true; + hisCanCompleteInfo.FailureForYou = true; trader->GetSession()->SendTradeStatus(hisCanCompleteInfo); my_trade->SetAccepted(false); his_trade->SetAccepted(false); @@ -613,18 +513,18 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/) trader->SaveInventoryAndGoldToDB(trans); CharacterDatabase.CommitTransaction(trans); - info.Status = TRADE_STATUS_TRADE_COMPLETE; + info.Status = TRADE_STATUS_COMPLETE; trader->GetSession()->SendTradeStatus(info); SendTradeStatus(info); } else { - info.Status = TRADE_STATUS_TRADE_ACCEPT; + info.Status = TRADE_STATUS_ACCEPTED; trader->GetSession()->SendTradeStatus(info); } } -void WorldSession::HandleUnacceptTradeOpcode(WorldPacket& /*recvPacket*/) +void WorldSession::HandleUnacceptTradeOpcode(WorldPackets::Trade::UnacceptTrade& /*unacceptTrade*/) { TradeData* my_trade = _player->GetTradeData(); if (!my_trade) @@ -633,14 +533,14 @@ void WorldSession::HandleUnacceptTradeOpcode(WorldPacket& /*recvPacket*/) my_trade->SetAccepted(false, true); } -void WorldSession::HandleBeginTradeOpcode(WorldPacket& /*recvPacket*/) +void WorldSession::HandleBeginTradeOpcode(WorldPackets::Trade::BeginTrade& /*beginTrade*/) { TradeData* my_trade = _player->m_trade; if (!my_trade) return; - TradeStatusInfo info; - info.Status = TRADE_STATUS_OPEN_WINDOW; + WorldPackets::Trade::TradeStatus info; + info.Status = TRADE_STATUS_INITIATED; my_trade->GetTrader()->GetSession()->SendTradeStatus(info); SendTradeStatus(info); } @@ -650,8 +550,8 @@ void WorldSession::SendCancelTrade() if (PlayerRecentlyLoggedOut() || PlayerLogout()) return; - TradeStatusInfo info; - info.Status = TRADE_STATUS_TRADE_CANCELED; + WorldPackets::Trade::TradeStatus info; + info.Status = TRADE_STATUS_CANCELLED; SendTradeStatus(info); } @@ -662,56 +562,36 @@ void WorldSession::HandleCancelTradeOpcode(WorldPackets::Trade::CancelTrade& /*c _player->TradeCancel(true); } -void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) +void WorldSession::HandleInitiateTradeOpcode(WorldPackets::Trade::InitiateTrade& initiateTrade) { - ObjectGuid guid; - - guid[0] = recvPacket.ReadBit(); - guid[3] = recvPacket.ReadBit(); - guid[5] = recvPacket.ReadBit(); - guid[1] = recvPacket.ReadBit(); - guid[4] = recvPacket.ReadBit(); - guid[6] = recvPacket.ReadBit(); - guid[7] = recvPacket.ReadBit(); - guid[2] = recvPacket.ReadBit(); - - recvPacket.ReadByteSeq(guid[7]); - recvPacket.ReadByteSeq(guid[4]); - recvPacket.ReadByteSeq(guid[3]); - recvPacket.ReadByteSeq(guid[5]); - recvPacket.ReadByteSeq(guid[1]); - recvPacket.ReadByteSeq(guid[2]); - recvPacket.ReadByteSeq(guid[6]); - recvPacket.ReadByteSeq(guid[0]); - if (GetPlayer()->m_trade) return; - TradeStatusInfo info; + WorldPackets::Trade::TradeStatus info; if (!GetPlayer()->IsAlive()) { - info.Status = TRADE_STATUS_YOU_DEAD; + info.Status = TRADE_STATUS_DEAD; SendTradeStatus(info); return; } if (GetPlayer()->HasUnitState(UNIT_STATE_STUNNED)) { - info.Status = TRADE_STATUS_YOU_STUNNED; + info.Status = TRADE_STATUS_STUNNED; SendTradeStatus(info); return; } if (isLogingOut()) { - info.Status = TRADE_STATUS_YOU_LOGOUT; + info.Status = TRADE_STATUS_LOGGING_OUT; SendTradeStatus(info); return; } if (GetPlayer()->IsInFlight()) { - info.Status = TRADE_STATUS_TARGET_TO_FAR; + info.Status = TRADE_STATUS_TOO_FAR_AWAY; SendTradeStatus(info); return; } @@ -722,8 +602,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) return; } - Player* pOther = ObjectAccessor::FindPlayer(guid); - + Player* pOther = ObjectAccessor::FindPlayer(initiateTrade.Guid); if (!pOther) { info.Status = TRADE_STATUS_NO_TARGET; @@ -733,7 +612,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) if (pOther == GetPlayer() || pOther->m_trade) { - info.Status = TRADE_STATUS_BUSY; + info.Status = TRADE_STATUS_PLAYER_BUSY; SendTradeStatus(info); return; } @@ -747,7 +626,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) if (pOther->IsInFlight()) { - info.Status = TRADE_STATUS_TARGET_TO_FAR; + info.Status = TRADE_STATUS_TOO_FAR_AWAY; SendTradeStatus(info); return; } @@ -761,14 +640,14 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) if (pOther->GetSession()->isLogingOut()) { - info.Status = TRADE_STATUS_TARGET_LOGOUT; + info.Status = TRADE_STATUS_TARGET_LOGGING_OUT; SendTradeStatus(info); return; } if (pOther->GetSocial()->HasIgnore(GetPlayer()->GetGUID())) { - info.Status = TRADE_STATUS_IGNORE_YOU; + info.Status = TRADE_STATUS_PLAYER_IGNORED; SendTradeStatus(info); return; } @@ -784,7 +663,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) if (!pOther->IsWithinDistInMap(_player, TRADE_DISTANCE, false)) { - info.Status = TRADE_STATUS_TARGET_TO_FAR; + info.Status = TRADE_STATUS_TOO_FAR_AWAY; SendTradeStatus(info); return; } @@ -799,52 +678,41 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) _player->m_trade = new TradeData(_player, pOther); pOther->m_trade = new TradeData(pOther, _player); - info.Status = TRADE_STATUS_BEGIN_TRADE; - info.TraderGuid = _player->GetGUID(); + info.Status = TRADE_STATUS_PROPOSED; + info.Partner = _player->GetGUID(); pOther->GetSession()->SendTradeStatus(info); } -void WorldSession::HandleSetTradeGoldOpcode(WorldPacket& recvPacket) +void WorldSession::HandleSetTradeGoldOpcode(WorldPackets::Trade::SetTradeGold& setTradeGold) { - uint64 gold; - recvPacket >> gold; - TradeData* my_trade = _player->GetTradeData(); if (!my_trade) return; - my_trade->SetMoney(gold); + my_trade->UpdateClientStateIndex(); + my_trade->SetMoney(setTradeGold.Coinage); } -void WorldSession::HandleSetTradeItemOpcode(WorldPacket& recvPacket) +void WorldSession::HandleSetTradeItemOpcode(WorldPackets::Trade::SetTradeItem& setTradeItem) { - // send update - uint8 tradeSlot; - uint8 bag; - uint8 slot; - - recvPacket >> slot; - recvPacket >> tradeSlot; - recvPacket >> bag; - TradeData* my_trade = _player->GetTradeData(); if (!my_trade) return; - TradeStatusInfo info; + WorldPackets::Trade::TradeStatus info; // invalid slot number - if (tradeSlot >= TRADE_SLOT_COUNT) + if (setTradeItem.TradeSlot >= TRADE_SLOT_COUNT) { - info.Status = TRADE_STATUS_TRADE_CANCELED; + info.Status = TRADE_STATUS_CANCELLED; SendTradeStatus(info); return; } // check cheating, can't fail with correct client operations - Item* item = _player->GetItemByPos(bag, slot); - if (!item || (tradeSlot != TRADE_SLOT_NONTRADED && !item->CanBeTraded(false, true))) + Item* item = _player->GetItemByPos(setTradeItem.PackSlot, setTradeItem.ItemSlotInPack); + if (!item || (setTradeItem.TradeSlot != TRADE_SLOT_NONTRADED && !item->CanBeTraded(false, true))) { - info.Status = TRADE_STATUS_TRADE_CANCELED; + info.Status = TRADE_STATUS_CANCELLED; SendTradeStatus(info); return; } @@ -855,34 +723,39 @@ void WorldSession::HandleSetTradeItemOpcode(WorldPacket& recvPacket) if (my_trade->HasItem(iGUID)) { // cheating attempt - info.Status = TRADE_STATUS_TRADE_CANCELED; + info.Status = TRADE_STATUS_CANCELLED; SendTradeStatus(info); return; } - if (tradeSlot != TRADE_SLOT_NONTRADED && item->IsBindedNotWith(my_trade->GetTrader())) + my_trade->UpdateClientStateIndex(); + + if (setTradeItem.TradeSlot != TRADE_SLOT_NONTRADED && item->IsBindedNotWith(my_trade->GetTrader())) { info.Status = TRADE_STATUS_NOT_ON_TAPLIST; - info.Slot = tradeSlot; + info.TradeSlot = setTradeItem.TradeSlot; SendTradeStatus(info); return; } - my_trade->SetItem(TradeSlots(tradeSlot), item); + my_trade->SetItem(TradeSlots(setTradeItem.TradeSlot), item); } -void WorldSession::HandleClearTradeItemOpcode(WorldPacket& recvPacket) +void WorldSession::HandleClearTradeItemOpcode(WorldPackets::Trade::ClearTradeItem& clearTradeItem) { - uint8 tradeSlot; - recvPacket >> tradeSlot; - TradeData* my_trade = _player->m_trade; if (!my_trade) return; + my_trade->UpdateClientStateIndex(); + // invalid slot number - if (tradeSlot >= TRADE_SLOT_COUNT) + if (clearTradeItem.TradeSlot >= TRADE_SLOT_COUNT) return; - my_trade->SetItem(TradeSlots(tradeSlot), NULL); + my_trade->SetItem(TradeSlots(clearTradeItem.TradeSlot), NULL); +} + +void WorldSession::HandleSetTradeCurrencyOpcode(WorldPackets::Trade::SetTradeCurrency& /*setTradeCurrency*/) +{ } diff --git a/src/server/game/Handlers/VehicleHandler.cpp b/src/server/game/Handlers/VehicleHandler.cpp index 98b2f5630bd..fa4027eb3f9 100644 --- a/src/server/game/Handlers/VehicleHandler.cpp +++ b/src/server/game/Handlers/VehicleHandler.cpp @@ -37,7 +37,7 @@ void WorldSession::HandleDismissControlledVehicle(WorldPacket &recvData) } MovementInfo mi; - _player->ReadMovementInfo(recvData, &mi); + _player->ValidateMovementInfo(&mi); _player->m_movementInfo = mi; @@ -97,7 +97,7 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket& recvData) Movement::ExtraMovementStatusElement extra(accessoryGuid); MovementInfo movementInfo; - GetPlayer()->ReadMovementInfo(recvData, &movementInfo, &extra); + GetPlayer()->ValidateMovementInfo(&movementInfo); vehicle_base->m_movementInfo = movementInfo; ObjectGuid accessory = extra.Data.guid; diff --git a/src/server/game/Maps/MapUpdater.cpp b/src/server/game/Maps/MapUpdater.cpp index 46b2fb86596..8ac6226b570 100644 --- a/src/server/game/Maps/MapUpdater.cpp +++ b/src/server/game/Maps/MapUpdater.cpp @@ -1,20 +1,20 @@ /* -* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> -* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at your -* option) any later version. -* -* This program is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with this program. If not, see <http://www.gnu.org/licenses/>. -*/ + * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ #include <mutex> #include <condition_variable> diff --git a/src/server/game/Maps/MapUpdater.h b/src/server/game/Maps/MapUpdater.h index 16d11b2f453..735b4eba234 100644 --- a/src/server/game/Maps/MapUpdater.h +++ b/src/server/game/Maps/MapUpdater.h @@ -1,20 +1,20 @@ /* -* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> -* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at your -* option) any later version. -* -* This program is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with this program. If not, see <http://www.gnu.org/licenses/>. -*/ + * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ #ifndef _MAP_UPDATER_H_INCLUDED #define _MAP_UPDATER_H_INCLUDED diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index 9a0714b105a..894e7624ca5 100644 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -4659,38 +4659,32 @@ enum SpellFamilyNames enum TradeStatus { - TRADE_STATUS_OPEN_WINDOW = 0, - // 1 - Related to EVENT_PLAYER_MONEY - TRADE_STATUS_NOT_ON_TAPLIST = 2, // Related to trading soulbound loot items - TRADE_STATUS_YOU_LOGOUT = 3, - TRADE_STATUS_IGNORE_YOU = 4, - TRADE_STATUS_TARGET_DEAD = 5, - TRADE_STATUS_TRADE_ACCEPT = 6, - TRADE_STATUS_TARGET_LOGOUT = 7, - // 8 - nonexistent - TRADE_STATUS_TRADE_COMPLETE = 9, - TRADE_STATUS_TRIAL_ACCOUNT = 10, // Trial accounts can not perform that action - // 11 - nonexistent - TRADE_STATUS_BEGIN_TRADE = 12, - TRADE_STATUS_YOU_DEAD = 13, - // 14 - nonexistent - // 15 - nonexistent - TRADE_STATUS_TARGET_TO_FAR = 16, - TRADE_STATUS_NO_TARGET = 17, - TRADE_STATUS_BUSY_2 = 18, - TRADE_STATUS_CURRENCY_NOT_TRADABLE = 19, // new 4.x - TRADE_STATUS_WRONG_FACTION = 20, - TRADE_STATUS_BUSY = 21, - // 22 - equivalent to 335 unk status 9 - TRADE_STATUS_TRADE_CANCELED = 23, - TRADE_STATUS_CURRENCY = 24, // new 4.x - TRADE_STATUS_BACK_TO_TRADE = 25, - TRADE_STATUS_WRONG_REALM = 26, // You can only trade conjured items... (cross realm BG related). - TRADE_STATUS_YOU_STUNNED = 27, - // 28 - nonexistent - TRADE_STATUS_TARGET_STUNNED = 29, - // 30 - nonexistent - TRADE_STATUS_CLOSE_WINDOW = 31, + TRADE_STATUS_STUNNED = 0, + TRADE_STATUS_TARGET_DEAD = 2, + TRADE_STATUS_PLAYER_IGNORED = 3, + TRADE_STATUS_STATE_CHANGED = 4, + TRADE_STATUS_PETITION = 5, + TRADE_STATUS_FAILED = 6, + TRADE_STATUS_NOT_ENOUGH_CURRENCY = 7, + TRADE_STATUS_TARGET_LOGGING_OUT = 8, + TRADE_STATUS_PROPOSED = 9, + TRADE_STATUS_RESTRICTED_ACCOUNT = 10, + TRADE_STATUS_WRONG_REALM = 12, + TRADE_STATUS_ALREADY_TRADING = 14, + TRADE_STATUS_COMPLETE = 15, + TRADE_STATUS_TARGET_STUNNED = 16, + TRADE_STATUS_ACCEPTED = 17, + TRADE_STATUS_NO_TARGET = 18, + TRADE_STATUS_CURRENCY_NOT_TRADABLE = 19, + TRADE_STATUS_WRONG_FACTION = 20, + TRADE_STATUS_NOT_ON_TAPLIST = 21, + TRADE_STATUS_UNACCEPTED = 23, + TRADE_STATUS_LOGGING_OUT = 24, + TRADE_STATUS_CANCELLED = 26, + TRADE_STATUS_TOO_FAR_AWAY = 27, + TRADE_STATUS_DEAD = 28, + TRADE_STATUS_INITIATED = 29, + TRADE_STATUS_PLAYER_BUSY = 30 }; enum XPColorChar diff --git a/src/server/game/Movement/MovementStructures.h b/src/server/game/Movement/MovementStructures.h index 96d85a6fd0e..9b54c6fc5a0 100644 --- a/src/server/game/Movement/MovementStructures.h +++ b/src/server/game/Movement/MovementStructures.h @@ -1,20 +1,20 @@ /* -* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> -* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at your -* option) any later version. -* -* This program is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with this program. If not, see <http://www.gnu.org/licenses/>. -*/ + * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ #ifndef _MOVEMENT_STRUCTURES_H #define _MOVEMENT_STRUCTURES_H diff --git a/src/server/game/Scripting/ScriptSystem.h b/src/server/game/Scripting/ScriptSystem.h index 74c51e5b136..8349e0a2924 100644 --- a/src/server/game/Scripting/ScriptSystem.h +++ b/src/server/game/Scripting/ScriptSystem.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> -* This program is free software licensed under GPL version 2 -* Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ #ifndef SC_SYSTEM_H #define SC_SYSTEM_H diff --git a/src/server/game/Server/Packets/BlackMarketPackets.cpp b/src/server/game/Server/Packets/BlackMarketPackets.cpp index 5a4bad63d65..b18ef2fca74 100644 --- a/src/server/game/Server/Packets/BlackMarketPackets.cpp +++ b/src/server/game/Server/Packets/BlackMarketPackets.cpp @@ -1,19 +1,19 @@ /* -* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at your -* option) any later version. -* -* This program is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with this program. If not, see <http://www.gnu.org/licenses/>. -*/ + * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ #include "BlackMarketPackets.h" diff --git a/src/server/game/Server/Packets/BlackMarketPackets.h b/src/server/game/Server/Packets/BlackMarketPackets.h index 9c04a639fc0..ea202c16ead 100644 --- a/src/server/game/Server/Packets/BlackMarketPackets.h +++ b/src/server/game/Server/Packets/BlackMarketPackets.h @@ -1,19 +1,19 @@ /* -* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at your -* option) any later version. -* -* This program is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with this program. If not, see <http://www.gnu.org/licenses/>. -*/ + * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ #ifndef BlackMarketPackets_h__ #define BlackMarketPackets_h__ diff --git a/src/server/game/Server/Packets/ChannelPackets.h b/src/server/game/Server/Packets/ChannelPackets.h index 90e4e96accb..ca47c76edc9 100644 --- a/src/server/game/Server/Packets/ChannelPackets.h +++ b/src/server/game/Server/Packets/ChannelPackets.h @@ -1,19 +1,19 @@ /* -* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at your -* option) any later version. -* -* This program is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with this program. If not, see <http://www.gnu.org/licenses/>. -*/ + * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ #ifndef ChannelPackets_h__ #define ChannelPackets_h__ diff --git a/src/server/game/Server/Packets/CombatPackets.cpp b/src/server/game/Server/Packets/CombatPackets.cpp index 5d0a499e80b..e5100450b55 100644 --- a/src/server/game/Server/Packets/CombatPackets.cpp +++ b/src/server/game/Server/Packets/CombatPackets.cpp @@ -191,3 +191,9 @@ WorldPacket const* WorldPackets::Combat::HealthUpdate::Write() return &_worldPacket; } + +WorldPacket const* WorldPackets::Combat::ThreatClear::Write() +{ + _worldPacket << UnitGUID; + return &_worldPacket; +} diff --git a/src/server/game/Server/Packets/CombatPackets.h b/src/server/game/Server/Packets/CombatPackets.h index 40b1ad56adb..0cab58044eb 100644 --- a/src/server/game/Server/Packets/CombatPackets.h +++ b/src/server/game/Server/Packets/CombatPackets.h @@ -236,6 +236,16 @@ namespace WorldPackets ObjectGuid Guid; int32 Health = 0; }; + + class ThreatClear final : public ServerPacket + { + public: + ThreatClear() : ServerPacket(SMSG_THREAT_CLEAR, 16) { } + + WorldPacket const* Write() override; + + ObjectGuid UnitGUID; + }; } } diff --git a/src/server/game/Server/Packets/LootPackets.cpp b/src/server/game/Server/Packets/LootPackets.cpp index 497cb21fe17..029196d22f7 100644 --- a/src/server/game/Server/Packets/LootPackets.cpp +++ b/src/server/game/Server/Packets/LootPackets.cpp @@ -113,3 +113,11 @@ void WorldPackets::Loot::LootRoll::Read() _worldPacket >> LootListID; _worldPacket >> RollType; } + +WorldPacket const* WorldPackets::Loot::LootReleaseResponse::Write() +{ + _worldPacket << LootObj; + _worldPacket << Owner; + + return &_worldPacket; +} diff --git a/src/server/game/Server/Packets/LootPackets.h b/src/server/game/Server/Packets/LootPackets.h index 0f6dfe3d032..fd8f545a19f 100644 --- a/src/server/game/Server/Packets/LootPackets.h +++ b/src/server/game/Server/Packets/LootPackets.h @@ -155,6 +155,17 @@ namespace WorldPackets uint8 LootListID = 0; uint8 RollType = 0; }; + + class LootReleaseResponse final : public ServerPacket + { + public: + LootReleaseResponse() : ServerPacket(SMSG_LOOT_RELEASE, 32) { } + + WorldPacket const* Write() override; + + ObjectGuid LootObj; + ObjectGuid Owner; + }; } } diff --git a/src/server/game/Server/Packets/MiscPackets.cpp b/src/server/game/Server/Packets/MiscPackets.cpp index 009f1d901d5..a67a0669b35 100644 --- a/src/server/game/Server/Packets/MiscPackets.cpp +++ b/src/server/game/Server/Packets/MiscPackets.cpp @@ -406,3 +406,10 @@ WorldPacket const* WorldPackets::Misc::PhaseShift::Write() return &_worldPacket; } + +WorldPacket const* WorldPackets::Misc::ZoneUnderAttack::Write() +{ + _worldPacket << int32(AreaID); + + return &_worldPacket; +} diff --git a/src/server/game/Server/Packets/MiscPackets.h b/src/server/game/Server/Packets/MiscPackets.h index 31779f093d2..4d21b8a3285 100644 --- a/src/server/game/Server/Packets/MiscPackets.h +++ b/src/server/game/Server/Packets/MiscPackets.h @@ -553,6 +553,16 @@ namespace WorldPackets std::set<uint32> UiWorldMapAreaIDSwaps; std::set<uint32> VisibleMapIDs; }; + + class ZoneUnderAttack final : public ServerPacket + { + public: + ZoneUnderAttack() : ServerPacket(SMSG_ZONE_UNDER_ATTACK, 4) { } + + WorldPacket const* Write() override; + + int32 AreaID = 0; + }; } } diff --git a/src/server/game/Server/Packets/MovementPackets.cpp b/src/server/game/Server/Packets/MovementPackets.cpp index 836c00b70ca..0733bc5dbc0 100644 --- a/src/server/game/Server/Packets/MovementPackets.cpp +++ b/src/server/game/Server/Packets/MovementPackets.cpp @@ -56,6 +56,8 @@ ByteBuffer& operator<<(ByteBuffer& data, MovementInfo& movementInfo) data.WriteBit(0); // HeightChangeFailed data.WriteBit(0); // RemoteTimeValid + data.FlushBits(); + if (hasTransportData) data << movementInfo.transport; @@ -65,6 +67,7 @@ ByteBuffer& operator<<(ByteBuffer& data, MovementInfo& movementInfo) data << movementInfo.jump.zspeed; data.WriteBit(hasFallDirection); + data.FlushBits(); if (hasFallDirection) { data << movementInfo.jump.sinAngle; @@ -73,8 +76,6 @@ ByteBuffer& operator<<(ByteBuffer& data, MovementInfo& movementInfo) } } - data.FlushBits(); - return data; } @@ -167,14 +168,14 @@ ByteBuffer& operator<<(ByteBuffer& data, MovementInfo::TransportInfo const& tran data.WriteBit(hasPrevTime); data.WriteBit(hasVehicleId); + data.FlushBits(); + if (hasPrevTime) data << transportInfo.prevTime; // PrevMoveTime if (hasVehicleId) data << transportInfo.vehicleId; // VehicleRecID - data.FlushBits(); - return data; } @@ -620,3 +621,10 @@ WorldPacket const* WorldPackets::Movement::MoveSetActiveMover::Write() return &_worldPacket; } + +WorldPacket const* WorldPackets::Movement::MoveUpdateKnockBack::Write() +{ + _worldPacket << *movementInfo; + + return &_worldPacket; +} diff --git a/src/server/game/Server/Packets/MovementPackets.h b/src/server/game/Server/Packets/MovementPackets.h index b84f3592d05..139f6077b0a 100644 --- a/src/server/game/Server/Packets/MovementPackets.h +++ b/src/server/game/Server/Packets/MovementPackets.h @@ -328,6 +328,16 @@ namespace WorldPackets ObjectGuid MoverGUID; }; + + class MoveUpdateKnockBack final : public ServerPacket + { + public: + MoveUpdateKnockBack() : ServerPacket(SMSG_MOVE_UPDATE_KNOCK_BACK) { } + + WorldPacket const* Write() override; + + MovementInfo* movementInfo = nullptr; + }; } ByteBuffer& operator<<(ByteBuffer& data, Movement::MonsterSplineFilterKey const& monsterSplineFilterKey); diff --git a/src/server/game/Server/Packets/PetitionPackets.cpp b/src/server/game/Server/Packets/PetitionPackets.cpp index 936dea3d3a4..ead92cc002c 100644 --- a/src/server/game/Server/Packets/PetitionPackets.cpp +++ b/src/server/game/Server/Packets/PetitionPackets.cpp @@ -1,19 +1,19 @@ /* -* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at your -* option) any later version. -* -* This program is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with this program. If not, see <http://www.gnu.org/licenses/>. -*/ + * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ #include "PetitionPackets.h" diff --git a/src/server/game/Server/Packets/PetitionPackets.h b/src/server/game/Server/Packets/PetitionPackets.h index 776d1262606..937a0d54cb2 100644 --- a/src/server/game/Server/Packets/PetitionPackets.h +++ b/src/server/game/Server/Packets/PetitionPackets.h @@ -1,19 +1,19 @@ /* -* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at your -* option) any later version. -* -* This program is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with this program. If not, see <http://www.gnu.org/licenses/>. -*/ + * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ #ifndef PetitionPackets_h__ #define PetitionPackets_h__ diff --git a/src/server/game/Server/Packets/ReferAFriendPackets.cpp b/src/server/game/Server/Packets/ReferAFriendPackets.cpp new file mode 100644 index 00000000000..0f3211936f6 --- /dev/null +++ b/src/server/game/Server/Packets/ReferAFriendPackets.cpp @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "ReferAFriendPackets.h" + +void WorldPackets::RaF::AcceptLevelGrant::Read() +{ + _worldPacket >> Granter; +} + +void WorldPackets::RaF::GrantLevel::Read() +{ + _worldPacket >> Target; +} + +WorldPacket const* WorldPackets::RaF::ProposeLevelGrant::Write() +{ + _worldPacket << Sender; + return &_worldPacket; +} + +WorldPacket const* WorldPackets::RaF::ReferAFriendFailure::Write() +{ + _worldPacket << int32(Reason); + // Client uses this string only if Reason == ERR_REFER_A_FRIEND_NOT_IN_GROUP || Reason == ERR_REFER_A_FRIEND_SUMMON_OFFLINE_S + // but always reads it from packet + _worldPacket.WriteBits(Str.length(), 6); + _worldPacket.WriteString(Str); + return &_worldPacket; +} diff --git a/src/server/game/Server/Packets/ReferAFriendPackets.h b/src/server/game/Server/Packets/ReferAFriendPackets.h new file mode 100644 index 00000000000..1becda0f107 --- /dev/null +++ b/src/server/game/Server/Packets/ReferAFriendPackets.h @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef ReferAFriendPackets_h__ +#define ReferAFriendPackets_h__ + +#include "Packet.h" +#include "ObjectGuid.h" + +namespace WorldPackets +{ + namespace RaF + { + class AcceptLevelGrant final : public ClientPacket + { + public: + AcceptLevelGrant(WorldPacket&& packet) : ClientPacket(CMSG_ACCEPT_LEVEL_GRANT, std::move(packet)) { } + + void Read() override; + + ObjectGuid Granter; + }; + + class GrantLevel final : public ClientPacket + { + public: + GrantLevel(WorldPacket&& packet) : ClientPacket(CMSG_GRANT_LEVEL, std::move(packet)) { } + + void Read() override; + + ObjectGuid Target; + }; + + class ProposeLevelGrant final : public ServerPacket + { + public: + ProposeLevelGrant() : ServerPacket(SMSG_PROPOSE_LEVEL_GRANT, 16) { } + + WorldPacket const* Write() override; + + ObjectGuid Sender; + }; + + class ReferAFriendFailure final : public ServerPacket + { + public: + ReferAFriendFailure() : ServerPacket(SMSG_REFER_A_FRIEND_FAILURE, 1 + 4) { } + + WorldPacket const* Write() override; + + std::string Str; + int32 Reason = 0; + }; + } +} + +#endif // ReferAFriendPackets_h__ diff --git a/src/server/game/Server/Packets/SpellPackets.cpp b/src/server/game/Server/Packets/SpellPackets.cpp index 4dfbd67f44f..01164039420 100644 --- a/src/server/game/Server/Packets/SpellPackets.cpp +++ b/src/server/game/Server/Packets/SpellPackets.cpp @@ -482,19 +482,22 @@ WorldPacket const* WorldPackets::Spells::UnlearnedSpells::Write() WorldPacket const* WorldPackets::Spells::CooldownEvent::Write() { - _worldPacket << CasterGUID; _worldPacket << int32(SpellID); + _worldPacket.WriteBit(IsPet); + _worldPacket.FlushBits(); return &_worldPacket; } WorldPacket const* WorldPackets::Spells::ClearCooldowns::Write() { - _worldPacket << Guid; _worldPacket << uint32(SpellID.size()); if (!SpellID.empty()) _worldPacket.append(SpellID.data(), SpellID.size()); + _worldPacket.WriteBit(IsPet); + _worldPacket.FlushBits(); + return &_worldPacket; } @@ -502,7 +505,7 @@ WorldPacket const* WorldPackets::Spells::ClearCooldown::Write() { _worldPacket << uint32(SpellID); _worldPacket.WriteBit(ClearOnHold); - _worldPacket.WriteBit(Unk20); + _worldPacket.WriteBit(IsPet); _worldPacket.FlushBits(); return &_worldPacket; @@ -511,8 +514,9 @@ WorldPacket const* WorldPackets::Spells::ClearCooldown::Write() WorldPacket const* WorldPackets::Spells::ModifyCooldown::Write() { _worldPacket << int32(SpellID); - _worldPacket << UnitGUID; _worldPacket << int32(DeltaTime); + _worldPacket.WriteBit(IsPet); + _worldPacket.FlushBits(); return &_worldPacket; } @@ -559,15 +563,17 @@ WorldPacket const* WorldPackets::Spells::SendSpellHistory::Write() WorldPacket const* WorldPackets::Spells::ClearAllSpellCharges::Write() { - _worldPacket << Unit; + _worldPacket.WriteBit(IsPet); + _worldPacket.FlushBits(); return &_worldPacket; } WorldPacket const* WorldPackets::Spells::ClearSpellCharges::Write() { - _worldPacket << Unit; _worldPacket << int32(Category); + _worldPacket.WriteBit(IsPet); + _worldPacket.FlushBits(); return &_worldPacket; } @@ -632,3 +638,42 @@ void WorldPackets::Spells::OpenItem::Read() _worldPacket >> Slot >> PackSlot; } + +ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Spells::SpellChannelStartInterruptImmunities const& interruptImmunities) +{ + data << int32(interruptImmunities.SchoolImmunities); + data << int32(interruptImmunities.Immunities); + return data; +} + +ByteBuffer& operator<<(ByteBuffer& data, WorldPackets::Spells::SpellTargetedHealPrediction const& targetedHealPrediction) +{ + data << targetedHealPrediction.TargetGUID; + data << targetedHealPrediction.Predict; + return data; +} + +WorldPacket const* WorldPackets::Spells::SpellChannelStart::Write() +{ + _worldPacket << CasterGUID; + _worldPacket << int32(SpellID); + _worldPacket << uint32(ChannelDuration); + _worldPacket.WriteBit(InterruptImmunities.HasValue); + _worldPacket.WriteBit(HealPrediction.HasValue); + _worldPacket.FlushBits(); + + if (InterruptImmunities.HasValue) + _worldPacket << InterruptImmunities.Value; + + if (HealPrediction.HasValue) + _worldPacket << HealPrediction.Value; + + return &_worldPacket; +} + +WorldPacket const* WorldPackets::Spells::SpellChannelUpdate::Write() +{ + _worldPacket << CasterGUID; + _worldPacket << int32(TimeRemaining); + return &_worldPacket; +} diff --git a/src/server/game/Server/Packets/SpellPackets.h b/src/server/game/Server/Packets/SpellPackets.h index bb7253c22dc..86bbf76b0c0 100644 --- a/src/server/game/Server/Packets/SpellPackets.h +++ b/src/server/game/Server/Packets/SpellPackets.h @@ -412,46 +412,46 @@ namespace WorldPackets class CooldownEvent final : public ServerPacket { public: - CooldownEvent() : ServerPacket(SMSG_COOLDOWN_EVENT, 16 + 4) { } - CooldownEvent(ObjectGuid casterGuid, int32 spellId) : ServerPacket(SMSG_COOLDOWN_EVENT, 16 + 4), CasterGUID(casterGuid), SpellID(spellId) { } + CooldownEvent() : ServerPacket(SMSG_COOLDOWN_EVENT, 1 + 4) { } + CooldownEvent(bool isPet, int32 spellId) : ServerPacket(SMSG_COOLDOWN_EVENT, 16 + 4), IsPet(isPet), SpellID(spellId) { } WorldPacket const* Write() override; - ObjectGuid CasterGUID; + bool IsPet = false; int32 SpellID; }; class ClearCooldowns final : public ServerPacket { public: - ClearCooldowns() : ServerPacket(SMSG_CLEAR_COOLDOWNS, 4 + 16) { } + ClearCooldowns() : ServerPacket(SMSG_CLEAR_COOLDOWNS, 4 + 1) { } WorldPacket const* Write() override; std::vector<int32> SpellID; - ObjectGuid Guid; + bool IsPet = false; }; class ClearCooldown final : public ServerPacket { public: - ClearCooldown() : ServerPacket(SMSG_CLEAR_COOLDOWN, 16 + 4 + 1) { } + ClearCooldown() : ServerPacket(SMSG_CLEAR_COOLDOWN, 1 + 4 + 1) { } WorldPacket const* Write() override; + bool IsPet = false; int32 SpellID = 0; bool ClearOnHold = false; - bool Unk20 = false; }; class ModifyCooldown final : public ServerPacket { public: - ModifyCooldown() : ServerPacket(SMSG_MODIFY_COOLDOWN, 16 + 4 + 4) { } + ModifyCooldown() : ServerPacket(SMSG_MODIFY_COOLDOWN, 1 + 4 + 4) { } WorldPacket const* Write() override; - ObjectGuid UnitGUID; + bool IsPet = false; int32 DeltaTime = 0; int32 SpellID = 0; }; @@ -500,21 +500,21 @@ namespace WorldPackets class ClearAllSpellCharges final : public ServerPacket { public: - ClearAllSpellCharges() : ServerPacket(SMSG_CLEAR_ALL_SPELL_CHARGES, 16) { } + ClearAllSpellCharges() : ServerPacket(SMSG_CLEAR_ALL_SPELL_CHARGES, 1) { } WorldPacket const* Write() override; - ObjectGuid Unit; + bool IsPet = false; }; class ClearSpellCharges final : public ServerPacket { public: - ClearSpellCharges() : ServerPacket(SMSG_CLEAR_SPELL_CHARGES, 20) { } + ClearSpellCharges() : ServerPacket(SMSG_CLEAR_SPELL_CHARGES, 1 + 4) { } WorldPacket const* Write() override; - ObjectGuid Unit; + bool IsPet = false; int32 Category = 0; }; @@ -599,6 +599,43 @@ namespace WorldPackets uint8 Slot = 0; uint8 PackSlot = 0; }; + + struct SpellChannelStartInterruptImmunities + { + int32 SchoolImmunities = 0; + int32 Immunities = 0; + }; + + struct SpellTargetedHealPrediction + { + ObjectGuid TargetGUID; + SpellHealPrediction Predict; + }; + + class SpellChannelStart final : public ServerPacket + { + public: + SpellChannelStart() : ServerPacket(SMSG_SPELL_CHANNEL_START, 4 + 16 + 4) { } + + WorldPacket const* Write() override; + + int32 SpellID = 0; + Optional<SpellChannelStartInterruptImmunities> InterruptImmunities; + ObjectGuid CasterGUID; + Optional<SpellTargetedHealPrediction> HealPrediction; + uint32 ChannelDuration = 0; + }; + + class SpellChannelUpdate final : public ServerPacket + { + public: + SpellChannelUpdate() : ServerPacket(SMSG_SPELL_CHANNEL_UPDATE, 16 + 4) { } + + WorldPacket const* Write() override; + + ObjectGuid CasterGUID; + int32 TimeRemaining = 0; + }; } } diff --git a/src/server/game/Server/Packets/TradePackets.cpp b/src/server/game/Server/Packets/TradePackets.cpp new file mode 100644 index 00000000000..ef5ebb13e20 --- /dev/null +++ b/src/server/game/Server/Packets/TradePackets.cpp @@ -0,0 +1,129 @@ +/* + * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "TradePackets.h" + +void WorldPackets::Trade::AcceptTrade::Read() +{ + _worldPacket >> StateIndex; +} + +void WorldPackets::Trade::ClearTradeItem::Read() +{ + _worldPacket >> TradeSlot; +} + +void WorldPackets::Trade::InitiateTrade::Read() +{ + _worldPacket >> Guid; +} + +void WorldPackets::Trade::SetTradeCurrency::Read() +{ + _worldPacket >> Type >> Quantity; +} + +void WorldPackets::Trade::SetTradeGold::Read() +{ + _worldPacket >> Coinage; +} + +void WorldPackets::Trade::SetTradeItem::Read() +{ + _worldPacket >> TradeSlot >> PackSlot >> ItemSlotInPack; +} + +WorldPacket const* WorldPackets::Trade::TradeStatus::Write() +{ + _worldPacket.WriteBit(PartnerIsSameBnetAccount); + _worldPacket.WriteBits(Status, 5); + switch (Status) + { + case TRADE_STATUS_FAILED: + _worldPacket.WriteBit(FailureForYou); + _worldPacket << int32(BagResult); + _worldPacket << int32(ItemID); + break; + case TRADE_STATUS_INITIATED: + _worldPacket << uint32(ID); + break; + case TRADE_STATUS_PROPOSED: + _worldPacket << Partner; + _worldPacket << PartnerAccount; + break; + case TRADE_STATUS_WRONG_REALM: + case TRADE_STATUS_NOT_ON_TAPLIST: + _worldPacket << uint8(TradeSlot); + break; + case TRADE_STATUS_NOT_ENOUGH_CURRENCY: + case TRADE_STATUS_CURRENCY_NOT_TRADABLE: + _worldPacket << int32(CurrencyType); + _worldPacket << int32(CurrencyQuantity); + break; + default: + _worldPacket.FlushBits(); + break; + } + + return &_worldPacket; +} + +ByteBuffer& operator<<(ByteBuffer& buffer, WorldPackets::Trade::TradeUpdated::UnwrappedTradeItem const& unwrappedTradeItem) +{ + buffer << unwrappedTradeItem.Item; + buffer << int32(unwrappedTradeItem.EnchantID); + buffer << int32(unwrappedTradeItem.OnUseEnchantmentID); + buffer.append(unwrappedTradeItem.SocketEnchant, MAX_GEM_SOCKETS); + buffer << unwrappedTradeItem.Creator; + buffer << int32(unwrappedTradeItem.Charges); + buffer << uint32(unwrappedTradeItem.MaxDurability); + buffer << uint32(unwrappedTradeItem.Durability); + buffer.WriteBit(unwrappedTradeItem.Lock); + buffer.FlushBits(); + + return buffer; +} + +ByteBuffer& operator<<(ByteBuffer& buffer, WorldPackets::Trade::TradeUpdated::TradeItem const& tradeItem) +{ + buffer << uint8(tradeItem.Slot); + buffer << uint32(tradeItem.EntryID); + buffer << uint32(tradeItem.StackCount); + buffer << tradeItem.GiftCreator; + if (buffer.WriteBit(tradeItem.Unwrapped.HasValue)) + buffer << tradeItem.Unwrapped.Value; + + return buffer; +} + +WorldPacket const* WorldPackets::Trade::TradeUpdated::Write() +{ + _worldPacket << uint8(WhichPlayer); + _worldPacket << uint32(ID); + _worldPacket << uint32(ClientStateIndex); + _worldPacket << uint32(CurrentStateIndex); + _worldPacket << uint64(Gold); + _worldPacket << int32(CurrencyType); + _worldPacket << int32(CurrencyQuantity); + _worldPacket << int32(ProposedEnchantment); + _worldPacket << uint32(Items.size()); + + for (TradeItem const& item : Items) + _worldPacket << item; + + return &_worldPacket; +} diff --git a/src/server/game/Server/Packets/TradePackets.h b/src/server/game/Server/Packets/TradePackets.h index b964a24e6fe..5ac2c44bc41 100644 --- a/src/server/game/Server/Packets/TradePackets.h +++ b/src/server/game/Server/Packets/TradePackets.h @@ -1,29 +1,55 @@ /* -* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at your -* option) any later version. -* -* This program is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with this program. If not, see <http://www.gnu.org/licenses/>. -*/ + * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ #ifndef TradePackets_h__ #define TradePackets_h__ -#include "Packet.h" +#include "ItemPackets.h" namespace WorldPackets { namespace Trade { + class AcceptTrade final : public ClientPacket + { + public: + AcceptTrade(WorldPacket&& packet) : ClientPacket(CMSG_ACCEPT_TRADE, std::move(packet)) { } + + void Read() override; + + uint32 StateIndex = 0; + }; + + class BeginTrade final : public ClientPacket + { + public: + BeginTrade(WorldPacket&& packet) : ClientPacket(CMSG_BEGIN_TRADE, std::move(packet)) { } + + void Read() override { } + }; + + class BusyTrade final : public ClientPacket + { + public: + BusyTrade(WorldPacket&& packet) : ClientPacket(CMSG_BUSY_TRADE, std::move(packet)) { } + + void Read() override { } + }; + class CancelTrade final : public ClientPacket { public: @@ -31,6 +57,135 @@ namespace WorldPackets void Read() override { } }; + + class ClearTradeItem final : public ClientPacket + { + public: + ClearTradeItem(WorldPacket&& packet) : ClientPacket(CMSG_CLEAR_TRADE_ITEM, std::move(packet)) { } + + void Read() override; + + uint8 TradeSlot = 0; + }; + + class IgnoreTrade final : public ClientPacket + { + public: + IgnoreTrade(WorldPacket&& packet) : ClientPacket(CMSG_IGNORE_TRADE, std::move(packet)) { } + + void Read() override { } + }; + + class InitiateTrade final : public ClientPacket + { + public: + InitiateTrade(WorldPacket&& packet) : ClientPacket(CMSG_INITIATE_TRADE, std::move(packet)) { } + + void Read() override; + + ObjectGuid Guid; + }; + + class SetTradeCurrency final : public ClientPacket + { + public: + SetTradeCurrency(WorldPacket&& packet) : ClientPacket(CMSG_SET_TRADE_CURRENCY, std::move(packet)) { } + + void Read() override; + + uint32 Type = 0; + uint32 Quantity = 0; + }; + + class SetTradeGold final : public ClientPacket + { + public: + SetTradeGold(WorldPacket&& packet) : ClientPacket(CMSG_SET_TRADE_GOLD, std::move(packet)) { } + + void Read() override; + + uint64 Coinage = 0; + }; + + class SetTradeItem final : public ClientPacket + { + public: + SetTradeItem(WorldPacket&& packet) : ClientPacket(CMSG_SET_TRADE_ITEM, std::move(packet)) { } + + void Read() override; + + uint8 TradeSlot = 0; + uint8 PackSlot = 0; + uint8 ItemSlotInPack = 0; + }; + + class UnacceptTrade final : public ClientPacket + { + public: + UnacceptTrade(WorldPacket&& packet) : ClientPacket(CMSG_UNACCEPT_TRADE, std::move(packet)) { } + + void Read() override { } + }; + + class TradeStatus final : public ServerPacket + { + public: + TradeStatus() : ServerPacket(SMSG_TRADE_STATUS, 1 + 1 + 16 + 4 + 4 + 1 + 4 + 4 + 4 + 1) { } + + WorldPacket const* Write() override; + + ::TradeStatus Status = TRADE_STATUS_INITIATED; + uint8 TradeSlot = 0; + ObjectGuid PartnerAccount; + ObjectGuid Partner; + int32 CurrencyType = 0; + int32 CurrencyQuantity = 0; + bool FailureForYou = false; + int32 BagResult = 0; + uint32 ItemID = 0; + uint32 ID = 0; + bool PartnerIsSameBnetAccount = false; + }; + + class TradeUpdated final : public ServerPacket + { + public: + struct UnwrappedTradeItem + { + WorldPackets::Item::ItemInstance Item; + int32 EnchantID = 0; + int32 OnUseEnchantmentID = 0; + ObjectGuid Creator; + int32 Charges = 0; + bool Lock = false; + uint32 MaxDurability = 0; + uint32 Durability = 0; + int32 SocketEnchant[MAX_GEM_SOCKETS] = { }; + }; + + struct TradeItem + { + uint8 Slot = 0; + int32 EntryID = 0; + int32 StackCount = 0; + ObjectGuid GiftCreator; + Optional<UnwrappedTradeItem> Unwrapped; + }; + + TradeUpdated() : ServerPacket(SMSG_TRADE_UPDATED, 8 + 4 + 1 + 4 + 7 * sizeof(UnwrappedTradeItem) + 4 + 4 + 4 + 4) { } + + WorldPacket const* Write() override; + + uint64 Gold = 0; + uint32 CurrentStateIndex = 0; + uint8 WhichPlayer = 0; + uint32 ClientStateIndex = 0; + std::vector<TradeItem> Items; + int32 CurrencyType = 0; + uint32 ID = 0; + int32 ProposedEnchantment = 0; + int32 CurrencyQuantity = 0; + }; } } diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index a820840de0c..b2ef7123ef8 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -41,6 +41,7 @@ #include "Packets/PetitionPackets.h" #include "Packets/QueryPackets.h" #include "Packets/QuestPackets.h" +#include "Packets/ReferAFriendPackets.h" #include "Packets/SocialPackets.h" #include "Packets/TalentPackets.h" #include "Packets/TradePackets.h" @@ -144,8 +145,8 @@ void OpcodeTable::Initialize() DEFINE_HANDLER(opcode, status, processing, WorldPacket, handler); DEFINE_HANDLER(CMSG_ACCEPT_GUILD_INVITE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, WorldPackets::Guild::AcceptGuildInvite, &WorldSession::HandleGuildAcceptInvite); - DEFINE_OPCODE_HANDLER_OLD(CMSG_ACCEPT_LEVEL_GRANT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleAcceptGrantLevel ); - DEFINE_OPCODE_HANDLER_OLD(CMSG_ACCEPT_TRADE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleAcceptTradeOpcode ); + DEFINE_HANDLER(CMSG_ACCEPT_LEVEL_GRANT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::RaF::AcceptLevelGrant, &WorldSession::HandleAcceptGrantLevel ); + DEFINE_HANDLER(CMSG_ACCEPT_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Trade::AcceptTrade, &WorldSession::HandleAcceptTradeOpcode); DEFINE_OPCODE_HANDLER_OLD(CMSG_ACCEPT_WARGAME_INVITE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER_OLD(CMSG_ACTIVATE_TAXI, STATUS_UNHANDLED, PROCESS_THREADSAFE, &WorldSession::HandleActivateTaxiOpcode ); DEFINE_OPCODE_HANDLER_OLD(CMSG_ADD_BATTLENET_FRIEND, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -200,7 +201,7 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER_OLD(CMSG_BATTLE_PET_SET_FLAGS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER_OLD(CMSG_BATTLE_PET_SUMMON, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER_OLD(CMSG_BATTLE_PET_UPDATE_NOTIFY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER_OLD(CMSG_BEGIN_TRADE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleBeginTradeOpcode ); + DEFINE_HANDLER(CMSG_BEGIN_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Trade::BeginTrade, &WorldSession::HandleBeginTradeOpcode ); DEFINE_OPCODE_HANDLER_OLD(CMSG_BF_MGR_ENTRY_INVITE_RESPONSE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::HandleBfEntryInviteResponse ); DEFINE_OPCODE_HANDLER_OLD(CMSG_BF_MGR_QUEUE_EXIT_REQUEST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::HandleBfExitRequest); DEFINE_OPCODE_HANDLER_OLD(CMSG_BF_MGR_QUEUE_INVITE_RESPONSE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::HandleBfQueueInviteResponse ); @@ -210,7 +211,7 @@ void OpcodeTable::Initialize() DEFINE_HANDLER(CMSG_BLACK_MARKET_OPEN, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, WorldPackets::BlackMarket::BlackMarketOpen, &WorldSession::HandleBlackMarketOpen); DEFINE_OPCODE_HANDLER_OLD(CMSG_BLACK_MARKET_REQUEST_ITEMS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER_OLD(CMSG_BUG_REPORT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleBugReportOpcode ); - DEFINE_OPCODE_HANDLER_OLD(CMSG_BUSY_TRADE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleBusyTradeOpcode ); + DEFINE_HANDLER(CMSG_BUSY_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Trade::BusyTrade, &WorldSession::HandleBusyTradeOpcode); DEFINE_HANDLER(CMSG_BUY_BACK_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Item::BuyBackItem, &WorldSession::HandleBuybackItem); DEFINE_HANDLER(CMSG_BUY_BANK_SLOT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Bank::BuyBankSlot, &WorldSession::HandleBuyBankSlotOpcode); DEFINE_HANDLER(CMSG_BUY_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Item::BuyItem, &WorldSession::HandleBuyItemOpcode); @@ -307,8 +308,8 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER_OLD(CMSG_CHECK_WOW_TOKEN_VETERAN_ELIGIBILITY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER_OLD(CMSG_CHOICE_RESPONSE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER_OLD(CMSG_CLEAR_RAID_MARKER, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER_OLD(CMSG_CLEAR_TRADE_ITEM, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleClearTradeItemOpcode ); - DEFINE_HANDLER(CMSG_CLIENT_PORT_GRAVEYARD, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, WorldPackets::Misc::PortGraveyard, &WorldSession::HandlePortGraveyard); + DEFINE_HANDLER(CMSG_CLEAR_TRADE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Trade::ClearTradeItem, &WorldSession::HandleClearTradeItemOpcode); + DEFINE_HANDLER(CMSG_CLIENT_PORT_GRAVEYARD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Misc::PortGraveyard, &WorldSession::HandlePortGraveyard); DEFINE_OPCODE_HANDLER_OLD(CMSG_CLOSE_INTERACTION, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER_OLD(CMSG_COMMENTATOR_ENABLE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER_OLD(CMSG_COMMENTATOR_ENTER_INSTANCE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -400,7 +401,7 @@ void OpcodeTable::Initialize() DEFINE_HANDLER(CMSG_GM_TICKET_RESPONSE_RESOLVE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Ticket::GMTicketResponseResolve, &WorldSession::HandleGMResponseResolve); DEFINE_HANDLER(CMSG_GM_TICKET_UPDATE_TEXT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Ticket::GMTicketUpdateText, &WorldSession::HandleGMTicketUpdateTextOpcode); DEFINE_HANDLER(CMSG_GOSSIP_SELECT_OPTION, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::NPC::GossipSelectOption, &WorldSession::HandleGossipSelectOptionOpcode); - DEFINE_OPCODE_HANDLER_OLD(CMSG_GRANT_LEVEL, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleGrantLevel ); + DEFINE_HANDLER(CMSG_GRANT_LEVEL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::RaF::GrantLevel, &WorldSession::HandleGrantLevel ); DEFINE_OPCODE_HANDLER_OLD(CMSG_GUILD_ADD_BATTLENET_FRIEND, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_HANDLER(CMSG_GUILD_ADD_RANK, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, WorldPackets::Guild::GuildAddRank, &WorldSession::HandleGuildAddRank); DEFINE_HANDLER(CMSG_GUILD_ASSIGN_MEMBER_RANK, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, WorldPackets::Guild::GuildAssignMemberRank, &WorldSession::HandleGuildAssignRank); @@ -447,10 +448,10 @@ void OpcodeTable::Initialize() DEFINE_HANDLER(CMSG_GUILD_UPDATE_INFO_TEXT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, WorldPackets::Guild::GuildUpdateInfoText, &WorldSession::HandleGuildUpdateInfoText); DEFINE_HANDLER(CMSG_GUILD_UPDATE_MOTD_TEXT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, WorldPackets::Guild::GuildUpdateMotdText, &WorldSession::HandleGuildUpdateMotdText); DEFINE_OPCODE_HANDLER_OLD(CMSG_HEARTH_AND_RESURRECT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleHearthAndResurrect ); - DEFINE_OPCODE_HANDLER_OLD(CMSG_IGNORE_TRADE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleIgnoreTradeOpcode ); + DEFINE_HANDLER(CMSG_IGNORE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Trade::IgnoreTrade, &WorldSession::HandleIgnoreTradeOpcode); DEFINE_OPCODE_HANDLER_OLD(CMSG_INCREASE_CAST_TIME_FOR_SPELL, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER_OLD(CMSG_INITIATE_ROLE_POLL, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleRolePollBeginOpcode); - DEFINE_OPCODE_HANDLER_OLD(CMSG_INITIATE_TRADE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleInitiateTradeOpcode ); + DEFINE_HANDLER(CMSG_INITIATE_TRADE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Trade::InitiateTrade, &WorldSession::HandleInitiateTradeOpcode); DEFINE_HANDLER(CMSG_INSPECT, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, WorldPackets::Inspect::Inspect, &WorldSession::HandleInspectOpcode); DEFINE_HANDLER(CMSG_INSPECT_PVP, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, WorldPackets::Inspect::InspectPVPRequest, &WorldSession::HandleInspectPVP); DEFINE_OPCODE_HANDLER_OLD(CMSG_INSTANCE_LOCK_RESPONSE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleInstanceLockResponse); @@ -497,13 +498,13 @@ void OpcodeTable::Initialize() DEFINE_HANDLER(CMSG_LOOT_UNIT, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Loot::LootUnit, &WorldSession::HandleLootOpcode); DEFINE_OPCODE_HANDLER_OLD(CMSG_LOW_LEVEL_RAID1, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER_OLD(CMSG_LOW_LEVEL_RAID2, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_HANDLER(CMSG_MAIL_CREATE_TEXT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Mail::MailCreateTextItem, &WorldSession::HandleMailCreateTextItem); - DEFINE_HANDLER(CMSG_MAIL_DELETE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Mail::MailDelete, &WorldSession::HandleMailDelete); - DEFINE_HANDLER(CMSG_MAIL_GET_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Mail::MailGetList, &WorldSession::HandleGetMailList); - DEFINE_HANDLER(CMSG_MAIL_MARK_AS_READ, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Mail::MailMarkAsRead, &WorldSession::HandleMailMarkAsRead); - DEFINE_HANDLER(CMSG_MAIL_RETURN_TO_SENDER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Mail::MailReturnToSender, &WorldSession::HandleMailReturnToSender); - DEFINE_HANDLER(CMSG_MAIL_TAKE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Mail::MailTakeItem, &WorldSession::HandleMailTakeItem); - DEFINE_HANDLER(CMSG_MAIL_TAKE_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Mail::MailTakeMoney, &WorldSession::HandleMailTakeMoney); + DEFINE_HANDLER(CMSG_MAIL_CREATE_TEXT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Mail::MailCreateTextItem, &WorldSession::HandleMailCreateTextItem); + DEFINE_HANDLER(CMSG_MAIL_DELETE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Mail::MailDelete, &WorldSession::HandleMailDelete); + DEFINE_HANDLER(CMSG_MAIL_GET_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Mail::MailGetList, &WorldSession::HandleGetMailList); + DEFINE_HANDLER(CMSG_MAIL_MARK_AS_READ, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Mail::MailMarkAsRead, &WorldSession::HandleMailMarkAsRead); + DEFINE_HANDLER(CMSG_MAIL_RETURN_TO_SENDER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Mail::MailReturnToSender, &WorldSession::HandleMailReturnToSender); + DEFINE_HANDLER(CMSG_MAIL_TAKE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Mail::MailTakeItem, &WorldSession::HandleMailTakeItem); + DEFINE_HANDLER(CMSG_MAIL_TAKE_MONEY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Mail::MailTakeMoney, &WorldSession::HandleMailTakeMoney); DEFINE_OPCODE_HANDLER_OLD(CMSG_MASTER_LOOT_ITEM, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleLootMasterGiveOpcode ); DEFINE_OPCODE_HANDLER_OLD(CMSG_MINIMAP_PING, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleMinimapPingOpcode ); DEFINE_OPCODE_HANDLER_OLD(CMSG_MISSILE_TRAJECTORY_COLLISION, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleUpdateProjectilePosition ); @@ -534,7 +535,7 @@ void OpcodeTable::Initialize() DEFINE_HANDLER(CMSG_MOVE_HEARTBEAT, STATUS_LOGGEDIN, PROCESS_THREADSAFE, WorldPackets::Movement::ClientPlayerMovement, &WorldSession::HandleMovementOpcodes); DEFINE_OPCODE_HANDLER_OLD(CMSG_MOVE_HOVER_ACK, STATUS_UNHANDLED, PROCESS_THREADSAFE, &WorldSession::HandleMoveHoverAck ); DEFINE_HANDLER(CMSG_MOVE_JUMP, STATUS_LOGGEDIN, PROCESS_THREADSAFE, WorldPackets::Movement::ClientPlayerMovement, &WorldSession::HandleMovementOpcodes); - DEFINE_OPCODE_HANDLER_OLD(CMSG_MOVE_KNOCK_BACK_ACK, STATUS_UNHANDLED, PROCESS_THREADSAFE, &WorldSession::HandleMoveKnockBackAck ); + DEFINE_HANDLER(CMSG_MOVE_KNOCK_BACK_ACK, STATUS_LOGGEDIN, PROCESS_THREADSAFE, WorldPackets::Movement::MovementAck, &WorldSession::HandleMoveKnockBackAck); DEFINE_OPCODE_HANDLER_OLD(CMSG_MOVE_REMOVE_MOVEMENT_FORCES, STATUS_UNHANDLED, PROCESS_THREADSAFE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER_OLD(CMSG_MOVE_REMOVE_MOVEMENT_FORCE_ACK, STATUS_UNHANDLED, PROCESS_THREADSAFE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER_OLD(CMSG_MOVE_SET_CAN_FLY_ACK, STATUS_UNHANDLED, PROCESS_THREADSAFE, &WorldSession::HandleMoveSetCanFlyAckOpcode ); @@ -577,7 +578,7 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER_OLD(CMSG_OBJECT_UPDATE_RESCUED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_HANDLER(CMSG_OFFER_PETITION, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, WorldPackets::Petition::OfferPetition, &WorldSession::HandleOfferPetition); DEFINE_OPCODE_HANDLER_OLD(CMSG_OPENING_CINEMATIC, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleOpeningCinematic ); - DEFINE_HANDLER(CMSG_OPEN_ITEM, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, WorldPackets::Spells::OpenItem, &WorldSession::HandleOpenItemOpcode ); + DEFINE_HANDLER(CMSG_OPEN_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Spells::OpenItem, &WorldSession::HandleOpenItemOpcode ); DEFINE_OPCODE_HANDLER_OLD(CMSG_OPEN_MISSION_NPC, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER_OLD(CMSG_OPEN_SHIPMENT_NPC, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER_OLD(CMSG_OPEN_TRADESKILL_NPC, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -648,14 +649,14 @@ void OpcodeTable::Initialize() DEFINE_HANDLER(CMSG_RANDOM_ROLL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Misc::RandomRollClient, &WorldSession::HandleRandomRollOpcode); DEFINE_OPCODE_HANDLER_OLD(CMSG_READY_CHECK_RESPONSE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER_OLD(CMSG_READ_ITEM, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleReadItem ); - DEFINE_HANDLER(CMSG_RECLAIM_CORPSE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, WorldPackets::Misc::ReclaimCorpse, &WorldSession::HandleReclaimCorpse); + DEFINE_HANDLER(CMSG_RECLAIM_CORPSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Misc::ReclaimCorpse, &WorldSession::HandleReclaimCorpse); DEFINE_OPCODE_HANDLER_OLD(CMSG_RECRUIT_A_FRIEND, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER_OLD(CMSG_REDEEM_WOW_TOKEN_CONFIRM, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER_OLD(CMSG_REDEEM_WOW_TOKEN_START, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_HANDLER(CMSG_REORDER_CHARACTERS, STATUS_AUTHED, PROCESS_THREADUNSAFE, WorldPackets::Character::ReorderCharacters, &WorldSession::HandleReorderCharacters); DEFINE_HANDLER(CMSG_REPAIR_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Item::RepairItem, &WorldSession::HandleRepairItemOpcode); DEFINE_OPCODE_HANDLER_OLD(CMSG_REPLACE_TROPHY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_HANDLER(CMSG_REPOP_REQUEST, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, WorldPackets::Misc::RepopRequest, &WorldSession::HandleRepopRequest); + DEFINE_HANDLER(CMSG_REPOP_REQUEST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Misc::RepopRequest, &WorldSession::HandleRepopRequest); DEFINE_OPCODE_HANDLER_OLD(CMSG_REPORT_PVP_PLAYER_AFK, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleReportPvPAFK ); DEFINE_HANDLER(CMSG_REQUEST_ACCOUNT_DATA, STATUS_AUTHED, PROCESS_THREADUNSAFE, WorldPackets::ClientConfig::RequestAccountData, &WorldSession::HandleRequestAccountData); DEFINE_OPCODE_HANDLER_OLD(CMSG_REQUEST_BATTLEFIELD_STATUS, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestBattlefieldStatusOpcode); @@ -683,7 +684,7 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER_OLD(CMSG_REQUEST_WOW_TOKEN_MARKET_PRICE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER_OLD(CMSG_RESET_CHALLENGE_MODE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER_OLD(CMSG_RESET_INSTANCES, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleResetInstancesOpcode ); - DEFINE_HANDLER(CMSG_RESURRECT_RESPONSE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, WorldPackets::Misc::ResurrectResponse, &WorldSession::HandleResurrectResponse); + DEFINE_HANDLER(CMSG_RESURRECT_RESPONSE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Misc::ResurrectResponse, &WorldSession::HandleResurrectResponse); DEFINE_OPCODE_HANDLER_OLD(CMSG_REVERT_MONUMENT_APPEARANCE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER_OLD(CMSG_RIDE_VEHICLE_INTERACT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::HandleEnterPlayerVehicle ); DEFINE_OPCODE_HANDLER_OLD(CMSG_SAVE_CUF_PROFILES, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::HandleSaveCUFProfiles ); @@ -697,12 +698,12 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER_OLD(CMSG_SELL_WOW_TOKEN_CONFIRM, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER_OLD(CMSG_SELL_WOW_TOKEN_START, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_HANDLER(CMSG_SEND_CONTACT_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Social::SendContactList, &WorldSession::HandleContactListOpcode); - DEFINE_HANDLER(CMSG_SEND_MAIL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Mail::SendMail, &WorldSession::HandleSendMail); + DEFINE_HANDLER(CMSG_SEND_MAIL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Mail::SendMail, &WorldSession::HandleSendMail); DEFINE_OPCODE_HANDLER_OLD(CMSG_SEND_SOR_REQUEST_VIA_ADDRESS, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER_OLD(CMSG_SEND_SOR_REQUEST_VIA_BNET_ACCOUNT_ID, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_HANDLER(CMSG_SEND_TEXT_EMOTE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Chat::CTextEmote, &WorldSession::HandleTextEmoteOpcode); DEFINE_OPCODE_HANDLER_OLD(CMSG_SET_ACHIEVEMENTS_HIDDEN, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_HANDLER(CMSG_SET_ACTION_BAR_TOGGLES, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, WorldPackets::Character::SetActionBarToggles, &WorldSession::HandleSetActionBarToggles); + DEFINE_HANDLER(CMSG_SET_ACTION_BAR_TOGGLES, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Character::SetActionBarToggles, &WorldSession::HandleSetActionBarToggles); DEFINE_HANDLER(CMSG_SET_ACTION_BUTTON, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Spells::SetActionButton, &WorldSession::HandleSetActionButtonOpcode); DEFINE_HANDLER(CMSG_SET_ACTIVE_MOVER, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Movement::SetActiveMover, &WorldSession::HandleSetActiveMoverOpcode); DEFINE_OPCODE_HANDLER_OLD(CMSG_SET_ACTIVE_VOICE_CHANNEL, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetActiveVoiceChannel ); @@ -737,10 +738,10 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER_OLD(CMSG_SET_SORT_BAGS_RIGHT_TO_LEFT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_HANDLER(CMSG_SET_SPECIALIZATION, STATUS_LOGGEDIN, PROCESS_INPLACE, WorldPackets::Talent::SetSpecialization, &WorldSession::HandleSetSpecializationOpcode); DEFINE_OPCODE_HANDLER_OLD(CMSG_SET_TAXI_BENCHMARK_MODE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTaxiBenchmarkOpcode ); - DEFINE_HANDLER(CMSG_SET_TITLE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, WorldPackets::Character::SetTitle, &WorldSession::HandleSetTitleOpcode); - DEFINE_OPCODE_HANDLER_OLD(CMSG_SET_TRADE_CURRENCY, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); - DEFINE_OPCODE_HANDLER_OLD(CMSG_SET_TRADE_GOLD, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTradeGoldOpcode ); - DEFINE_OPCODE_HANDLER_OLD(CMSG_SET_TRADE_ITEM, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTradeItemOpcode ); + DEFINE_HANDLER(CMSG_SET_TITLE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Character::SetTitle, &WorldSession::HandleSetTitleOpcode); + DEFINE_HANDLER(CMSG_SET_TRADE_CURRENCY, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Trade::SetTradeCurrency, &WorldSession::HandleSetTradeCurrencyOpcode); + DEFINE_HANDLER(CMSG_SET_TRADE_GOLD, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Trade::SetTradeGold, &WorldSession::HandleSetTradeGoldOpcode); + DEFINE_HANDLER(CMSG_SET_TRADE_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Trade::SetTradeItem, &WorldSession::HandleSetTradeItemOpcode); DEFINE_OPCODE_HANDLER_OLD(CMSG_SET_USING_PARTY_GARRISON, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER_OLD(CMSG_SET_WATCHED_FACTION, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleSetWatchedFactionOpcode ); DEFINE_HANDLER(CMSG_SHOWING_CLOAK, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, WorldPackets::Character::ShowingCloak, &WorldSession::HandleShowingCloakOpcode); @@ -755,7 +756,7 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER_OLD(CMSG_SPELL_CLICK, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleSpellClick ); DEFINE_OPCODE_HANDLER_OLD(CMSG_SPIRIT_HEALER_ACTIVATE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleSpiritHealerActivateOpcode); DEFINE_HANDLER(CMSG_SPLIT_ITEM, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Item::SplitItem, &WorldSession::HandleSplitItemOpcode); - DEFINE_HANDLER(CMSG_STAND_STATE_CHANGE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, WorldPackets::Misc::StandStateChange, &WorldSession::HandleStandStateChangeOpcode); + DEFINE_HANDLER(CMSG_STAND_STATE_CHANGE, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Misc::StandStateChange, &WorldSession::HandleStandStateChangeOpcode); DEFINE_OPCODE_HANDLER_OLD(CMSG_START_SPECTATOR_WAR_GAME, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER_OLD(CMSG_START_WAR_GAME, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER_OLD(CMSG_SUMMON_RESPONSE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleSummonResponseOpcode ); @@ -783,7 +784,7 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER_OLD(CMSG_TOTEM_DESTROYED, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleTotemDestroyed ); DEFINE_OPCODE_HANDLER_OLD(CMSG_TOY_SET_FAVORITE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER_OLD(CMSG_TRAINER_BUY_SPELL, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleTrainerBuySpellOpcode ); - DEFINE_HANDLER(CMSG_TRAINER_LIST, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, WorldPackets::NPC::Hello, &WorldSession::HandleTrainerListOpcode); + DEFINE_HANDLER(CMSG_TRAINER_LIST, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::NPC::Hello, &WorldSession::HandleTrainerListOpcode); DEFINE_OPCODE_HANDLER_OLD(CMSG_TRANSMOGRIFY_ITEMS, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleTransmogrifyItems ); DEFINE_HANDLER(CMSG_TURN_IN_PETITION, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, WorldPackets::Petition::TurnInPetition, &WorldSession::HandleTurnInPetition); DEFINE_HANDLER(CMSG_TUTORIAL, STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, WorldPackets::Misc::TutorialSetFlag, &WorldSession::HandleTutorialFlag); @@ -792,7 +793,7 @@ void OpcodeTable::Initialize() DEFINE_OPCODE_HANDLER_OLD(CMSG_TWITTER_DISCONNECT, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_OPCODE_HANDLER_OLD(CMSG_TWITTER_POST, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); DEFINE_HANDLER(CMSG_UI_TIME_REQUEST, STATUS_LOGGEDIN, PROCESS_INPLACE, WorldPackets::Misc::UITimeRequest, &WorldSession::HandleUITimeRequest); - DEFINE_OPCODE_HANDLER_OLD(CMSG_UNACCEPT_TRADE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleUnacceptTradeOpcode ); + DEFINE_HANDLER(CMSG_UNACCEPT_TRADE, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, WorldPackets::Trade::UnacceptTrade, &WorldSession::HandleUnacceptTradeOpcode); DEFINE_HANDLER(CMSG_UNDELETE_CHARACTER, STATUS_AUTHED, PROCESS_THREADUNSAFE, WorldPackets::Character::UndeleteCharacter, &WorldSession::HandleCharUndeleteOpcode); DEFINE_OPCODE_HANDLER_OLD(CMSG_UNLEARN_SKILL, STATUS_UNHANDLED, PROCESS_THREADUNSAFE, &WorldSession::HandleUnlearnSkillOpcode ); DEFINE_OPCODE_HANDLER_OLD(CMSG_UNLEARN_SPECIALIZATION, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL ); @@ -844,14 +845,14 @@ void OpcodeTable::Initialize() DEFINE_SERVER_OPCODE_HANDLER(SMSG_ADJUST_SPLINE_DURATION, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_AE_LOOT_TARGETS, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_AE_LOOT_TARGET_ACK, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_AI_REACTION, STATUS_UNHANDLED, CONNECTION_TYPE_INSTANCE); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_AI_REACTION, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); DEFINE_SERVER_OPCODE_HANDLER(SMSG_ALL_ACCOUNT_CRITERIA, STATUS_NEVER, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_ALL_ACHIEVEMENT_DATA, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); DEFINE_SERVER_OPCODE_HANDLER(SMSG_ALL_GUILD_ACHIEVEMENTS, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_ARCHAEOLOGY_SURVERY_CAST, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_AREA_SPIRIT_HEALER_TIME, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_AREA_TRIGGER_DENIED, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_AREA_TRIGGER_NO_CORPSE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_AREA_TRIGGER_NO_CORPSE, STATUS_NEVER, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_AREA_TRIGGER_RE_PATH, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_AREA_TRIGGER_RE_SHAPE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_ARENA_ERROR, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); @@ -927,7 +928,7 @@ void OpcodeTable::Initialize() DEFINE_SERVER_OPCODE_HANDLER(SMSG_BF_MGR_QUEUE_REQUEST_RESPONSE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_BF_MGR_QUEUE_STATUS_UPDATE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_BF_MGR_STATE_CHANGED, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_BINDER_CONFIRM, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_BINDER_CONFIRM, STATUS_NEVER, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_BIND_POINT_UPDATE, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); DEFINE_SERVER_OPCODE_HANDLER(SMSG_BLACK_MARKET_BID_ON_ITEM_RESULT, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_BLACK_MARKET_OPEN_RESULT, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); @@ -968,7 +969,7 @@ void OpcodeTable::Initialize() DEFINE_SERVER_OPCODE_HANDLER(SMSG_CANCEL_SPELL_VISUAL, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_CANCEL_SPELL_VISUAL_KIT, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_CAN_DUEL_RESULT, STATUS_NEVER, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_CAST_FAILED, STATUS_UNHANDLED, CONNECTION_TYPE_INSTANCE); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_CAST_FAILED, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); DEFINE_SERVER_OPCODE_HANDLER(SMSG_CATEGORY_COOLDOWN, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); DEFINE_SERVER_OPCODE_HANDLER(SMSG_CHALLEGE_MODE_REWARDS, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_CHALLENGE_MODE_ALL_MAP_STATS, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); @@ -1007,12 +1008,12 @@ void OpcodeTable::Initialize() DEFINE_SERVER_OPCODE_HANDLER(SMSG_CHEAT_IGNORE_DIMISHING_RETURNS, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_CHECK_WARGAME_ENTRY, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_CHUNKED_PACKET, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_CLEAR_ALL_SPELL_CHARGES, STATUS_UNHANDLED, CONNECTION_TYPE_INSTANCE); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_CLEAR_ALL_SPELL_CHARGES, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); DEFINE_SERVER_OPCODE_HANDLER(SMSG_CLEAR_BOSS_EMOTES, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWN, STATUS_UNHANDLED, CONNECTION_TYPE_INSTANCE); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWNS, STATUS_UNHANDLED, CONNECTION_TYPE_INSTANCE); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWN, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_CLEAR_COOLDOWNS, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); DEFINE_SERVER_OPCODE_HANDLER(SMSG_CLEAR_LOSS_OF_CONTROL, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_CLEAR_SPELL_CHARGES, STATUS_UNHANDLED, CONNECTION_TYPE_INSTANCE); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_CLEAR_SPELL_CHARGES, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); DEFINE_SERVER_OPCODE_HANDLER(SMSG_CLEAR_TARGET, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_COIN_REMOVED, STATUS_NEVER, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_COMBAT_EVENT_FAILED, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); @@ -1029,9 +1030,9 @@ void OpcodeTable::Initialize() DEFINE_SERVER_OPCODE_HANDLER(SMSG_CONTROL_UPDATE, STATUS_NEVER, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_CONVERT_RUNE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_COOLDOWN_CHEAT, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_COOLDOWN_EVENT, STATUS_UNHANDLED, CONNECTION_TYPE_INSTANCE); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_COOLDOWN_EVENT, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); DEFINE_SERVER_OPCODE_HANDLER(SMSG_CORPSE_LOCATION, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_CORPSE_RECLAIM_DELAY, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_CORPSE_RECLAIM_DELAY, STATUS_NEVER, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_CORPSE_TRANSPORT_QUERY, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_CREATE_CHAR, STATUS_NEVER, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_CREATE_SHIPMENT_RESPONSE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); @@ -1043,7 +1044,7 @@ void OpcodeTable::Initialize() DEFINE_SERVER_OPCODE_HANDLER(SMSG_DAMAGE_CALC_LOG, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_DANCE_STUDIO_CREATE_RESULT, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_DB_REPLY, STATUS_NEVER, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_DEATH_RELEASE_LOC, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_DEATH_RELEASE_LOC, STATUS_NEVER, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_DEFENSE_MESSAGE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_DELETE_CHAR, STATUS_NEVER, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_DESTROY_ARENA_UNIT, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); @@ -1076,7 +1077,7 @@ void OpcodeTable::Initialize() DEFINE_SERVER_OPCODE_HANDLER(SMSG_ENVIRONMENTAL_DAMAGE_LOG, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_EQUIPMENT_SET_ID, STATUS_UNHANDLED, CONNECTION_TYPE_INSTANCE); DEFINE_SERVER_OPCODE_HANDLER(SMSG_EXPECTED_SPAM_RECORDS, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_EXPLORATION_EXPERIENCE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_EXPLORATION_EXPERIENCE, STATUS_NEVER, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_FACTION_BONUS_INFO, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_FAILED_PLAYER_CONDITION, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_FEATURE_SYSTEM_STATUS, STATUS_NEVER, CONNECTION_TYPE_REALM); @@ -1238,7 +1239,7 @@ void OpcodeTable::Initialize() DEFINE_SERVER_OPCODE_HANDLER(SMSG_INSTANCE_RESET, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_INSTANCE_RESET_FAILED, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_INSTANCE_SAVE_CREATED, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_INVALIDATE_PLAYER, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_INVALIDATE_PLAYER, STATUS_NEVER, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_INVALID_PROMOTION_CODE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_INVENTORY_CHANGE_FAILURE, STATUS_NEVER, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_IS_QUEST_COMPLETE_RESPONSE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); @@ -1252,7 +1253,7 @@ void OpcodeTable::Initialize() DEFINE_SERVER_OPCODE_HANDLER(SMSG_KICK_REASON, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_LEARNED_SPELLS, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); DEFINE_SERVER_OPCODE_HANDLER(SMSG_LEARN_TALENT_FAILED, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_LEVEL_UP_INFO, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_LEVEL_UP_INFO, STATUS_NEVER, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_BOOT_PLAYER, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_DISABLED, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_LFG_JOIN_RESULT, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); @@ -1298,7 +1299,7 @@ void OpcodeTable::Initialize() DEFINE_SERVER_OPCODE_HANDLER(SMSG_LOOT_ITEM_LIST, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_LOOT_LIST, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_LOOT_MONEY_NOTIFY, STATUS_NEVER, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_LOOT_RELEASE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_LOOT_RELEASE, STATUS_NEVER, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_LOOT_RELEASE_ALL, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_LOOT_REMOVED, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); DEFINE_SERVER_OPCODE_HANDLER(SMSG_LOOT_RESPONSE, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); @@ -1317,7 +1318,7 @@ void OpcodeTable::Initialize() DEFINE_SERVER_OPCODE_HANDLER(SMSG_MIRROR_IMAGE_COMPONENTED_DATA, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_MIRROR_IMAGE_CREATURE_DATA, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_MISSILE_CANCEL, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_MODIFY_COOLDOWN, STATUS_UNHANDLED, CONNECTION_TYPE_INSTANCE); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_MODIFY_COOLDOWN, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); DEFINE_SERVER_OPCODE_HANDLER(SMSG_MOTD, STATUS_NEVER, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_MOUNT_RESULT, STATUS_UNHANDLED, CONNECTION_TYPE_INSTANCE); DEFINE_SERVER_OPCODE_HANDLER(SMSG_MOVE_APPLY_MOVEMENT_FORCE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); @@ -1385,12 +1386,12 @@ void OpcodeTable::Initialize() DEFINE_SERVER_OPCODE_HANDLER(SMSG_MOVE_UNSET_CAN_TURN_WHILE_FALLING, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_MOVE_UNSET_HOVERING, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); DEFINE_SERVER_OPCODE_HANDLER(SMSG_MOVE_UNSET_IGNORE_MOVEMENT_FORCES, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_MOVE_UPDATE, STATUS_UNHANDLED, CONNECTION_TYPE_INSTANCE); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_MOVE_UPDATE, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); DEFINE_SERVER_OPCODE_HANDLER(SMSG_MOVE_UPDATE_APPLY_MOVEMENT_FORCE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_MOVE_UPDATE_COLLISION_HEIGHT, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_MOVE_UPDATE_FLIGHT_BACK_SPEED, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); DEFINE_SERVER_OPCODE_HANDLER(SMSG_MOVE_UPDATE_FLIGHT_SPEED, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_MOVE_UPDATE_KNOCK_BACK, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_MOVE_UPDATE_KNOCK_BACK, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); DEFINE_SERVER_OPCODE_HANDLER(SMSG_MOVE_UPDATE_PITCH_RATE, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); DEFINE_SERVER_OPCODE_HANDLER(SMSG_MOVE_UPDATE_REMOVE_MOVEMENT_FORCE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_MOVE_UPDATE_RUN_BACK_SPEED, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); @@ -1422,7 +1423,7 @@ void OpcodeTable::Initialize() DEFINE_SERVER_OPCODE_HANDLER(SMSG_PARTY_KILL_LOG, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_PARTY_MEMBER_STATE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_PARTY_UPDATE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_PAUSE_MIRROR_TIMER, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_PAUSE_MIRROR_TIMER, STATUS_NEVER, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_PENDING_RAID_LOCK, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_PETITION_ALREADY_SIGNED, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_PETITION_RENAME_GUILD_RESPONSE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); @@ -1463,11 +1464,11 @@ void OpcodeTable::Initialize() DEFINE_SERVER_OPCODE_HANDLER(SMSG_PET_UNLEARNED_SPELLS, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_PHASE_SHIFT_CHANGE, STATUS_NEVER, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_PLAYED_TIME, STATUS_NEVER, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_PLAYER_BOUND, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_PLAYER_BOUND, STATUS_NEVER, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_PLAYER_SAVE_GUILD_EMBLEM, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_PLAYER_SKINNED, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_PLAYER_TABARD_VENDOR_ACTIVATE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_PLAY_MUSIC, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_PLAY_MUSIC, STATUS_NEVER, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_PLAY_OBJECT_SOUND, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_PLAY_ONE_SHOT_ANIM_KIT, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_PLAY_ORPHAN_SPELL_VISUAL, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); @@ -1479,10 +1480,10 @@ void OpcodeTable::Initialize() DEFINE_SERVER_OPCODE_HANDLER(SMSG_PLAY_TIME_WARNING, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_PONG, STATUS_NEVER, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_POWER_UPDATE, STATUS_NEVER, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_PRE_RESSURECT, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_PRE_RESSURECT, STATUS_NEVER, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_PRINT_NOTIFICATION, STATUS_NEVER, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_PROC_RESIST, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_PROPOSE_LEVEL_GRANT, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_PROPOSE_LEVEL_GRANT, STATUS_NEVER, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_PVP_CREDIT, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_PVP_LOG_DATA, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_PVP_OPTIONS_ENABLED, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); @@ -1536,7 +1537,7 @@ void OpcodeTable::Initialize() DEFINE_SERVER_OPCODE_HANDLER(SMSG_REALM_SPLIT, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_RECRUIT_A_FRIEND_RESPONSE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_REFER_A_FRIEND_EXPIRED, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_REFER_A_FRIEND_FAILURE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_REFER_A_FRIEND_FAILURE, STATUS_NEVER, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_REFRESH_COMPONENT, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_REFRESH_SPELL_HISTORY, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_REMOVE_ITEM_PASSIVE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); @@ -1623,8 +1624,8 @@ void OpcodeTable::Initialize() DEFINE_SERVER_OPCODE_HANDLER(SMSG_SOCKET_GEMS, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_SOR_START_EXPERIENCE_INCOMPLETE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_SPECIAL_MOUNT_ANIM, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_SPELL_CHANNEL_START, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_SPELL_CHANNEL_UPDATE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_SPELL_CHANNEL_START, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_SPELL_CHANNEL_UPDATE, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); DEFINE_SERVER_OPCODE_HANDLER(SMSG_SPELL_COOLDOWN, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); DEFINE_SERVER_OPCODE_HANDLER(SMSG_SPELL_DAMAGE_SHIELD, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_SPELL_DELAYED, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); @@ -1665,7 +1666,7 @@ void OpcodeTable::Initialize() DEFINE_SERVER_OPCODE_HANDLER(SMSG_TALENTS_INVOLUNTARILY_RESET, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_TAXI_NODE_STATUS, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_TEXT_EMOTE, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_THREAT_CLEAR, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_THREAT_CLEAR, STATUS_NEVER, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_THREAT_REMOVE, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); DEFINE_SERVER_OPCODE_HANDLER(SMSG_THREAT_UPDATE, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); DEFINE_SERVER_OPCODE_HANDLER(SMSG_TIME_ADJUSTMENT, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); @@ -1675,14 +1676,14 @@ void OpcodeTable::Initialize() DEFINE_SERVER_OPCODE_HANDLER(SMSG_TOKEN_UNK1, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_TOTEM_CREATED, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_TOTEM_MOVED, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_TRADE_STATUS, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_TRADE_UPDATED, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_TRADE_STATUS, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_TRADE_UPDATED, STATUS_NEVER, CONNECTION_TYPE_INSTANCE); DEFINE_SERVER_OPCODE_HANDLER(SMSG_TRAINER_BUY_FAILED, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_TRAINER_LIST, STATUS_UNHANDLED, CONNECTION_TYPE_INSTANCE); DEFINE_SERVER_OPCODE_HANDLER(SMSG_TRANSFER_ABORTED, STATUS_NEVER, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_TRANSFER_PENDING, STATUS_NEVER, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_TRIGGER_CINEMATIC, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_TRIGGER_MOVIE, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_TRIGGER_CINEMATIC, STATUS_NEVER, CONNECTION_TYPE_REALM); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_TRIGGER_MOVIE, STATUS_NEVER, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_TURN_IN_PETITION_RESULT, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_TUTORIAL_FLAGS, STATUS_NEVER, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_TWITTER_STATUS, STATUS_NEVER, CONNECTION_TYPE_REALM); @@ -1729,7 +1730,7 @@ void OpcodeTable::Initialize() DEFINE_SERVER_OPCODE_HANDLER(SMSG_WORLD_TEXT, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_XP_GAIN_ABORTED, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); DEFINE_SERVER_OPCODE_HANDLER(SMSG_XP_GAIN_ENABLED, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); - DEFINE_SERVER_OPCODE_HANDLER(SMSG_ZONE_UNDER_ATTACK, STATUS_UNHANDLED, CONNECTION_TYPE_REALM); + DEFINE_SERVER_OPCODE_HANDLER(SMSG_ZONE_UNDER_ATTACK, STATUS_NEVER, CONNECTION_TYPE_REALM); #undef DEFINE_SERVER_OPCODE_HANDLER }; diff --git a/src/server/game/Server/Protocol/ServerPktHeader.h b/src/server/game/Server/Protocol/ServerPktHeader.h index e2f7824b178..9d9e87bd916 100644 --- a/src/server/game/Server/Protocol/ServerPktHeader.h +++ b/src/server/game/Server/Protocol/ServerPktHeader.h @@ -1,20 +1,20 @@ /* -* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> -* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at your -* option) any later version. -* -* This program is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with this program. If not, see <http://www.gnu.org/licenses/>. -*/ + * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ #ifndef __SERVERPKTHDR_H__ #define __SERVERPKTHDR_H__ diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 8ec5af98db7..da101654eec 100644 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -55,7 +55,6 @@ struct AuctionEntry; struct DeclinedName; struct ItemTemplate; struct MovementInfo; -struct TradeStatusInfo; namespace lfg { @@ -348,6 +347,12 @@ namespace WorldPackets class QuestLogRemoveQuest; } + namespace RaF + { + class AcceptLevelGrant; + class GrantLevel; + } + namespace Social { class AddFriend; @@ -393,7 +398,18 @@ namespace WorldPackets namespace Trade { + class AcceptTrade; + class BeginTrade; + class BusyTrade; class CancelTrade; + class ClearTradeItem; + class IgnoreTrade; + class InitiateTrade; + class SetTradeCurrency; + class SetTradeGold; + class SetTradeItem; + class UnacceptTrade; + class TradeStatus; } namespace Who @@ -658,7 +674,7 @@ class WorldSession void SendBattleGroundList(ObjectGuid guid, BattlegroundTypeId bgTypeId = BATTLEGROUND_RB); - void SendTradeStatus(TradeStatusInfo const& status); + void SendTradeStatus(WorldPackets::Trade::TradeStatus& status); void SendUpdateTrade(bool trader_data = true); void SendCancelTrade(); @@ -847,7 +863,7 @@ class WorldSession void HandleRepairItemOpcode(WorldPackets::Item::RepairItem& packet); // Knockback - void HandleMoveKnockBackAck(WorldPacket& recvPacket); + void HandleMoveKnockBackAck(WorldPackets::Movement::MovementAck& movementAck); void HandleMoveTeleportAck(WorldPackets::Movement::MoveTeleportAck& packet); void HandleForceSpeedChangeAck(WorldPackets::Movement::MovementSpeedAck& packet); @@ -1033,16 +1049,17 @@ class WorldSession void HandleDuelAccepted(); void HandleDuelCancelled(); - void HandleAcceptTradeOpcode(WorldPacket& recvPacket); - void HandleBeginTradeOpcode(WorldPacket& recvPacket); - void HandleBusyTradeOpcode(WorldPacket& recvPacket); + void HandleAcceptTradeOpcode(WorldPackets::Trade::AcceptTrade& acceptTrade); + void HandleBeginTradeOpcode(WorldPackets::Trade::BeginTrade& beginTrade); + void HandleBusyTradeOpcode(WorldPackets::Trade::BusyTrade& busyTrade); void HandleCancelTradeOpcode(WorldPackets::Trade::CancelTrade& cancelTrade); - void HandleClearTradeItemOpcode(WorldPacket& recvPacket); - void HandleIgnoreTradeOpcode(WorldPacket& recvPacket); - void HandleInitiateTradeOpcode(WorldPacket& recvPacket); - void HandleSetTradeGoldOpcode(WorldPacket& recvPacket); - void HandleSetTradeItemOpcode(WorldPacket& recvPacket); - void HandleUnacceptTradeOpcode(WorldPacket& recvPacket); + void HandleClearTradeItemOpcode(WorldPackets::Trade::ClearTradeItem& clearTradeItem); + void HandleIgnoreTradeOpcode(WorldPackets::Trade::IgnoreTrade& ignoreTrade); + void HandleInitiateTradeOpcode(WorldPackets::Trade::InitiateTrade& initiateTrade); + void HandleSetTradeCurrencyOpcode(WorldPackets::Trade::SetTradeCurrency& setTradeCurrency); + void HandleSetTradeGoldOpcode(WorldPackets::Trade::SetTradeGold& setTradeGold); + void HandleSetTradeItemOpcode(WorldPackets::Trade::SetTradeItem& setTradeItem); + void HandleUnacceptTradeOpcode(WorldPackets::Trade::UnacceptTrade& unacceptTrade); void HandleAuctionHelloOpcode(WorldPackets::AuctionHouse::AuctionHelloRequest& packet); void HandleAuctionListItems(WorldPacket& recvData); @@ -1285,8 +1302,8 @@ class WorldSession void HandleGuildBankSetTabText(WorldPackets::Guild::GuildBankSetTabText& packet); // Refer-a-Friend - void HandleGrantLevel(WorldPacket& recvData); - void HandleAcceptGrantLevel(WorldPacket& recvData); + void HandleGrantLevel(WorldPackets::RaF::GrantLevel& grantLevel); + void HandleAcceptGrantLevel(WorldPackets::RaF::AcceptLevelGrant& acceptLevelGrant); // Calendar void HandleCalendarGetCalendar(WorldPacket& recvData); diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index b0c7631f986..2b2b2458993 100644 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -131,7 +131,10 @@ void WorldSocket::ReadHandler() // We just received nice new header if (!ReadHeaderHandler()) + { + CloseSocket(); return; + } } // We have full read header, now check the data payload @@ -152,7 +155,10 @@ void WorldSocket::ReadHandler() // just received fresh new payload if (!ReadDataHandler()) + { + CloseSocket(); return; + } _headerBuffer.Reset(); } @@ -192,8 +198,6 @@ bool WorldSocket::ReadHeaderHandler() { TC_LOG_ERROR("network", "WorldSocket::ReadHeaderHandler(): client %s sent malformed packet (size: %u, cmd: %u)", GetRemoteIpAddress().to_string().c_str(), size, opcode); - - CloseSocket(); return false; } @@ -224,22 +228,15 @@ bool WorldSocket::ReadDataHandler() { case CMSG_PING: LogOpcodeText(opcode, sessionGuard); - HandlePing(packet); - break; + return HandlePing(packet); case CMSG_AUTH_SESSION: { LogOpcodeText(opcode, sessionGuard); if (_authed) { // locking just to safely log offending user is probably overkill but we are disconnecting him anyway - { - if (sessionGuard.try_lock()) - { - TC_LOG_ERROR("network", "WorldSocket::ProcessIncoming: received duplicate CMSG_AUTH_SESSION from %s", _worldSession->GetPlayerInfo().c_str()); - sessionGuard.unlock(); // unlock session guard to prevent deadlocking in CloseSocket - } - } - CloseSocket(); + if (sessionGuard.try_lock()) + TC_LOG_ERROR("network", "WorldSocket::ProcessIncoming: received duplicate CMSG_AUTH_SESSION from %s", _worldSession->GetPlayerInfo().c_str()); return false; } @@ -254,14 +251,8 @@ bool WorldSocket::ReadDataHandler() if (_authed) { // locking just to safely log offending user is probably overkill but we are disconnecting him anyway - { - if (sessionGuard.try_lock()) - { - TC_LOG_ERROR("network", "WorldSocket::ProcessIncoming: received duplicate CMSG_AUTH_CONTINUED_SESSION from %s", _worldSession->GetPlayerInfo().c_str()); - sessionGuard.unlock(); // unlock session guard to prevent deadlocking in CloseSocket - } - } - CloseSocket(); + if (sessionGuard.try_lock()) + TC_LOG_ERROR("network", "WorldSocket::ProcessIncoming: received duplicate CMSG_AUTH_CONTINUED_SESSION from %s", _worldSession->GetPlayerInfo().c_str()); return false; } @@ -300,7 +291,6 @@ bool WorldSocket::ReadDataHandler() if (!_worldSession) { TC_LOG_ERROR("network.opcode", "ProcessIncoming: Client not authed opcode = %u", uint32(opcode)); - CloseSocket(); return false; } @@ -325,10 +315,7 @@ bool WorldSocket::ReadDataHandler() { std::string initializer(reinterpret_cast<char const*>(_packetBuffer.GetReadPointer()), std::min(_packetBuffer.GetActiveSize(), ClientConnectionInitialize.length())); if (initializer != ClientConnectionInitialize) - { - CloseSocket(); return false; - } _compressionStream = new z_stream(); _compressionStream->zalloc = (alloc_func)NULL; @@ -340,7 +327,6 @@ bool WorldSocket::ReadDataHandler() if (z_res != Z_OK) { TC_LOG_ERROR("network", "Can't initialize packet compression (zlib: deflateInit) Error code: %i (%s)", z_res, zError(z_res)); - CloseSocket(); return false; } @@ -803,7 +789,7 @@ void WorldSocket::SendAuthResponseError(uint8 code) SendPacketAndLogOpcode(*response.Write()); } -void WorldSocket::HandlePing(WorldPacket& recvPacket) +bool WorldSocket::HandlePing(WorldPacket& recvPacket) { uint32 ping; uint32 latency; @@ -839,10 +825,7 @@ void WorldSocket::HandlePing(WorldPacket& recvPacket) TC_LOG_ERROR("network", "WorldSocket::HandlePing: %s kicked for over-speed pings (address: %s)", _worldSession->GetPlayerInfo().c_str(), GetRemoteIpAddress().to_string().c_str()); - // this is bad but we will pretend this code isn't here - it only happens once per socket in worst case - sessionGuard.unlock(); - CloseSocket(); - return; + return false; } } } @@ -861,13 +844,12 @@ void WorldSocket::HandlePing(WorldPacket& recvPacket) else { TC_LOG_ERROR("network", "WorldSocket::HandlePing: peer sent CMSG_PING, but is not authenticated or got recently kicked, address = %s", GetRemoteIpAddress().to_string().c_str()); - - CloseSocket(); - return; + return false; } } WorldPacket packet(SMSG_PONG, 4); packet << ping; - return SendPacketAndLogOpcode(packet); + SendPacketAndLogOpcode(packet); + return true; } diff --git a/src/server/game/Server/WorldSocket.h b/src/server/game/Server/WorldSocket.h index 45e19a93767..482f794344b 100644 --- a/src/server/game/Server/WorldSocket.h +++ b/src/server/game/Server/WorldSocket.h @@ -1,20 +1,20 @@ /* -* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> -* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at your -* option) any later version. -* -* This program is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with this program. If not, see <http://www.gnu.org/licenses/>. -*/ + * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ #ifndef __WORLDSOCKET_H__ #define __WORLDSOCKET_H__ @@ -106,7 +106,7 @@ private: void HandleConnectToFailed(WorldPackets::Auth::ConnectToFailed& connectToFailed); void SendAuthResponseError(uint8 code); - void HandlePing(WorldPacket& recvPacket); + bool HandlePing(WorldPacket& recvPacket); void ExtractOpcodeAndSize(ClientPktHeader const* header, uint32& opcode, uint32& size) const; diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index a5c143f1c63..1df9fd000f6 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -365,7 +365,7 @@ void SpellCastTargets::SetItemTarget(Item* item) void SpellCastTargets::SetTradeItemTarget(Player* caster) { - m_itemTargetGUID.SetRawValue({ uint8(TRADE_SLOT_NONTRADED), 0, 0, 0, 0, 0, 0, 0 }); + m_itemTargetGUID = ObjectGuid::TradeItem; m_itemTargetEntry = 0; m_targetMask |= TARGET_FLAG_TRADE_ITEM; @@ -489,9 +489,7 @@ void SpellCastTargets::Update(Unit* caster) m_itemTarget = player->GetItemByGuid(m_itemTargetGUID); else if (m_targetMask & TARGET_FLAG_TRADE_ITEM) { - ObjectGuid nonTradedGuid; - nonTradedGuid.SetRawValue(uint64(0), uint64(TRADE_SLOT_NONTRADED)); - if (m_itemTargetGUID == nonTradedGuid) // here it is not guid but slot. Also prevents hacking slots + if (m_itemTargetGUID == ObjectGuid::TradeItem) if (TradeData* pTrade = player->GetTradeData()) m_itemTarget = pTrade->GetTraderData()->GetItem(TRADE_SLOT_NONTRADED); } @@ -4247,11 +4245,10 @@ void Spell::SendChannelUpdate(uint32 time) m_caster->SetUInt32Value(UNIT_CHANNEL_SPELL, 0); } - WorldPacket data(SMSG_SPELL_CHANNEL_UPDATE, 8 + 4); - data << m_caster->GetPackGUID(); - data << uint32(time); - - m_caster->SendMessageToSet(&data, true); + WorldPackets::Spells::SpellChannelUpdate spellChannelUpdate; + spellChannelUpdate.CasterGUID = m_caster->GetGUID(); + spellChannelUpdate.TimeRemaining = time; + m_caster->SendMessageToSet(spellChannelUpdate.Write(), true); } void Spell::SendChannelStart(uint32 duration) @@ -4261,30 +4258,11 @@ void Spell::SendChannelStart(uint32 duration) if (m_UniqueTargetInfo.size() + m_UniqueGOTargetInfo.size() == 1) // this is for TARGET_SELECT_CATEGORY_NEARBY channelTarget = !m_UniqueTargetInfo.empty() ? m_UniqueTargetInfo.front().targetGUID : m_UniqueGOTargetInfo.front().targetGUID; - WorldPacket data(SMSG_SPELL_CHANNEL_START, (8 + 4 + 4)); - data << m_caster->GetPackGUID(); - data << uint32(m_spellInfo->Id); - data << uint32(duration); - data << uint8(0); // immunity (castflag & 0x04000000) - /* - if (immunity) - { - data << uint32(); // CastSchoolImmunities - data << uint32(); // CastImmunities - } - */ - data << uint8(0); // healPrediction (castflag & 0x40000000) - /* - if (healPrediction) - { - data.appendPackGUID(channelTarget); // target packguid - data << uint32(); // spellid - data << uint8(0); // unk3 - if (unk3 == 2) - data.append(); // unk packed guid (unused ?) - } - */ - m_caster->SendMessageToSet(&data, true); + WorldPackets::Spells::SpellChannelStart spellChannelStart; + spellChannelStart.CasterGUID = m_caster->GetGUID(); + spellChannelStart.SpellID = m_spellInfo->Id; + spellChannelStart.ChannelDuration = duration; + m_caster->SendMessageToSet(spellChannelStart.Write(), true); m_timer = duration; if (!channelTarget.IsEmpty()) @@ -5543,9 +5521,7 @@ SpellCastResult Spell::CheckCast(bool strict) if (!my_trade) return SPELL_FAILED_NOT_TRADING; - // Item target guid contains trade slot until m_targets.UpdateTradeSlotItem() is called - TradeSlots slot = TradeSlots(m_targets.GetItemTargetGUID().GetRawValue().at(0)); - if (slot != TRADE_SLOT_NONTRADED) + if (m_targets.GetItemTargetGUID() != ObjectGuid::TradeItem) return SPELL_FAILED_BAD_TARGETS; if (!IsTriggered()) diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 113ac31b461..9ddcc221e21 100644 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -524,7 +524,7 @@ class Spell void SetSpellValue(SpellValueMod mod, int32 value); - SpellEffectInfoVector GetEffects() const { return _effects; } + SpellEffectInfoVector const& GetEffects() const { return _effects; } SpellEffectInfo const* GetEffect(uint32 index) const { if (index >= _effects.size()) diff --git a/src/server/game/Spells/SpellHistory.cpp b/src/server/game/Spells/SpellHistory.cpp index 5611480b2f6..40d5d75ba6f 100644 --- a/src/server/game/Spells/SpellHistory.cpp +++ b/src/server/game/Spells/SpellHistory.cpp @@ -504,7 +504,7 @@ void SpellHistory::SendCooldownEvent(SpellInfo const* spellInfo, uint32 itemId / if (Player* player = GetPlayerOwner()) { // Send activate cooldown timer (possible 0) at client side - player->SendDirectMessage(WorldPackets::Spells::CooldownEvent(_owner->GetGUID(), spellInfo->Id).Write()); + player->SendDirectMessage(WorldPackets::Spells::CooldownEvent(player != _owner, spellInfo->Id).Write()); uint32 category = spellInfo->GetCategory(); if (category && spellInfo->CategoryRecoveryTime) @@ -525,7 +525,7 @@ void SpellHistory::SendCooldownEvent(SpellInfo const* spellInfo, uint32 itemId / if (!spellInfo2->IsCooldownStartedOnEvent()) continue; - player->SendDirectMessage(WorldPackets::Spells::CooldownEvent(_owner->GetGUID(), categorySpell).Write()); + player->SendDirectMessage(WorldPackets::Spells::CooldownEvent(player != _owner, categorySpell).Write()); } } } @@ -556,7 +556,7 @@ void SpellHistory::ModifyCooldown(uint32 spellId, int32 cooldownModMs) if (Player* playerOwner = GetPlayerOwner()) { WorldPackets::Spells::ModifyCooldown modifyCooldown; - modifyCooldown.UnitGUID = _owner->GetGUID(); + modifyCooldown.IsPet = _owner != playerOwner; modifyCooldown.SpellID = spellId; modifyCooldown.DeltaTime = cooldownModMs; playerOwner->SendDirectMessage(modifyCooldown.Write()); @@ -579,6 +579,7 @@ void SpellHistory::ResetCooldown(CooldownStorageType::iterator& itr, bool update if (Player* playerOwner = GetPlayerOwner()) { WorldPackets::Spells::ClearCooldown clearCooldown; + clearCooldown.IsPet = _owner != playerOwner; clearCooldown.SpellID = itr->first; clearCooldown.ClearOnHold = false; playerOwner->SendDirectMessage(clearCooldown.Write()); @@ -752,7 +753,7 @@ void SpellHistory::ResetCharges(SpellCategoryEntry const* chargeCategoryEntry) if (Player* player = GetPlayerOwner()) { WorldPackets::Spells::ClearSpellCharges clearSpellCharges; - clearSpellCharges.Unit = _owner->GetGUID(); + clearSpellCharges.IsPet = _owner != player; clearSpellCharges.Category = chargeCategoryEntry->ID; player->SendDirectMessage(clearSpellCharges.Write()); } @@ -766,7 +767,7 @@ void SpellHistory::ResetAllCharges() if (Player* player = GetPlayerOwner()) { WorldPackets::Spells::ClearAllSpellCharges clearAllSpellCharges; - clearAllSpellCharges.Unit = _owner->GetGUID(); + clearAllSpellCharges.IsPet = _owner != player; player->SendDirectMessage(clearAllSpellCharges.Write()); } } @@ -841,7 +842,7 @@ void SpellHistory::SendClearCooldowns(std::vector<int32> const& cooldowns) const if (Player const* playerOwner = GetPlayerOwner()) { WorldPackets::Spells::ClearCooldowns clearCooldowns; - clearCooldowns.Guid = _owner->GetGUID(); + clearCooldowns.IsPet = _owner != playerOwner; clearCooldowns.SpellID = cooldowns; playerOwner->SendDirectMessage(clearCooldowns.Write()); } diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 00e0abfa922..bd0e023af0e 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -915,12 +915,12 @@ void World::LoadConfigSettings(bool reload) } m_int_configs[CONFIG_CURRENCY_CONQUEST_POINTS_ARENA_REWARD] *= 100; //precision mod - m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] = sConfigMgr->GetIntDefault("RecruitAFriend.MaxLevel", 60); + m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] = sConfigMgr->GetIntDefault("RecruitAFriend.MaxLevel", 85); if (m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] > m_int_configs[CONFIG_MAX_PLAYER_LEVEL]) { TC_LOG_ERROR("server.loading", "RecruitAFriend.MaxLevel (%i) must be in the range 0..MaxLevel(%u). Set to %u.", - m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL], 60); - m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] = 60; + m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL], 85); + m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] = 85; } m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL_DIFFERENCE] = sConfigMgr->GetIntDefault("RecruitAFriend.MaxDifference", 4); diff --git a/src/server/scripts/Commands/cs_mmaps.cpp b/src/server/scripts/Commands/cs_mmaps.cpp index 166afec6b39..db3063fc693 100644 --- a/src/server/scripts/Commands/cs_mmaps.cpp +++ b/src/server/scripts/Commands/cs_mmaps.cpp @@ -1,19 +1,19 @@ /* -* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at your -* option) any later version. -* -* This program is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with this program. If not, see <http://www.gnu.org/licenses/>. -*/ + * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ /** * @file cs_mmaps.cpp diff --git a/src/server/scripts/Kalimdor/ZulFarrak/boss_zum_rah.cpp b/src/server/scripts/Kalimdor/ZulFarrak/boss_zum_rah.cpp index a0aeed89747..81a85c07ee1 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/boss_zum_rah.cpp +++ b/src/server/scripts/Kalimdor/ZulFarrak/boss_zum_rah.cpp @@ -1,19 +1,19 @@ /* -* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at your -* option) any later version. -* -* This program is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with this program. If not, see <http://www.gnu.org/licenses/>. -*/ + * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ /* Name: Boss_Zum_Rah diff --git a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.h b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.h index 3e742db02c0..57ccf57dee7 100644 --- a/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.h +++ b/src/server/scripts/Kalimdor/ZulFarrak/zulfarrak.h @@ -1,6 +1,20 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> -* This program is free software licensed under GPL version 2 -* Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ #ifndef DEF_ZF_H #define DEF_ZF_H diff --git a/src/server/scripts/Kalimdor/zone_felwood.cpp b/src/server/scripts/Kalimdor/zone_felwood.cpp index 71ee04bb071..1e03d7505b3 100644 --- a/src/server/scripts/Kalimdor/zone_felwood.cpp +++ b/src/server/scripts/Kalimdor/zone_felwood.cpp @@ -1,19 +1,19 @@ /* -* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at your -* option) any later version. -* -* This program is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with this program. If not, see <http://www.gnu.org/licenses/>. -*/ + * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ #include "ScriptMgr.h" #include "ScriptedCreature.h" diff --git a/src/server/scripts/Maelstrom/Stonecore/instance_stonecore.cpp b/src/server/scripts/Maelstrom/Stonecore/instance_stonecore.cpp index 95282ff69c8..f8a6925eb66 100644 --- a/src/server/scripts/Maelstrom/Stonecore/instance_stonecore.cpp +++ b/src/server/scripts/Maelstrom/Stonecore/instance_stonecore.cpp @@ -1,20 +1,19 @@ /* -* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> -* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at your -* option) any later version. -* -* This program is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with this program. If not, see <http://www.gnu.org/licenses/>. -*/ + * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ #include "ScriptMgr.h" #include "Player.h" diff --git a/src/server/scripts/Maelstrom/Stonecore/stonecore.h b/src/server/scripts/Maelstrom/Stonecore/stonecore.h index d87770db50c..9039ce9d20e 100644 --- a/src/server/scripts/Maelstrom/Stonecore/stonecore.h +++ b/src/server/scripts/Maelstrom/Stonecore/stonecore.h @@ -1,19 +1,19 @@ /* -* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at your -* option) any later version. -* -* This program is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with this program. If not, see <http://www.gnu.org/licenses/>. -*/ + * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ #ifndef DEF_STONECORE_H #define DEF_STONECORE_H diff --git a/src/server/scripts/PrecompiledHeaders/ScriptPCH.cpp b/src/server/scripts/PrecompiledHeaders/ScriptPCH.cpp index 41fecf3c60d..6b5ea74b6bc 100644 --- a/src/server/scripts/PrecompiledHeaders/ScriptPCH.cpp +++ b/src/server/scripts/PrecompiledHeaders/ScriptPCH.cpp @@ -1,6 +1,19 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> -* This program is free software licensed under GPL version 2 -* Please see the included DOCS/LICENSE.TXT for more information */ +/* + * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ #include "ScriptPCH.h" - diff --git a/src/server/shared/Networking/AsyncAcceptor.h b/src/server/shared/Networking/AsyncAcceptor.h index 832e408db34..d22d553965b 100644 --- a/src/server/shared/Networking/AsyncAcceptor.h +++ b/src/server/shared/Networking/AsyncAcceptor.h @@ -1,19 +1,19 @@ /* -* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at your -* option) any later version. -* -* This program is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with this program. If not, see <http://www.gnu.org/licenses/>. -*/ + * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ #ifndef __ASYNCACCEPT_H_ #define __ASYNCACCEPT_H_ diff --git a/src/server/shared/Networking/MessageBuffer.h b/src/server/shared/Networking/MessageBuffer.h index 90afaf35796..802442b5c31 100644 --- a/src/server/shared/Networking/MessageBuffer.h +++ b/src/server/shared/Networking/MessageBuffer.h @@ -1,19 +1,19 @@ /* -* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at your -* option) any later version. -* -* This program is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with this program. If not, see <http://www.gnu.org/licenses/>. -*/ + * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ #ifndef __MESSAGEBUFFER_H_ #define __MESSAGEBUFFER_H_ diff --git a/src/server/shared/Threading/ProcessPriority.h b/src/server/shared/Threading/ProcessPriority.h index 2a8501a0249..9f70ab0ac03 100644 --- a/src/server/shared/Threading/ProcessPriority.h +++ b/src/server/shared/Threading/ProcessPriority.h @@ -1,19 +1,19 @@ /* -* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at your -* option) any later version. -* -* This program is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with this program. If not, see <http://www.gnu.org/licenses/>. -*/ + * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ #ifndef _PROCESSPRIO_H #define _PROCESSPRIO_H diff --git a/src/server/shared/Threading/ProducerConsumerQueue.h b/src/server/shared/Threading/ProducerConsumerQueue.h index ab01568309b..67150a20d80 100644 --- a/src/server/shared/Threading/ProducerConsumerQueue.h +++ b/src/server/shared/Threading/ProducerConsumerQueue.h @@ -1,19 +1,19 @@ /* -* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at your -* option) any later version. -* -* This program is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with this program. If not, see <http://www.gnu.org/licenses/>. -*/ + * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ #ifndef _PCQ_H #define _PCQ_H diff --git a/src/server/worldserver/RemoteAccess/RASession.cpp b/src/server/worldserver/RemoteAccess/RASession.cpp index 34359c3cf03..b43c3f43c4a 100644 --- a/src/server/worldserver/RemoteAccess/RASession.cpp +++ b/src/server/worldserver/RemoteAccess/RASession.cpp @@ -1,20 +1,20 @@ /* -* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> -* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at your -* option) any later version. -* -* This program is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with this program. If not, see <http://www.gnu.org/licenses/>. -*/ + * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ #include <memory> #include <boost/asio/write.hpp> diff --git a/src/server/worldserver/RemoteAccess/RASession.h b/src/server/worldserver/RemoteAccess/RASession.h index efd2106fdd1..216d57aa5b2 100644 --- a/src/server/worldserver/RemoteAccess/RASession.h +++ b/src/server/worldserver/RemoteAccess/RASession.h @@ -1,20 +1,20 @@ /* -* Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> -* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at your -* option) any later version. -* -* This program is distributed in the hope that it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with this program. If not, see <http://www.gnu.org/licenses/>. -*/ + * Copyright (C) 2008-2015 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ #ifndef __RASESSION_H__ #define __RASESSION_H__ |
