facebook优化

This commit is contained in:
hahwu 2025-01-21 18:59:53 +08:00
parent 58cadc4795
commit e57b7d0055
2 changed files with 11 additions and 4 deletions

View File

@ -835,9 +835,9 @@ func Benchmark(player *Player) {
player.HandleInUserRank() player.HandleInUserRank()
} }
func GetUidByFaceBook(Fb string) int { func GetUidByFaceBook(Fb string) (int, error) {
sqlStr := "SELECT dwUin FROM t_player_baseinfo WHERE FaceBookId = ?" sqlStr := "SELECT dwUin FROM t_player_baseinfo WHERE FaceBookId = ?"
Uid := 0 Uid := 0
db.SqlDb.Get(&Uid, sqlStr, Fb) err := db.SqlDb.Get(&Uid, sqlStr, Fb)
return Uid return Uid, err
} }

View File

@ -2586,7 +2586,14 @@ func ReqAutoAddInviteFriend2(args []interface{}) error {
req := &msg.ReqAutoAddInviteFriend2{} req := &msg.ReqAutoAddInviteFriend2{}
proto.Unmarshal(buf, req) proto.Unmarshal(buf, req)
FriendMod := player.PlayMod.getFriendMod() FriendMod := player.PlayMod.getFriendMod()
Uid := GetUidByFaceBook(req.Id) Uid, err := GetUidByFaceBook(req.Id)
if err != nil {
player.SendErrClienRes(&msg.ResAutoAddInviteFriend2{
ResultCode: 0,
})
log.Debug("ReqAutoAddInviteFriend2 err :%v", err)
return err
}
FriendMod.AddFriend(Uid) FriendMod.AddFriend(Uid)
player.PlayMod.save() player.PlayMod.save()
player.PushClientRes(&msg.ResAutoAddInviteFriend2{ player.PushClientRes(&msg.ResAutoAddInviteFriend2{