不能申请自己为好友
This commit is contained in:
parent
da2ae614f3
commit
642703bc6a
@ -1489,6 +1489,13 @@ func ReqApplyFriend(player *Player, buf []byte) error {
|
|||||||
proto.Unmarshal(buf, req)
|
proto.Unmarshal(buf, req)
|
||||||
Uid := int(req.Uid)
|
Uid := int(req.Uid)
|
||||||
FriendMod := player.PlayMod.getFriendMod()
|
FriendMod := player.PlayMod.getFriendMod()
|
||||||
|
if Uid == int(player.M_DwUin) {
|
||||||
|
player.SendErrClienRes(&msg.ResApplyFriend{
|
||||||
|
Code: msg.RES_CODE_FAIL,
|
||||||
|
Msg: "cannot apply yourself",
|
||||||
|
})
|
||||||
|
return fmt.Errorf("cannot apply yourself")
|
||||||
|
}
|
||||||
if FriendMod.CheckFriend(Uid) {
|
if FriendMod.CheckFriend(Uid) {
|
||||||
player.SendErrClienRes(&msg.ResApplyFriend{
|
player.SendErrClienRes(&msg.ResApplyFriend{
|
||||||
Code: msg.RES_CODE_FAIL,
|
Code: msg.RES_CODE_FAIL,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user