1
This commit is contained in:
parent
5cf022f2f1
commit
c0a3b4f7ee
@ -11,6 +11,7 @@
|
||||
#include "MSConnMgr.h"
|
||||
#include "dbengine.h"
|
||||
#include "dbhelper.h"
|
||||
#include "synchelper.h"
|
||||
#include "app.h"
|
||||
#include "typeconvert.h"
|
||||
#include "playermgr.h"
|
||||
@ -241,20 +242,12 @@ void Player::_CMFriendAgree(f8::MsgHdr& hdr, const cs::CMFriendAgree& msg)
|
||||
TypeConvert::Convert(msg.apply().base_data(), friendobj->base_data);
|
||||
if (AddFriend(friendobj) == 0) {
|
||||
NotifyUserInfoUpdate(friendobj);
|
||||
SyncHelper::Instance()->SyncNewFriend(this, friendobj->base_data.account_id);
|
||||
MarkDirty();
|
||||
} else {
|
||||
A8_SAFE_DELETE(friendobj);
|
||||
}
|
||||
SendMsg(respmsg);
|
||||
MarkDirty();
|
||||
#if 1
|
||||
{
|
||||
Player* hum = PlayerMgr::Instance()->GetPlayerByAccountId(friendobj->base_data.account_id);
|
||||
if (hum) {
|
||||
hum->AddFriend(&myself);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
DBHelper::Instance()->SetFriendApplyStatus
|
||||
(
|
||||
myself.crc32_code,
|
||||
@ -284,16 +277,7 @@ void Player::_CMFriendDelete(f8::MsgHdr& hdr, const cs::CMFriendDelete& msg)
|
||||
cs::SMFriendDelete respmsg;
|
||||
Friend* p = GetFriendById(msg.friend_id());
|
||||
if (p) {
|
||||
friend_hash_.erase(msg.friend_id());
|
||||
MarkDirty();
|
||||
#if 1
|
||||
{
|
||||
Player* hum = PlayerMgr::Instance()->GetPlayerByAccountId(p->base_data.account_id);
|
||||
if (hum) {
|
||||
hum->RemoveFriend(AccountId());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
RemoveFriend(p->base_data.account_id);
|
||||
}
|
||||
respmsg.set_friend_id(msg.friend_id());
|
||||
SendMsg(respmsg);
|
||||
@ -717,9 +701,11 @@ void Player::RemoveFriend(const std::string& account_id)
|
||||
notifymsg.add_user_list(account_id);
|
||||
SendMsg(notifymsg);
|
||||
}
|
||||
SyncHelper::Instance()->SyncDeleteFriend(this, friendobj->base_data.account_id);
|
||||
PlayerMgr::Instance()->UnWatchPlayer(friendobj);
|
||||
friend_hash_.erase(account_id);
|
||||
delete friendobj;
|
||||
MarkDirty();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13,3 +13,13 @@ void SyncHelper::Init()
|
||||
void SyncHelper::UnInit()
|
||||
{
|
||||
}
|
||||
|
||||
void SyncHelper::SyncNewFriend(Player* hum, const std::string& target_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void SyncHelper::SyncDeleteFriend(Player* hum, const std::string& target_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -10,4 +10,7 @@ class SyncHelper : public a8::Singleton<SyncHelper>
|
||||
public:
|
||||
void Init();
|
||||
void UnInit();
|
||||
|
||||
void SyncNewFriend(Player* hum, const std::string& target_id);
|
||||
void SyncDeleteFriend(Player* hum, const std::string& target_id);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user