Core/Social: Use full guid for friend and ignore storage

This commit is contained in:
Shauren
2014-10-22 12:52:12 +02:00
parent 1ac720f95f
commit 0e35a715e5
14 changed files with 72 additions and 75 deletions
+1 -1
View File
@@ -182,7 +182,7 @@ void Arena::EndBattleground(uint32 winner)
for (auto const& score : PlayerScores)
if (Player* player = ObjectAccessor::FindConnectedPlayer(score.first))
{
TC_LOG_DEBUG("bg.arena", "Statistics match Type: %u for %s (GUID: %u, Team: %d, IP: %s): %s",
TC_LOG_DEBUG("bg.arena", "Statistics match Type: %u for %s (%s, Team: %d, IP: %s): %s",
GetArenaType(), player->GetName().c_str(), score.first.ToString().c_str(), player->GetArenaTeamId(GetArenaType() == 5 ? 2 : GetArenaType() == 3),
player->GetSession()->GetRemoteAddress().c_str(), score.second->ToString().c_str());
}
+2 -2
View File
@@ -676,7 +676,7 @@ void Channel::Invite(Player const* player, std::string const& newname)
return;
}
if (!newp->GetSocial()->HasIgnore(guid.GetCounter()))
if (!newp->GetSocial()->HasIgnore(guid))
{
WorldPacket data;
MakeInvite(&data, guid);
@@ -724,7 +724,7 @@ void Channel::SendToAll(WorldPacket* data, ObjectGuid guid)
{
for (PlayerContainer::const_iterator i = playersStore.begin(); i != playersStore.end(); ++i)
if (Player* player = ObjectAccessor::FindConnectedPlayer(i->first))
if (!guid || !player->GetSocial()->HasIgnore(guid.GetCounter()))
if (!guid || !player->GetSocial()->HasIgnore(guid))
player->GetSession()->SendPacket(data);
}
+1 -1
View File
@@ -1776,7 +1776,7 @@ bool LFGMgr::HasIgnore(ObjectGuid guid1, ObjectGuid guid2)
{
Player* plr1 = ObjectAccessor::FindConnectedPlayer(guid1);
Player* plr2 = ObjectAccessor::FindConnectedPlayer(guid2);
return plr1 && plr2 && (plr1->GetSocial()->HasIgnore(guid2.GetCounter()) || plr2->GetSocial()->HasIgnore(guid1.GetCounter()));
return plr1 && plr2 && (plr1->GetSocial()->HasIgnore(guid2) || plr2->GetSocial()->HasIgnore(guid1));
}
void LFGMgr::SendLfgRoleChosen(ObjectGuid guid, ObjectGuid pguid, uint8 roles)
+4 -4
View File
@@ -4808,10 +4808,10 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe
{
do
{
if (Player* pFriend = ObjectAccessor::FindPlayer(ObjectGuid(HIGHGUID_PLAYER, 0, (*resultFriends)[0].GetUInt32())))
if (Player* pFriend = ObjectAccessor::FindPlayer(ObjectGuid(HIGHGUID_PLAYER, (*resultFriends)[0].GetUInt32())))
{
pFriend->GetSocial()->RemoveFromSocialList(guid, false);
sSocialMgr->SendFriendStatus(pFriend, FRIEND_REMOVED, guid, false);
pFriend->GetSocial()->RemoveFromSocialList(playerguid, false);
sSocialMgr->SendFriendStatus(pFriend, FRIEND_REMOVED, playerguid, false);
}
} while (resultFriends->NextRow());
}
@@ -17787,7 +17787,7 @@ bool Player::LoadFromDB(ObjectGuid guid, SQLQueryHolder *holder)
// unread mails and next delivery time, actual mails not loaded
_LoadMailInit(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_MAIL_COUNT), holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_MAIL_DATE));
m_social = sSocialMgr->LoadFromDB(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_SOCIAL_LIST), GetGUIDLow());
m_social = sSocialMgr->LoadFromDB(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_SOCIAL_LIST), GetGUID());
// check PLAYER_CHOSEN_TITLE compatibility with PLAYER__FIELD_KNOWN_TITLES
// note: PLAYER__FIELD_KNOWN_TITLES updated at quest status loaded
+26 -29
View File
@@ -28,9 +28,6 @@
#include "AccountMgr.h"
#include "WorldSession.h"
PlayerSocial::PlayerSocial(): m_playerGUID()
{ }
uint32 PlayerSocial::GetNumberOfSocialsWithFlag(SocialFlag flag)
{
uint32 counter = 0;
@@ -41,7 +38,7 @@ uint32 PlayerSocial::GetNumberOfSocialsWithFlag(SocialFlag flag)
return counter;
}
bool PlayerSocial::AddToSocialList(uint32 friendGuid, bool ignore)
bool PlayerSocial::AddToSocialList(ObjectGuid const& friendGuid, bool ignore)
{
// check client limits
if (ignore)
@@ -65,8 +62,8 @@ bool PlayerSocial::AddToSocialList(uint32 friendGuid, bool ignore)
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_CHARACTER_SOCIAL_FLAGS);
stmt->setUInt8(0, flag);
stmt->setUInt32(1, GetPlayerGUID());
stmt->setUInt32(2, friendGuid);
stmt->setUInt32(1, GetPlayerGUID().GetCounter());
stmt->setUInt32(2, friendGuid.GetCounter());
CharacterDatabase.Execute(stmt);
@@ -76,8 +73,8 @@ bool PlayerSocial::AddToSocialList(uint32 friendGuid, bool ignore)
{
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHARACTER_SOCIAL);
stmt->setUInt32(0, GetPlayerGUID());
stmt->setUInt32(1, friendGuid);
stmt->setUInt32(0, GetPlayerGUID().GetCounter());
stmt->setUInt32(1, friendGuid.GetCounter());
stmt->setUInt8(2, flag);
CharacterDatabase.Execute(stmt);
@@ -89,7 +86,7 @@ bool PlayerSocial::AddToSocialList(uint32 friendGuid, bool ignore)
return true;
}
void PlayerSocial::RemoveFromSocialList(uint32 friendGuid, bool ignore)
void PlayerSocial::RemoveFromSocialList(ObjectGuid const& friendGuid, bool ignore)
{
PlayerSocialMap::iterator itr = m_playerSocialMap.find(friendGuid);
if (itr == m_playerSocialMap.end()) // not exist
@@ -104,8 +101,8 @@ void PlayerSocial::RemoveFromSocialList(uint32 friendGuid, bool ignore)
{
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHARACTER_SOCIAL);
stmt->setUInt32(0, GetPlayerGUID());
stmt->setUInt32(1, friendGuid);
stmt->setUInt32(0, GetPlayerGUID().GetCounter());
stmt->setUInt32(1, friendGuid.GetCounter());
CharacterDatabase.Execute(stmt);
@@ -116,14 +113,14 @@ void PlayerSocial::RemoveFromSocialList(uint32 friendGuid, bool ignore)
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_REM_CHARACTER_SOCIAL_FLAGS);
stmt->setUInt8(0, flag);
stmt->setUInt32(1, GetPlayerGUID());
stmt->setUInt32(2, friendGuid);
stmt->setUInt32(1, GetPlayerGUID().GetCounter());
stmt->setUInt32(2, friendGuid.GetCounter());
CharacterDatabase.Execute(stmt);
}
}
void PlayerSocial::SetFriendNote(uint32 friendGuid, std::string note)
void PlayerSocial::SetFriendNote(ObjectGuid const& friendGuid, std::string note)
{
PlayerSocialMap::const_iterator itr = m_playerSocialMap.find(friendGuid);
if (itr == m_playerSocialMap.end()) // not exist
@@ -134,8 +131,8 @@ void PlayerSocial::SetFriendNote(uint32 friendGuid, std::string note)
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHARACTER_SOCIAL_NOTE);
stmt->setString(0, note);
stmt->setUInt32(1, GetPlayerGUID());
stmt->setUInt32(2, friendGuid);
stmt->setUInt32(1, GetPlayerGUID().GetCounter());
stmt->setUInt32(2, friendGuid.GetCounter());
CharacterDatabase.Execute(stmt);
@@ -157,7 +154,7 @@ void PlayerSocial::SendSocialList(Player* player)
{
sSocialMgr->GetFriendInfo(player, itr->first, itr->second);
data << uint64(itr->first); // player guid
data << itr->first; // player guid
data << uint32(itr->second.Flags); // player flag (0x1 = Friend, 0x2 = Ignored, 0x4 = Muted)
data << itr->second.Note; // string note
if (itr->second.Flags & SOCIAL_FLAG_FRIEND) // if IsFriend()
@@ -176,7 +173,7 @@ void PlayerSocial::SendSocialList(Player* player)
TC_LOG_DEBUG("network", "WORLD: Sent SMSG_CONTACT_LIST");
}
bool PlayerSocial::HasFriend(uint32 friendGuid)
bool PlayerSocial::HasFriend(ObjectGuid const& friendGuid)
{
PlayerSocialMap::const_iterator itr = m_playerSocialMap.find(friendGuid);
if (itr != m_playerSocialMap.end())
@@ -184,7 +181,7 @@ bool PlayerSocial::HasFriend(uint32 friendGuid)
return false;
}
bool PlayerSocial::HasIgnore(uint32 ignore_guid)
bool PlayerSocial::HasIgnore(ObjectGuid const& ignore_guid)
{
PlayerSocialMap::const_iterator itr = m_playerSocialMap.find(ignore_guid);
if (itr != m_playerSocialMap.end())
@@ -196,7 +193,7 @@ SocialMgr::SocialMgr() { }
SocialMgr::~SocialMgr() { }
void SocialMgr::GetFriendInfo(Player* player, uint32 friendGUID, FriendInfo &friendInfo)
void SocialMgr::GetFriendInfo(Player* player, ObjectGuid const& friendGUID, FriendInfo &friendInfo)
{
if (!player)
return;
@@ -206,7 +203,7 @@ void SocialMgr::GetFriendInfo(Player* player, uint32 friendGUID, FriendInfo &fri
friendInfo.Level = 0;
friendInfo.Class = 0;
Player* target = ObjectAccessor::FindPlayer(ObjectGuid(HIGHGUID_PLAYER, friendGUID));
Player* target = ObjectAccessor::FindPlayer(friendGUID);
if (!target)
return;
@@ -240,14 +237,14 @@ void SocialMgr::GetFriendInfo(Player* player, uint32 friendGUID, FriendInfo &fri
}
}
void SocialMgr::MakeFriendStatusPacket(FriendsResult result, uint32 guid, WorldPacket* data)
void SocialMgr::MakeFriendStatusPacket(FriendsResult result, ObjectGuid const& guid, WorldPacket* data)
{
data->Initialize(SMSG_FRIEND_STATUS, 9);
*data << uint8(result);
*data << uint64(guid);
*data << guid;
}
void SocialMgr::SendFriendStatus(Player* player, FriendsResult result, uint32 friendGuid, bool broadcast)
void SocialMgr::SendFriendStatus(Player* player, FriendsResult result, ObjectGuid const& friendGuid, bool broadcast)
{
FriendInfo fi;
@@ -291,10 +288,10 @@ void SocialMgr::BroadcastToFriendListers(Player* player, WorldPacket* packet)
AccountTypes gmSecLevel = AccountTypes(sWorld->getIntConfig(CONFIG_GM_LEVEL_IN_WHO_LIST));
for (SocialMap::const_iterator itr = m_socialMap.begin(); itr != m_socialMap.end(); ++itr)
{
PlayerSocialMap::const_iterator itr2 = itr->second.m_playerSocialMap.find(player->GetGUIDLow());
PlayerSocialMap::const_iterator itr2 = itr->second.m_playerSocialMap.find(player->GetGUID());
if (itr2 != itr->second.m_playerSocialMap.end() && (itr2->second.Flags & SOCIAL_FLAG_FRIEND))
{
Player* target = ObjectAccessor::FindPlayer(ObjectGuid(HIGHGUID_PLAYER, 0, itr->first));
Player* target = ObjectAccessor::FindPlayer(itr->first);
if (!target)
continue;
@@ -311,7 +308,7 @@ void SocialMgr::BroadcastToFriendListers(Player* player, WorldPacket* packet)
}
}
PlayerSocial* SocialMgr::LoadFromDB(PreparedQueryResult result, uint32 guid)
PlayerSocial* SocialMgr::LoadFromDB(PreparedQueryResult result, ObjectGuid const& guid)
{
PlayerSocial *social = &m_socialMap[guid];
social->SetPlayerGUID(guid);
@@ -319,7 +316,7 @@ PlayerSocial* SocialMgr::LoadFromDB(PreparedQueryResult result, uint32 guid)
if (!result)
return social;
uint32 friendGuid = 0;
ObjectGuid friendGuid;
uint8 flags = 0;
std::string note = "";
@@ -327,7 +324,7 @@ PlayerSocial* SocialMgr::LoadFromDB(PreparedQueryResult result, uint32 guid)
{
Field* fields = result->Fetch();
friendGuid = fields[0].GetUInt32();
friendGuid = ObjectGuid(HIGHGUID_PLAYER, fields[0].GetUInt32());
flags = fields[1].GetUInt8();
note = fields[2].GetString();
+16 -16
View File
@@ -21,6 +21,7 @@
#include "DatabaseEnv.h"
#include "Common.h"
#include "ObjectGuid.h"
class SocialMgr;
class PlayerSocial;
@@ -60,8 +61,8 @@ struct FriendInfo
{ }
};
typedef std::map<uint32, FriendInfo> PlayerSocialMap;
typedef std::map<uint32, PlayerSocial> SocialMap;
typedef std::map<ObjectGuid, FriendInfo> PlayerSocialMap;
typedef std::map<ObjectGuid, PlayerSocial> SocialMap;
/// Results of friend related commands
enum FriendsResult
@@ -102,22 +103,21 @@ class PlayerSocial
{
friend class SocialMgr;
public:
PlayerSocial();
// adding/removing
bool AddToSocialList(uint32 friend_guid, bool ignore);
void RemoveFromSocialList(uint32 friend_guid, bool ignore);
void SetFriendNote(uint32 friendGuid, std::string note);
bool AddToSocialList(ObjectGuid const& friend_guid, bool ignore);
void RemoveFromSocialList(ObjectGuid const& friend_guid, bool ignore);
void SetFriendNote(ObjectGuid const& friendGuid, std::string note);
// Packet send's
void SendSocialList(Player* player);
// Misc
bool HasFriend(uint32 friend_guid);
bool HasIgnore(uint32 ignore_guid);
uint32 GetPlayerGUID() const { return m_playerGUID; }
void SetPlayerGUID(uint32 guid) { m_playerGUID = guid; }
bool HasFriend(ObjectGuid const& friend_guid);
bool HasIgnore(ObjectGuid const& ignore_guid);
ObjectGuid const& GetPlayerGUID() const { return m_playerGUID; }
void SetPlayerGUID(ObjectGuid const& guid) { m_playerGUID = guid; }
uint32 GetNumberOfSocialsWithFlag(SocialFlag flag);
private:
PlayerSocialMap m_playerSocialMap;
uint32 m_playerGUID;
ObjectGuid m_playerGUID;
};
class SocialMgr
@@ -134,15 +134,15 @@ class SocialMgr
}
// Misc
void RemovePlayerSocial(uint32 guid) { m_socialMap.erase(guid); }
void RemovePlayerSocial(ObjectGuid const& guid) { m_socialMap.erase(guid); }
void GetFriendInfo(Player* player, uint32 friendGUID, FriendInfo &friendInfo);
void GetFriendInfo(Player* player, ObjectGuid const& friendGUID, FriendInfo &friendInfo);
// Packet management
void MakeFriendStatusPacket(FriendsResult result, uint32 friend_guid, WorldPacket* data);
void SendFriendStatus(Player* player, FriendsResult result, uint32 friend_guid, bool broadcast);
void MakeFriendStatusPacket(FriendsResult result, ObjectGuid const& friend_guid, WorldPacket* data);
void SendFriendStatus(Player* player, FriendsResult result, ObjectGuid const& friend_guid, bool broadcast);
void BroadcastToFriendListers(Player* player, WorldPacket* packet);
// Loading
PlayerSocial *LoadFromDB(PreparedQueryResult result, uint32 guid);
PlayerSocial *LoadFromDB(PreparedQueryResult result, ObjectGuid const& guid);
private:
SocialMap m_socialMap;
};
+3 -3
View File
@@ -1769,7 +1769,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->GetGUIDLow()))
if (pInvitee->GetSocial()->HasIgnore(player->GetGUID()))
return;
if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && pInvitee->GetTeam() != player->GetTeam())
@@ -2619,7 +2619,7 @@ void Guild::BroadcastToGuild(WorldSession* session, bool officerOnly, std::strin
for (Members::const_iterator 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()->GetGUIDLow()))
!player->GetSocial()->HasIgnore(session->GetPlayer()->GetGUID()))
player->GetSession()->SendPacket(&data);
}
}
@@ -2633,7 +2633,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()->GetGUIDLow()) &&
!player->GetSocial()->HasIgnore(session->GetPlayer()->GetGUID()) &&
player->GetSession()->IsAddonRegistered(prefix))
player->GetSession()->SendPacket(&data);
}
@@ -182,7 +182,7 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket& recvData)
}
// OK result but don't send invite
if (player->GetSocial()->HasIgnore(GetPlayer()->GetGUIDLow()))
if (player->GetSocial()->HasIgnore(GetPlayer()->GetGUID()))
return;
if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && player->GetTeam() != GetPlayer()->GetTeam())
@@ -1015,7 +1015,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
}
// friend status
sSocialMgr->SendFriendStatus(pCurrChar, FRIEND_ONLINE, pCurrChar->GetGUIDLow(), true);
sSocialMgr->SendFriendStatus(pCurrChar, FRIEND_ONLINE, pCurrChar->GetGUID(), true);
// Place character in world (and load zone) before some object loading
pCurrChar->LoadCorpse();
+1 -1
View File
@@ -140,7 +140,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket& recvData)
return;
}
if (player->GetSocial()->HasIgnore(GetPlayer()->GetGUIDLow()))
if (player->GetSocial()->HasIgnore(GetPlayer()->GetGUID()))
{
SendPartyResult(PARTY_OP_INVITE, memberName, ERR_IGNORING_YOU_S);
return;
+12 -12
View File
@@ -618,7 +618,7 @@ void WorldSession::HandleAddFriendOpcodeCallBack(PreparedQueryResult result, std
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.GetCounter()))
else if (GetPlayer()->GetSocial()->HasFriend(friendGuid))
friendResult = FRIEND_ALREADY;
else
{
@@ -627,18 +627,18 @@ void WorldSession::HandleAddFriendOpcodeCallBack(PreparedQueryResult result, std
friendResult = FRIEND_ADDED_ONLINE;
else
friendResult = FRIEND_ADDED_OFFLINE;
if (!GetPlayer()->GetSocial()->AddToSocialList(friendGuid.GetCounter(), false))
if (!GetPlayer()->GetSocial()->AddToSocialList(friendGuid, false))
{
friendResult = FRIEND_LIST_FULL;
TC_LOG_DEBUG("network", "WORLD: %s's friend list is full.", GetPlayer()->GetName().c_str());
}
}
GetPlayer()->GetSocial()->SetFriendNote(friendGuid.GetCounter(), friendNote);
GetPlayer()->GetSocial()->SetFriendNote(friendGuid, friendNote);
}
}
}
sSocialMgr->SendFriendStatus(GetPlayer(), friendResult, friendGuid.GetCounter(), false);
sSocialMgr->SendFriendStatus(GetPlayer(), friendResult, friendGuid, false);
TC_LOG_DEBUG("network", "WORLD: Sent (SMSG_FRIEND_STATUS)");
}
@@ -651,9 +651,9 @@ void WorldSession::HandleDelFriendOpcode(WorldPacket& recvData)
recvData >> FriendGUID;
_player->GetSocial()->RemoveFromSocialList(FriendGUID.GetCounter(), false);
_player->GetSocial()->RemoveFromSocialList(FriendGUID, false);
sSocialMgr->SendFriendStatus(GetPlayer(), FRIEND_REMOVED, FriendGUID.GetCounter(), false);
sSocialMgr->SendFriendStatus(GetPlayer(), FRIEND_REMOVED, FriendGUID, false);
TC_LOG_DEBUG("network", "WORLD: Sent motd (SMSG_FRIEND_STATUS)");
}
@@ -697,20 +697,20 @@ void WorldSession::HandleAddIgnoreOpcodeCallBack(PreparedQueryResult result)
{
if (IgnoreGuid == GetPlayer()->GetGUID()) //not add yourself
ignoreResult = FRIEND_IGNORE_SELF;
else if (GetPlayer()->GetSocial()->HasIgnore(IgnoreGuid.GetCounter()))
else if (GetPlayer()->GetSocial()->HasIgnore(IgnoreGuid))
ignoreResult = FRIEND_IGNORE_ALREADY;
else
{
ignoreResult = FRIEND_IGNORE_ADDED;
// ignore list full
if (!GetPlayer()->GetSocial()->AddToSocialList(IgnoreGuid.GetCounter(), true))
if (!GetPlayer()->GetSocial()->AddToSocialList(IgnoreGuid, true))
ignoreResult = FRIEND_IGNORE_FULL;
}
}
}
sSocialMgr->SendFriendStatus(GetPlayer(), ignoreResult, IgnoreGuid.GetCounter(), false);
sSocialMgr->SendFriendStatus(GetPlayer(), ignoreResult, IgnoreGuid, false);
TC_LOG_DEBUG("network", "WORLD: Sent (SMSG_FRIEND_STATUS)");
}
@@ -723,9 +723,9 @@ void WorldSession::HandleDelIgnoreOpcode(WorldPacket& recvData)
recvData >> IgnoreGUID;
_player->GetSocial()->RemoveFromSocialList(IgnoreGUID.GetCounter(), true);
_player->GetSocial()->RemoveFromSocialList(IgnoreGUID, true);
sSocialMgr->SendFriendStatus(GetPlayer(), FRIEND_IGNORE_REMOVED, IgnoreGUID.GetCounter(), false);
sSocialMgr->SendFriendStatus(GetPlayer(), FRIEND_IGNORE_REMOVED, IgnoreGUID, false);
TC_LOG_DEBUG("network", "WORLD: Sent motd (SMSG_FRIEND_STATUS)");
}
@@ -736,7 +736,7 @@ void WorldSession::HandleSetContactNotesOpcode(WorldPacket& recvData)
ObjectGuid guid;
std::string note;
recvData >> guid >> note;
_player->GetSocial()->SetFriendNote(guid.GetCounter(), note);
_player->GetSocial()->SetFriendNote(guid, note);
}
void WorldSession::HandleBugOpcode(WorldPacket& recvData)
+1 -1
View File
@@ -768,7 +768,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
return;
}
if (pOther->GetSocial()->HasIgnore(GetPlayer()->GetGUIDLow()))
if (pOther->GetSocial()->HasIgnore(GetPlayer()->GetGUID()))
{
info.Status = TRADE_STATUS_IGNORE_YOU;
SendTradeStatus(info);
+2 -2
View File
@@ -571,8 +571,8 @@ void WorldSession::LogoutPlayer(bool save)
}
//! Broadcast a logout message to the player's friends
sSocialMgr->SendFriendStatus(_player, FRIEND_OFFLINE, _player->GetGUIDLow(), true);
sSocialMgr->RemovePlayerSocial(_player->GetGUIDLow());
sSocialMgr->SendFriendStatus(_player, FRIEND_OFFLINE, _player->GetGUID(), true);
sSocialMgr->RemovePlayerSocial(_player->GetGUID());
//! Call script hook before deletion
sScriptMgr->OnPlayerLogout(_player);
+1 -1
View File
@@ -3835,7 +3835,7 @@ void Spell::EffectDuel(SpellEffIndex effIndex)
Player* target = unitTarget->ToPlayer();
// caster or target already have requested duel
if (caster->duel || target->duel || !target->GetSocial() || target->GetSocial()->HasIgnore(caster->GetGUIDLow()))
if (caster->duel || target->duel || !target->GetSocial() || target->GetSocial()->HasIgnore(caster->GetGUID()))
return;
// Players can only fight a duel in zones with this flag