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