From 885993f5499053c505080986129d193d73a8114d Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Wed, 8 Feb 2023 18:52:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A5=BD=E5=8F=8B=E5=88=87=E7=A3=8Bpvp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/friend/api_cross_accept.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/friend/api_cross_accept.go b/modules/friend/api_cross_accept.go index c7881b6b2..da1dc7855 100644 --- a/modules/friend/api_cross_accept.go +++ b/modules/friend/api_cross_accept.go @@ -23,7 +23,7 @@ func (this *apiComp) Accept(session comm.IUserSession, req *pb.FriendAcceptReq) } if imodule, err := this.moduleFriend.service.GetModule(comm.ModulePvp); err == nil { - if _, ok := imodule.(comm.IPvp); ok { + if ipvp, ok := imodule.(comm.IPvp); ok { //发起者 red red := this.moduleFriend.ModuleUser.GetUser(req.Uid) if red == nil { @@ -37,13 +37,13 @@ func (this *apiComp) Accept(session comm.IUserSession, req *pb.FriendAcceptReq) this.moduleFriend.Error("未找到蓝方信息", log.Field{Key: "uid", Value: session.GetUserId()}) return } - // if _, code = ipvp.CreatePvp( - // &pb.PvpUserInfo{Uid: red.Uid, Name: red.Name, Avatar: red.Avatar, Lv: red.Lv}, - // &pb.PvpUserInfo{Uid: blue.Uid, Name: blue.Name, Avatar: blue.Avatar, Lv: blue.Lv}, - // pb.PvpType_friends, - // ); code != pb.ErrorCode_Success { - // return - // } + if _, code = ipvp.CreatePvp( + &pb.PvpUserInfo{Uid: red.Uid, Name: red.Name, Avatar: red.Avatar, Lv: red.Lv}, + &pb.PvpUserInfo{Uid: blue.Uid, Name: blue.Name, Avatar: blue.Avatar, Lv: blue.Lv}, + pb.PvpType_friends, + ); code != pb.ErrorCode_Success { + return + } } }