Core/Packets: updated some contactlist packets

(cherry picked from commit e01bb91)
This commit is contained in:
Aokromes committed 2017-02-01 02:11:56 +01:00
1 parent 904bbf9f5a
commit 8a63c4919e
19 files changed
+362 -379

No files matched your search

+12 -7
View File
@@ -4422,16 +4422,15 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe
// Delete char from social list of online chars
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_SOCIAL);
stmt->setUInt32(0, guid);
PreparedQueryResult resultFriends = CharacterDatabase.Query(stmt);
if (resultFriends)
if (PreparedQueryResult resultFriends = CharacterDatabase.Query(stmt))
{
do
{
if (Player* pFriend = ObjectAccessor::FindPlayer(ObjectGuid(HighGuid::Player, 0, (*resultFriends)[0].GetUInt32())))
if (Player* playerFriend = ObjectAccessor::FindPlayer(ObjectGuid(HighGuid::Player, 0, (*resultFriends)[0].GetUInt32())))
{
pFriend->GetSocial()->RemoveFromSocialList(guid, false);
sSocialMgr->SendFriendStatus(pFriend, FRIEND_REMOVED, guid, false);
playerFriend->GetSocial()->RemoveFromSocialList(playerguid, SOCIAL_FLAG_ALL);
sSocialMgr->SendFriendStatus(playerFriend, FRIEND_REMOVED, playerguid);
}
} while (resultFriends->NextRow());
}
@@ -17761,7 +17760,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), GetGUID().GetCounter());
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
@@ -23171,7 +23170,7 @@ void Player::SetGroup(Group* group, int8 subgroup)
void Player::SendInitialPacketsBeforeAddToMap()
{
/// Pass 'this' as argument because we're not stored in ObjectAccessor yet
GetSocial()->SendSocialList(this);
GetSocial()->SendSocialList(this, SOCIAL_FLAG_ALL);
// guild bank list wtf?
@@ -27884,3 +27883,9 @@ uint32 Player::DoRandomRoll(uint32 minimum, uint32 maximum)
return roll;
}
void Player::RemoveSocial()
{
sSocialMgr->RemovePlayerSocial(GetGUID());
m_social = nullptr;
}