This commit is contained in:
aozhiwei 2024-04-07 17:18:33 +08:00
parent 04de2961c3
commit d63f9fdca3

View File

@ -184,6 +184,15 @@ func (this *player) CMAddFriendRequest(hdr *f5.MsgHdr, msg *cs.CMAddFriendReques
}
func (this *player) CMAcceptFriendRequest(hdr *f5.MsgHdr, msg *cs.CMAcceptFriendRequest) {
rspMsg := new(cs.SMAcceptFriendRequest)
if this.GetAccountId() == msg.GetTargetAccountId() {
this.SendMsg(rspMsg.Err(2, "Cannot add oneself"))
return
}
if GetFriendMgr().IsFriend(this.GetAccountId(), msg.GetTargetAccountId()) {
this.SendMsg(rspMsg)
return
}
}
func (this *player) CMRejectFriendRequest(hdr *f5.MsgHdr, msg *cs.CMRejectFriendRequest) {