好友bug优化
This commit is contained in:
parent
bf38f7d5c6
commit
2d51971ff1
@ -59,6 +59,9 @@ func handle(p *Player, m *msg.Msg) error {
|
||||
p.NoonUpdate(nil)
|
||||
case msg.HANDLE_TYPE_INVITE_ADD_FRIEND: // 邀请添加好友
|
||||
FriendMod := p.PlayMod.getFriendMod()
|
||||
if m.From == 0 && m.From == int(p.M_DwUin) {
|
||||
return nil
|
||||
}
|
||||
FriendMod.AddFriend(m.From)
|
||||
p.TeLog("friend_add", map[string]interface{}{
|
||||
"player_id": m.From,
|
||||
@ -318,6 +321,9 @@ func FriendListBackData(p *Player) {
|
||||
FriendMod := p.PlayMod.getFriendMod()
|
||||
var fl []*proto.ResPlayerSimple
|
||||
for k := range FriendMod.FriendList {
|
||||
if k == int(p.M_DwUin) {
|
||||
continue
|
||||
}
|
||||
ps := G_GameLogicPtr.GetResSimplePlayerByUid(k)
|
||||
if ps != nil {
|
||||
fl = append(fl, ps)
|
||||
|
||||
@ -2604,7 +2604,7 @@ func ReqAutoAddInviteFriend(args []interface{}) error {
|
||||
proto.Unmarshal(buf, req)
|
||||
FriendMod := player.PlayMod.getFriendMod()
|
||||
Uid := int(req.Id)
|
||||
if Uid == 0 {
|
||||
if Uid == 0 && Uid == int(player.M_DwUin) {
|
||||
player.PushClientRes(&msg.ResAutoAddInviteFriend{
|
||||
ResultCode: int32(msg.RES_CODE_FAIL),
|
||||
})
|
||||
@ -2633,6 +2633,13 @@ func ReqAutoAddInviteFriend2(args []interface{}) error {
|
||||
proto.Unmarshal(buf, req)
|
||||
FriendMod := player.PlayMod.getFriendMod()
|
||||
Uid, err := GetUidByFaceBook(req.Id)
|
||||
if Uid == 0 || Uid == int(player.M_DwUin) {
|
||||
player.PushClientRes(&msg.ResAutoAddInviteFriend2{
|
||||
ResultCode: 0,
|
||||
})
|
||||
log.Debug("ReqAutoAddInviteFriend2 err :%v", err)
|
||||
return err
|
||||
}
|
||||
if err != nil {
|
||||
player.SendErrClienRes(&msg.ResAutoAddInviteFriend2{
|
||||
ResultCode: 0,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user