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