From 1c13154e0b2268f817f7eb9892ce9e6d6ec5b6d6 Mon Sep 17 00:00:00 2001 From: DJScias Date: Wed, 22 Apr 2015 23:26:31 +0200 Subject: Core/PacketIO: Updated and enabled CMSG_SET_FACTION_AT_WAR, CMSG_SET_FACTION_INACTIVE, CMSG_SET_FACTION_NOT_AT_WAR, CMSG_SET_WATCHED_FACTION, SMSG_SET_FACTION_NOT_VISIBLE and SMSG_SET_FACTION_VISIBLE Documentation used: - Thanks @Carbenium for all the help in regards to this (https://github.com/TrinityCore/WowPacketParser/commit/66a2baff13c381d107aad12ea7b583f5af67c275 & https://github.com/TrinityCore/WowPacketParser/commit/cfd48eb2eea9f7e9c9ded483e8a5ac47d0b73949) - SetWatchedFaction is used for CMSG_SET_WATCHED_FACTION (returns uint32 FactionIndex), confirmed in-game and with http://wow.gamepedia.com/API_GetWatchedFactionInfo (See Patch History Patch 5.0.4) - SetFactionVisible is used for SMSG_SET_FACTION_VISIBLE and SMSG_SET_FACTION_NOT_VISIBLE (uint32 FactionIndex, confirmed) --- src/server/game/Reputation/ReputationMgr.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/server/game/Reputation/ReputationMgr.cpp') diff --git a/src/server/game/Reputation/ReputationMgr.cpp b/src/server/game/Reputation/ReputationMgr.cpp index 48f3bf79088..5fea62655b3 100644 --- a/src/server/game/Reputation/ReputationMgr.cpp +++ b/src/server/game/Reputation/ReputationMgr.cpp @@ -27,6 +27,7 @@ #include "ScriptMgr.h" #include "Opcodes.h" #include "WorldSession.h" +#include "CharacterPackets.h" const int32 ReputationMgr::PointsInRank[MAX_REPUTATION_RANK] = {36000, 3000, 3000, 3000, 6000, 12000, 21000, 1000}; @@ -225,15 +226,15 @@ void ReputationMgr::SendStates() SendState(&(itr->second)); } -void ReputationMgr::SendVisible(FactionState const* faction, bool visible /* = true*/) const +void ReputationMgr::SendVisible(FactionState const* faction, bool visible) const { if (_player->GetSession()->PlayerLoading()) return; // make faction visible/not visible in reputation list at client - WorldPacket data(visible ? SMSG_SET_FACTION_VISIBLE : SMSG_SET_FACTION_NOT_VISIBLE, 4); - data << faction->ReputationListID; - _player->SendDirectMessage(&data); + WorldPackets::Character::SetFactionVisible packet(visible); + packet.FactionIndex = faction->ReputationListID; + _player->SendDirectMessage(packet.Write()); } void ReputationMgr::Initialize() -- cgit v1.2.3