This commit is contained in:
aozhiwei 2020-06-18 16:51:17 +08:00
parent c3c41e70a8
commit 8ad368404a
5 changed files with 7 additions and 32 deletions

View File

@ -60,7 +60,6 @@ void HandlerMgr::RegisterNetMsgHandlers()
RegisterNetMsgHandler(&wsmsghandler, &Player::_CMFriendApply);
RegisterNetMsgHandler(&wsmsghandler, &Player::_CMFriendApplyList);
RegisterNetMsgHandler(&wsmsghandler, &Player::_CMFriendAgree);
RegisterNetMsgHandler(&wsmsghandler, &Player::_CMFriendIgnore);
RegisterNetMsgHandler(&wsmsghandler, &Player::_CMFriendRefuse);
RegisterNetMsgHandler(&wsmsghandler, &Player::_CMFriendDelete);
RegisterNetMsgHandler(&wsmsghandler, &Player::_CMFriendBlackList);

View File

@ -223,6 +223,12 @@ void Player::_CMFriendAgree(f8::MsgHdr& hdr, const cs::CMFriendAgree& msg)
respmsg.set_errcode(0);
respmsg.set_errmsg("");
SendMsg(respmsg);
DBHelper::Instance()->SetFriendApplyStatus(
myself.crc32_code,
msg.apply().target_id(),
AccountId(),
1
);
return;
}
if (msg.apply().base_data().account_id() == AccountId()) {
@ -236,7 +242,7 @@ void Player::_CMFriendAgree(f8::MsgHdr& hdr, const cs::CMFriendAgree& msg)
if (AddFriend(friendobj) == 0) {
NotifyUserInfoUpdate(friendobj);
} else {
delete friendobj;
A8_SAFE_DELETE(friendobj);
}
SendMsg(respmsg);
MarkDirty();
@ -273,21 +279,6 @@ void Player::_CMFriendRefuse(f8::MsgHdr& hdr, const cs::CMFriendRefuse& msg)
);
}
void Player::_CMFriendIgnore(f8::MsgHdr& hdr, const cs::CMFriendIgnore& msg)
{
cs::SMFriendIgnore respmsg;
SendMsg(respmsg);
DBHelper::Instance()->SetFriendApplyStatus
(
myself.crc32_code,
msg.apply().idx(),
msg.apply().target_id(),
AccountId(),
3
);
}
void Player::_CMFriendDelete(f8::MsgHdr& hdr, const cs::CMFriendDelete& msg)
{
cs::SMFriendDelete respmsg;

View File

@ -73,7 +73,6 @@ class Player
void _CMFriendApplyList(f8::MsgHdr& hdr, const cs::CMFriendApplyList& msg);
void _CMFriendAgree(f8::MsgHdr& hdr, const cs::CMFriendAgree& msg);
void _CMFriendRefuse(f8::MsgHdr& hdr, const cs::CMFriendRefuse& msg);
void _CMFriendIgnore(f8::MsgHdr& hdr, const cs::CMFriendIgnore& msg);
void _CMFriendDelete(f8::MsgHdr& hdr, const cs::CMFriendDelete& msg);
void _CMFriendBlackList(f8::MsgHdr& hdr, const cs::CMFriendBlackList& msg);
void _CMFriendAddBlack(f8::MsgHdr& hdr, const cs::CMFriendAddBlack& msg);

View File

@ -10,7 +10,6 @@ enum CMMessageId_e
_CMFriendList = 104;
_CMFriendInvite = 105;
_CMFriendAgree = 106;
_CMFriendIgnore = 107;
_CMFriendDelete = 108;
_CMFriendApply = 109;
_CMFriendApplyList = 110;
@ -43,7 +42,6 @@ enum SMMessageId_e
_SMFriendList = 104;
_SMFriendInvite = 105;
_SMFriendAgree = 106;
_SMFriendIgnore = 107;
_SMFriendDelete = 108;
_SMFriendApply = 109;
_SMFriendApplyList = 110;

View File

@ -146,18 +146,6 @@ message SMFriendAgree
optional string errmsg = 2; //
}
//
message CMFriendIgnore
{
optional MFFriendApply apply = 1; //
}
//
message SMFriendIgnore
{
optional int32 errcode = 1; //
optional string errmsg = 2; //
}
//
message CMFriendRefuse
{