This commit is contained in:
aozhiwei 2020-06-17 19:06:53 +08:00
parent 874ead46b4
commit 48e1d01d6d
4 changed files with 33 additions and 0 deletions

View File

@ -256,6 +256,24 @@ void Player::_CMFriendApplyList(f8::MsgHdr& hdr, const cs::CMFriendApplyList& ms
void Player::_CMFriendAgree(f8::MsgHdr& hdr, const cs::CMFriendAgree& msg)
{
cs::SMFriendAgree respmsg;
if (GetFriendById(msg.apply().account_id())) {
respmsg.set_errcode(0);
respmsg.set_errmsg("");
SendMsg(respmsg);
return;
}
if (msg.apply().account_id() == AccountId()) {
respmsg.set_errcode(2);
respmsg.set_errmsg("不能添加自己");
SendMsg(respmsg);
return;
}
SendMsg(respmsg);
}
void Player::_CMFriendRefuse(f8::MsgHdr& hdr, const cs::CMFriendRefuse& msg)
{
cs::SMFriendRefuse respmsg;
SendMsg(respmsg);
}

View File

@ -72,6 +72,7 @@ class Player
void _CMFriendApply(f8::MsgHdr& hdr, const cs::CMFriendApply& msg);
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);

View File

@ -17,6 +17,7 @@ enum CMMessageId_e
_CMFriendBlackList = 111;
_CMFriendAddBlack = 112;
_CMFriendDeleteBlack = 113;
_CMFriendRefuse = 114;
_CMSendChatMsg = 151;
_CMSendCustomMsg = 152;
@ -49,6 +50,7 @@ enum SMMessageId_e
_SMFriendBlackList = 111;
_SMFriendAddBlack = 112;
_SMFriendDeleteBlack = 113;
_SMFriendRefuse = 114;
_SMGroupCreate = 201;
_SMGroupJoin = 202;

View File

@ -157,6 +157,18 @@ message SMFriendIgnore
optional string errmsg = 2; //
}
//
message CMFriendRefuse
{
optional MFFriendApply apply = 1; //
}
//
message SMFriendRefuse
{
optional int32 errcode = 1; //
optional string errmsg = 2; //
}
//
message CMFriendDelete
{