mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Social: Implemented account ignores
This commit is contained in:
@@ -734,13 +734,15 @@ void Channel::Say(ObjectGuid const& guid, std::string const& what, uint32 lang)
|
||||
return;
|
||||
}
|
||||
|
||||
Player* player = ObjectAccessor::FindConnectedPlayer(guid);
|
||||
|
||||
auto builder = [&](LocaleConstant locale)
|
||||
{
|
||||
LocaleConstant localeIdx = sWorld->GetAvailableDbcLocale(locale);
|
||||
|
||||
Trinity::PacketSenderOwning<WorldPackets::Chat::Chat>* packet = new Trinity::PacketSenderOwning<WorldPackets::Chat::Chat>();
|
||||
packet->Data.ChannelGUID = _channelGuid;
|
||||
if (Player* player = ObjectAccessor::FindConnectedPlayer(guid))
|
||||
if (player)
|
||||
packet->Data.Initialize(CHAT_MSG_CHANNEL, Language(lang), player, player, what, 0, GetName(localeIdx));
|
||||
else
|
||||
{
|
||||
@@ -754,7 +756,8 @@ void Channel::Say(ObjectGuid const& guid, std::string const& what, uint32 lang)
|
||||
return packet;
|
||||
};
|
||||
|
||||
SendToAll(builder, !playerInfo.IsModerator() ? guid : ObjectGuid::Empty);
|
||||
SendToAll(builder, !playerInfo.IsModerator() ? guid : ObjectGuid::Empty,
|
||||
!playerInfo.IsModerator() && player ? player->GetSession()->GetAccountGUID() : ObjectGuid::Empty);
|
||||
}
|
||||
|
||||
void Channel::AddonSay(ObjectGuid const& guid, std::string const& prefix, std::string const& what, bool isLogged) const
|
||||
@@ -779,13 +782,15 @@ void Channel::AddonSay(ObjectGuid const& guid, std::string const& prefix, std::s
|
||||
return;
|
||||
}
|
||||
|
||||
Player* player = ObjectAccessor::FindConnectedPlayer(guid);
|
||||
|
||||
auto builder = [&](LocaleConstant locale)
|
||||
{
|
||||
LocaleConstant localeIdx = sWorld->GetAvailableDbcLocale(locale);
|
||||
|
||||
Trinity::PacketSenderOwning<WorldPackets::Chat::Chat>* packet = new Trinity::PacketSenderOwning<WorldPackets::Chat::Chat>();
|
||||
packet->Data.ChannelGUID = _channelGuid;
|
||||
if (Player* player = ObjectAccessor::FindConnectedPlayer(guid))
|
||||
if (player)
|
||||
packet->Data.Initialize(CHAT_MSG_CHANNEL, isLogged ? LANG_ADDON_LOGGED : LANG_ADDON, player, player, what, 0, GetName(localeIdx), DEFAULT_LOCALE, prefix);
|
||||
else
|
||||
{
|
||||
@@ -799,7 +804,8 @@ void Channel::AddonSay(ObjectGuid const& guid, std::string const& prefix, std::s
|
||||
return packet;
|
||||
};
|
||||
|
||||
SendToAllWithAddon(builder, prefix, !playerInfo.IsModerator() ? guid : ObjectGuid::Empty);
|
||||
SendToAllWithAddon(builder, prefix, !playerInfo.IsModerator() ? guid : ObjectGuid::Empty,
|
||||
!playerInfo.IsModerator() && player ? player->GetSession()->GetAccountGUID() : ObjectGuid::Empty);
|
||||
}
|
||||
|
||||
void Channel::Invite(Player const* player, std::string const& newname)
|
||||
@@ -849,7 +855,7 @@ void Channel::Invite(Player const* player, std::string const& newname)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!newp->GetSocial()->HasIgnore(guid))
|
||||
if (!newp->GetSocial()->HasIgnore(guid, player->GetSession()->GetAccountGUID()))
|
||||
{
|
||||
InviteAppend appender(guid);
|
||||
ChannelNameBuilder<InviteAppend> builder(this, appender);
|
||||
@@ -1009,13 +1015,13 @@ void Channel::SetMute(ObjectGuid const& guid, bool set)
|
||||
}
|
||||
|
||||
template <class Builder>
|
||||
void Channel::SendToAll(Builder& builder, ObjectGuid const& guid) const
|
||||
void Channel::SendToAll(Builder& builder, ObjectGuid const& guid, ObjectGuid const& accountGuid) const
|
||||
{
|
||||
Trinity::LocalizedDo<Builder> localizer(builder);
|
||||
|
||||
for (PlayerContainer::value_type const& i : _playersStore)
|
||||
if (Player* player = ObjectAccessor::FindConnectedPlayer(i.first))
|
||||
if (guid.IsEmpty() || !player->GetSocial()->HasIgnore(guid))
|
||||
if (guid.IsEmpty() || !player->GetSocial()->HasIgnore(guid, accountGuid))
|
||||
localizer(player);
|
||||
}
|
||||
|
||||
@@ -1040,12 +1046,13 @@ void Channel::SendToOne(Builder& builder, ObjectGuid const& who) const
|
||||
}
|
||||
|
||||
template <class Builder>
|
||||
void Channel::SendToAllWithAddon(Builder& builder, std::string const& addonPrefix, ObjectGuid const& guid /*= ObjectGuid::Empty*/) const
|
||||
void Channel::SendToAllWithAddon(Builder& builder, std::string const& addonPrefix, ObjectGuid const& guid /*= ObjectGuid::Empty*/,
|
||||
ObjectGuid const& accountGuid /*= ObjectGuid::Empty*/) const
|
||||
{
|
||||
Trinity::LocalizedDo<Builder> localizer(builder);
|
||||
|
||||
for (PlayerContainer::value_type const& i : _playersStore)
|
||||
if (Player* player = ObjectAccessor::FindConnectedPlayer(i.first))
|
||||
if (player->GetSession()->IsAddonRegistered(addonPrefix) && (guid.IsEmpty() || !player->GetSocial()->HasIgnore(guid)))
|
||||
if (player->GetSession()->IsAddonRegistered(addonPrefix) && (guid.IsEmpty() || !player->GetSocial()->HasIgnore(guid, accountGuid)))
|
||||
localizer(player);
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@ class TC_GAME_API Channel
|
||||
|
||||
private:
|
||||
template <class Builder>
|
||||
void SendToAll(Builder& builder, ObjectGuid const& guid = ObjectGuid::Empty) const;
|
||||
void SendToAll(Builder& builder, ObjectGuid const& guid = ObjectGuid::Empty, ObjectGuid const& accountGuid = ObjectGuid::Empty) const;
|
||||
|
||||
template <class Builder>
|
||||
void SendToAllButOne(Builder& builder, ObjectGuid const& who) const;
|
||||
@@ -242,7 +242,7 @@ class TC_GAME_API Channel
|
||||
void SendToOne(Builder& builder, ObjectGuid const& who) const;
|
||||
|
||||
template <class Builder>
|
||||
void SendToAllWithAddon(Builder& builder, std::string const& addonPrefix, ObjectGuid const& guid = ObjectGuid::Empty) const;
|
||||
void SendToAllWithAddon(Builder& builder, std::string const& addonPrefix, ObjectGuid const& guid = ObjectGuid::Empty, ObjectGuid const& accountGuid = ObjectGuid::Empty) const;
|
||||
|
||||
bool IsOn(ObjectGuid const& who) const { return _playersStore.count(who) != 0; }
|
||||
bool IsBanned(ObjectGuid const& guid) const { return _bannedStore.count(guid) != 0; }
|
||||
|
||||
@@ -1906,7 +1906,9 @@ bool LFGMgr::HasIgnore(ObjectGuid guid1, ObjectGuid guid2)
|
||||
{
|
||||
Player* plr1 = ObjectAccessor::FindConnectedPlayer(guid1);
|
||||
Player* plr2 = ObjectAccessor::FindConnectedPlayer(guid2);
|
||||
return plr1 && plr2 && (plr1->GetSocial()->HasIgnore(guid2) || plr2->GetSocial()->HasIgnore(guid1));
|
||||
return plr1 && plr2
|
||||
&& (plr1->GetSocial()->HasIgnore(guid2, plr2->GetSession()->GetAccountGUID())
|
||||
|| plr2->GetSocial()->HasIgnore(guid1, plr1->GetSession()->GetAccountGUID()));
|
||||
}
|
||||
|
||||
void LFGMgr::SendLfgRoleChosen(ObjectGuid guid, ObjectGuid pguid, uint8 roles)
|
||||
|
||||
@@ -34,7 +34,7 @@ uint32 PlayerSocial::GetNumberOfSocialsWithFlag(SocialFlag flag)
|
||||
return counter;
|
||||
}
|
||||
|
||||
bool PlayerSocial::AddToSocialList(ObjectGuid const& friendGuid, SocialFlag flag)
|
||||
bool PlayerSocial::AddToSocialList(ObjectGuid const& friendGuid, ObjectGuid const& accountGuid, SocialFlag flag)
|
||||
{
|
||||
// check client limits
|
||||
if (GetNumberOfSocialsWithFlag(flag) >= (((flag & SOCIAL_FLAG_FRIEND) != 0) ? SOCIALMGR_FRIEND_LIMIT : SOCIALMGR_IGNORE_LIMIT))
|
||||
@@ -44,6 +44,7 @@ bool PlayerSocial::AddToSocialList(ObjectGuid const& friendGuid, SocialFlag flag
|
||||
if (itr != _playerSocialMap.end())
|
||||
{
|
||||
itr->second.Flags |= flag;
|
||||
itr->second.WowAccountGuid = accountGuid;
|
||||
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHARACTER_SOCIAL_FLAGS);
|
||||
|
||||
@@ -55,7 +56,10 @@ bool PlayerSocial::AddToSocialList(ObjectGuid const& friendGuid, SocialFlag flag
|
||||
}
|
||||
else
|
||||
{
|
||||
_playerSocialMap[friendGuid].Flags |= flag;
|
||||
itr = _playerSocialMap.emplace(std::piecewise_construct, std::forward_as_tuple(friendGuid), std::forward_as_tuple()).first;
|
||||
|
||||
itr->second.Flags |= flag;
|
||||
itr->second.WowAccountGuid = accountGuid;
|
||||
|
||||
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_SOCIAL);
|
||||
|
||||
@@ -66,6 +70,9 @@ bool PlayerSocial::AddToSocialList(ObjectGuid const& friendGuid, SocialFlag flag
|
||||
CharacterDatabase.Execute(stmt);
|
||||
}
|
||||
|
||||
if (flag & SOCIAL_FLAG_IGNORED)
|
||||
_ignoredAccounts.insert(accountGuid);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -86,7 +93,20 @@ void PlayerSocial::RemoveFromSocialList(ObjectGuid const& friendGuid, SocialFlag
|
||||
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
ObjectGuid accountGuid = itr->second.WowAccountGuid;
|
||||
|
||||
_playerSocialMap.erase(itr);
|
||||
|
||||
if (flag & SOCIAL_FLAG_IGNORED)
|
||||
{
|
||||
auto otherIgnoreForAccount = std::find_if(_playerSocialMap.begin(), _playerSocialMap.end(), [&](PlayerSocialMap::value_type const& social)
|
||||
{
|
||||
return social.second.Flags & SOCIAL_FLAG_IGNORED && social.second.WowAccountGuid == accountGuid;
|
||||
});
|
||||
|
||||
if (otherIgnoreForAccount == _playerSocialMap.end())
|
||||
_ignoredAccounts.erase(accountGuid);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -156,9 +176,9 @@ bool PlayerSocial::HasFriend(ObjectGuid const& friendGuid)
|
||||
return _HasContact(friendGuid, SOCIAL_FLAG_FRIEND);
|
||||
}
|
||||
|
||||
bool PlayerSocial::HasIgnore(ObjectGuid const& ignoreGuid)
|
||||
bool PlayerSocial::HasIgnore(ObjectGuid const& ignoreGuid, ObjectGuid const& ignoreAccountGuid)
|
||||
{
|
||||
return _HasContact(ignoreGuid, SOCIAL_FLAG_IGNORED);
|
||||
return _HasContact(ignoreGuid, SOCIAL_FLAG_IGNORED) || _ignoredAccounts.find(ignoreAccountGuid) != _ignoredAccounts.end();
|
||||
}
|
||||
|
||||
SocialMgr* SocialMgr::instance()
|
||||
@@ -273,6 +293,8 @@ PlayerSocial* SocialMgr::LoadFromDB(PreparedQueryResult result, ObjectGuid const
|
||||
|
||||
uint8 flag = fields[2].GetUInt8();
|
||||
social->_playerSocialMap[friendGuid] = FriendInfo(friendAccountGuid, flag, fields[3].GetString());
|
||||
if (flag & SOCIAL_FLAG_IGNORED)
|
||||
social->_ignoredAccounts.insert(friendAccountGuid);
|
||||
}
|
||||
while (result->NextRow());
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ class TC_GAME_API PlayerSocial
|
||||
|
||||
public:
|
||||
// adding/removing
|
||||
bool AddToSocialList(ObjectGuid const& guid, SocialFlag flag);
|
||||
bool AddToSocialList(ObjectGuid const& guid, ObjectGuid const& accountGuid, SocialFlag flag);
|
||||
void RemoveFromSocialList(ObjectGuid const& guid, SocialFlag flag);
|
||||
void SetFriendNote(ObjectGuid const& guid, std::string const& note);
|
||||
|
||||
@@ -115,7 +115,7 @@ class TC_GAME_API PlayerSocial
|
||||
|
||||
// Misc
|
||||
bool HasFriend(ObjectGuid const& friendGuid);
|
||||
bool HasIgnore(ObjectGuid const& ignoreGuid);
|
||||
bool HasIgnore(ObjectGuid const& ignoreGuid, ObjectGuid const& ignoreAccountGuid);
|
||||
|
||||
ObjectGuid const& GetPlayerGUID() const { return _playerGUID; }
|
||||
void SetPlayerGUID(ObjectGuid const& guid) { _playerGUID = guid; }
|
||||
@@ -127,6 +127,7 @@ class TC_GAME_API PlayerSocial
|
||||
|
||||
typedef std::map<ObjectGuid, FriendInfo> PlayerSocialMap;
|
||||
PlayerSocialMap _playerSocialMap;
|
||||
GuidUnorderedSet _ignoredAccounts;
|
||||
|
||||
ObjectGuid _playerGUID;
|
||||
};
|
||||
|
||||
@@ -1680,7 +1680,7 @@ void Guild::HandleInviteMember(WorldSession* session, std::string const& name)
|
||||
|
||||
Player* player = session->GetPlayer();
|
||||
// Do not show invitations from ignored players
|
||||
if (pInvitee->GetSocial()->HasIgnore(player->GetGUID()))
|
||||
if (pInvitee->GetSocial()->HasIgnore(player->GetGUID(), player->GetSession()->GetAccountGUID()))
|
||||
return;
|
||||
|
||||
if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && pInvitee->GetTeam() != player->GetTeam())
|
||||
@@ -2601,7 +2601,7 @@ void Guild::BroadcastToGuild(WorldSession* session, bool officerOnly, std::strin
|
||||
for (auto itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||
if (Player* player = itr->second->FindConnectedPlayer())
|
||||
if (player->GetSession() && _HasRankRight(player, officerOnly ? GR_RIGHT_OFFCHATLISTEN : GR_RIGHT_GCHATLISTEN) &&
|
||||
!player->GetSocial()->HasIgnore(session->GetPlayer()->GetGUID()))
|
||||
!player->GetSocial()->HasIgnore(session->GetPlayer()->GetGUID(), session->GetAccountGUID()))
|
||||
player->SendDirectMessage(data);
|
||||
}
|
||||
}
|
||||
@@ -2616,7 +2616,7 @@ void Guild::BroadcastAddonToGuild(WorldSession* session, bool officerOnly, std::
|
||||
for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||
if (Player* player = itr->second->FindPlayer())
|
||||
if (player->GetSession() && _HasRankRight(player, officerOnly ? GR_RIGHT_OFFCHATLISTEN : GR_RIGHT_GCHATLISTEN) &&
|
||||
!player->GetSocial()->HasIgnore(session->GetPlayer()->GetGUID()) &&
|
||||
!player->GetSocial()->HasIgnore(session->GetPlayer()->GetGUID(), session->GetAccountGUID()) &&
|
||||
player->GetSession()->IsAddonRegistered(prefix))
|
||||
player->SendDirectMessage(data);
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ void WorldSession::HandlePartyInviteOpcode(WorldPackets::Party::PartyInviteClien
|
||||
return;
|
||||
}
|
||||
|
||||
if (invitedPlayer->GetSocial()->HasIgnore(invitingPlayer->GetGUID()))
|
||||
if (invitedPlayer->GetSocial()->HasIgnore(invitingPlayer->GetGUID(), invitingPlayer->GetSession()->GetAccountGUID()))
|
||||
{
|
||||
SendPartyResult(PARTY_OP_INVITE, invitedPlayer->GetName(), ERR_IGNORING_YOU_S);
|
||||
return;
|
||||
|
||||
@@ -44,35 +44,35 @@ void WorldSession::HandleAddFriendOpcode(WorldPackets::Social::AddFriend& packet
|
||||
GetPlayerInfo().c_str(), packet.Name.c_str());
|
||||
|
||||
FriendsResult friendResult = FRIEND_NOT_FOUND;
|
||||
ObjectGuid friendGuid = sCharacterCache->GetCharacterGuidByName(packet.Name);
|
||||
if (!friendGuid.IsEmpty())
|
||||
ObjectGuid friendGuid;
|
||||
|
||||
if (CharacterCacheEntry const* characterInfo = sCharacterCache->GetCharacterCacheByName(packet.Name))
|
||||
{
|
||||
if (CharacterCacheEntry const* characterInfo = sCharacterCache->GetCharacterCacheByGuid(friendGuid))
|
||||
friendGuid = characterInfo->Guid;
|
||||
ObjectGuid friendAccountGuid = ObjectGuid::Create<HighGuid::WowAccount>(characterInfo->AccountId);
|
||||
uint32 team = Player::TeamForRace(characterInfo->Race);
|
||||
uint32 friendAccountId = characterInfo->AccountId;
|
||||
|
||||
if (HasPermission(rbac::RBAC_PERM_ALLOW_GM_FRIEND) || AccountMgr::IsPlayerAccount(AccountMgr::GetSecurity(friendAccountId, realm.Id.Realm)))
|
||||
{
|
||||
uint32 team = Player::TeamForRace(characterInfo->Race);
|
||||
uint32 friendAccountId = characterInfo->AccountId;
|
||||
|
||||
if (HasPermission(rbac::RBAC_PERM_ALLOW_GM_FRIEND) || AccountMgr::IsPlayerAccount(AccountMgr::GetSecurity(friendAccountId, realm.Id.Realm)))
|
||||
if (friendGuid == GetPlayer()->GetGUID())
|
||||
friendResult = FRIEND_SELF;
|
||||
else if (GetPlayer()->GetTeam() != team && !HasPermission(rbac::RBAC_PERM_TWO_SIDE_ADD_FRIEND))
|
||||
friendResult = FRIEND_ENEMY;
|
||||
else if (GetPlayer()->GetSocial()->HasFriend(friendGuid))
|
||||
friendResult = FRIEND_ALREADY;
|
||||
else
|
||||
{
|
||||
if (friendGuid == GetPlayer()->GetGUID())
|
||||
friendResult = FRIEND_SELF;
|
||||
else if (GetPlayer()->GetTeam() != team && !HasPermission(rbac::RBAC_PERM_TWO_SIDE_ADD_FRIEND))
|
||||
friendResult = FRIEND_ENEMY;
|
||||
else if (GetPlayer()->GetSocial()->HasFriend(friendGuid))
|
||||
friendResult = FRIEND_ALREADY;
|
||||
Player* playerFriend = ObjectAccessor::FindPlayer(friendGuid);
|
||||
if (playerFriend && playerFriend->IsVisibleGloballyFor(GetPlayer()))
|
||||
friendResult = FRIEND_ADDED_ONLINE;
|
||||
else
|
||||
{
|
||||
Player* playerFriend = ObjectAccessor::FindPlayer(friendGuid);
|
||||
if (playerFriend && playerFriend->IsVisibleGloballyFor(GetPlayer()))
|
||||
friendResult = FRIEND_ADDED_ONLINE;
|
||||
else
|
||||
friendResult = FRIEND_ADDED_OFFLINE;
|
||||
friendResult = FRIEND_ADDED_OFFLINE;
|
||||
|
||||
if (GetPlayer()->GetSocial()->AddToSocialList(friendGuid, SOCIAL_FLAG_FRIEND))
|
||||
GetPlayer()->GetSocial()->SetFriendNote(friendGuid, packet.Notes);
|
||||
else
|
||||
friendResult = FRIEND_LIST_FULL;
|
||||
}
|
||||
if (GetPlayer()->GetSocial()->AddToSocialList(friendGuid, friendAccountGuid, SOCIAL_FLAG_FRIEND))
|
||||
GetPlayer()->GetSocial()->SetFriendNote(friendGuid, packet.Notes);
|
||||
else
|
||||
friendResult = FRIEND_LIST_FULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -98,25 +98,28 @@ void WorldSession::HandleAddIgnoreOpcode(WorldPackets::Social::AddIgnore& packet
|
||||
TC_LOG_DEBUG("network", "WorldSession::HandleAddIgnoreOpcode: %s asked to Ignore: %s",
|
||||
GetPlayer()->GetName().c_str(), packet.Name.c_str());
|
||||
|
||||
ObjectGuid ignoreGuid = sCharacterCache->GetCharacterGuidByName(packet.Name);
|
||||
ObjectGuid ignoreGuid;
|
||||
FriendsResult ignoreResult = FRIEND_IGNORE_NOT_FOUND;
|
||||
if (!ignoreGuid.IsEmpty())
|
||||
|
||||
if (CharacterCacheEntry const* characterInfo = sCharacterCache->GetCharacterCacheByName(packet.Name))
|
||||
{
|
||||
ignoreGuid = characterInfo->Guid;
|
||||
ObjectGuid ignoreAccountGuid = ObjectGuid::Create<HighGuid::WowAccount>(characterInfo->AccountId);
|
||||
if (ignoreGuid == GetPlayer()->GetGUID()) //not add yourself
|
||||
ignoreResult = FRIEND_IGNORE_SELF;
|
||||
else if (GetPlayer()->GetSocial()->HasIgnore(ignoreGuid))
|
||||
else if (GetPlayer()->GetSocial()->HasIgnore(ignoreGuid, ignoreAccountGuid))
|
||||
ignoreResult = FRIEND_IGNORE_ALREADY;
|
||||
else
|
||||
{
|
||||
ignoreResult = FRIEND_IGNORE_ADDED;
|
||||
|
||||
// ignore list full
|
||||
if (!GetPlayer()->GetSocial()->AddToSocialList(ignoreGuid, SOCIAL_FLAG_IGNORED))
|
||||
if (!GetPlayer()->GetSocial()->AddToSocialList(ignoreGuid, ignoreAccountGuid, SOCIAL_FLAG_IGNORED))
|
||||
ignoreResult = FRIEND_IGNORE_FULL;
|
||||
}
|
||||
}
|
||||
|
||||
sSocialMgr->SendFriendStatus(GetPlayer(), ignoreResult, ignoreGuid);
|
||||
sSocialMgr->SendFriendStatus(GetPlayer(), ignoreResult, ObjectGuid::Empty);
|
||||
}
|
||||
|
||||
void WorldSession::HandleDelIgnoreOpcode(WorldPackets::Social::DelIgnore& packet)
|
||||
|
||||
@@ -659,7 +659,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPackets::Trade::InitiateTrade&
|
||||
return;
|
||||
}
|
||||
|
||||
if (pOther->GetSocial()->HasIgnore(GetPlayer()->GetGUID()))
|
||||
if (pOther->GetSocial()->HasIgnore(GetPlayer()->GetGUID(), GetPlayer()->GetSession()->GetAccountGUID()))
|
||||
{
|
||||
info.Status = TRADE_STATUS_PLAYER_IGNORED;
|
||||
SendTradeStatus(info);
|
||||
|
||||
@@ -3514,7 +3514,7 @@ void Spell::EffectDuel()
|
||||
Player* target = unitTarget->ToPlayer();
|
||||
|
||||
// caster or target already have requested duel
|
||||
if (caster->duel || target->duel || !target->GetSocial() || target->GetSocial()->HasIgnore(caster->GetGUID()))
|
||||
if (caster->duel || target->duel || !target->GetSocial() || target->GetSocial()->HasIgnore(caster->GetGUID(), caster->GetSession()->GetAccountGUID()))
|
||||
return;
|
||||
|
||||
// Players can only fight a duel in zones with this flag
|
||||
|
||||
Reference in New Issue
Block a user