1
This commit is contained in:
parent
d53188ef18
commit
6753cd82fe
@ -43,6 +43,13 @@ const (
|
||||
CACHE_LOCK_KEY = "cache:"
|
||||
)
|
||||
|
||||
const (
|
||||
FRIEND_APPLY_STATUS_NONE = 0
|
||||
FRIEND_APPLY_STATUS_ACCEPT = 1
|
||||
FRIEND_APPLY_STATUS_REJECT = 2
|
||||
FRIEND_APPLY_STATUS_IGNORE = 3
|
||||
)
|
||||
|
||||
const (
|
||||
GUILD_APPLY_STATUS_NONE = 0
|
||||
GUILD_APPLY_STATUS_ACCEPT = 1
|
||||
|
@ -208,13 +208,13 @@ func (this *friendMgr) AsyncAddFriend(senderId string, targetId string, cb func(
|
||||
{"target_id", targetId},
|
||||
},
|
||||
[][]string{
|
||||
{"status", q5.ToString(0)},
|
||||
{"status", q5.ToString(constant.FRIEND_APPLY_STATUS_NONE)},
|
||||
{"last_apply_time", q5.ToString(nowTime)},
|
||||
},
|
||||
[][]string{
|
||||
{"sender_id", senderId},
|
||||
{"target_id", targetId},
|
||||
{"status", q5.ToString(0)},
|
||||
{"status", q5.ToString(constant.FRIEND_APPLY_STATUS_NONE)},
|
||||
{"last_apply_time", q5.ToString(nowTime)},
|
||||
{"createtime", q5.ToString(nowTime)},
|
||||
{"modifytime", q5.ToString(nowTime)},
|
||||
@ -224,7 +224,6 @@ func (this *friendMgr) AsyncAddFriend(senderId string, targetId string, cb func(
|
||||
cb(1, "")
|
||||
return
|
||||
}
|
||||
this.asyncSetApplyStatus(senderId, targetId, 1)
|
||||
cb(0, "")
|
||||
})
|
||||
}
|
||||
|
@ -169,6 +169,10 @@ func (this *player) CMAddFriendRequest(hdr *f5.MsgHdr, msg *cs.CMAddFriendReques
|
||||
this.SendMsg(rspMsg)
|
||||
return
|
||||
}
|
||||
if this.GetAccountId() == msg.GetTargetAccountId() {
|
||||
this.SendMsg(rspMsg.Err(2, "Cannot invite oneself"))
|
||||
return
|
||||
}
|
||||
GetFriendMgr().AsyncAddFriend(
|
||||
this.GetAccountId(),
|
||||
msg.GetTargetAccountId(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user