From 9a08ffad1602ec33ac80b01e2389979c174e30a0 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Fri, 26 Jan 2024 19:38:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=88=98=E6=96=97=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/integral/api_rank.go | 54 ++++++++++++++++---------------- modules/matchpool/module.go | 2 ++ modules/plunder/model_plunder.go | 44 +++++++++++++------------- 3 files changed, 50 insertions(+), 50 deletions(-) diff --git a/modules/integral/api_rank.go b/modules/integral/api_rank.go index 626f5f158..1336a1567 100644 --- a/modules/integral/api_rank.go +++ b/modules/integral/api_rank.go @@ -14,12 +14,12 @@ func (this *apiComp) RankListCheck(session comm.IUserSession, req *pb.IntegralRa // /排行榜获取 func (this *apiComp) RankList(session comm.IUserSession, req *pb.IntegralRankListReq) (errdata *pb.ErrorData) { var ( - uids []string - ranks []*pb.DBIntegralBoss - franks []*pb.DBIntegralBoss + uids []string + ranks []*pb.DBIntegralBoss + // franks []*pb.DBIntegralBoss players []*pb.DBIntegralRank - friends []*pb.DBIntegralRank - err error + // friends []*pb.DBIntegralRank + err error ) if errdata = this.RankListCheck(session, req); errdata != nil { @@ -53,29 +53,29 @@ func (this *apiComp) RankList(session comm.IUserSession, req *pb.IntegralRankLis Line: v.Line[req.Nandu], } } - // 获取好友 - fids := this.module.ModuleFriend.GetFriendList(session.GetUserId()) - if franks, err = this.module.modelIntegral.queryPlayers(fids); err != nil { - errdata = &pb.ErrorData{ - Code: pb.ErrorCode_DBError, - Title: pb.ErrorCode_DBError.ToString(), - Message: err.Error(), - } - return - } - friends = make([]*pb.DBIntegralRank, len(franks)) - for i, v := range franks { - friends[i] = &pb.DBIntegralRank{ - Id: v.Uid, - Uinfo: v.Uinfo, - Nandu: v.Nandu, - Score: v.Score[req.Nandu], - Line: v.Line[req.Nandu], - } - } + // // 获取好友 + // fids := this.module.ModuleFriend.GetFriendList(session.GetUserId()) + // if franks, err = this.module.modelIntegral.queryPlayers(fids); err != nil { + // errdata = &pb.ErrorData{ + // Code: pb.ErrorCode_DBError, + // Title: pb.ErrorCode_DBError.ToString(), + // Message: err.Error(), + // } + // return + // } + // friends = make([]*pb.DBIntegralRank, len(franks)) + // for i, v := range franks { + // friends[i] = &pb.DBIntegralRank{ + // Id: v.Uid, + // Uinfo: v.Uinfo, + // Nandu: v.Nandu, + // Score: v.Score[req.Nandu], + // Line: v.Line[req.Nandu], + // } + // } session.SendMsg(string(this.module.GetType()), "ranklist", &pb.IntegralRankListResp{ - Ranks: players, - Friends: friends, + Ranks: players, + // Friends: friends, }) return } diff --git a/modules/matchpool/module.go b/modules/matchpool/module.go index a6cf9b1ad..d0829960b 100644 --- a/modules/matchpool/module.go +++ b/modules/matchpool/module.go @@ -59,12 +59,14 @@ func (this *MatchPool) OnInstallComp() { //加入匹配池 func (this *MatchPool) JoinMatchPools(ctx context.Context, req *pb.JoinMatchPoolReq, resp *pb.JoinMatchPoolResp) (err error) { + this.Debug("JoinMatchPools", log.Field{Key: "req", Value: req.String()}) this.pools.joinPools(req) return } //取消匹配 func (this *MatchPool) CancelMatch(ctx context.Context, req *pb.CancelMatchReq, resp *pb.CancelMatchResp) (err error) { + this.Debug("CancelMatch", log.Field{Key: "req", Value: req.String()}) this.pools.cancelMatch(req) return } diff --git a/modules/plunder/model_plunder.go b/modules/plunder/model_plunder.go index 5e62b7802..8e4dc669a 100644 --- a/modules/plunder/model_plunder.go +++ b/modules/plunder/model_plunder.go @@ -66,30 +66,28 @@ func (this *modelPlunder) getPlunderData(session comm.IUserSession) (info *pb.DB this.module.Errorln(err) return } - if err == mgo.MongodbNil { - user, err = this.module.GetUserForSession(session) - if err != nil { - this.module.Errorln(err) - return - } - info = &pb.DBPlunder{ - Id: primitive.NewObjectID().Hex(), - Uid: session.GetUserId(), - Uinfo: comm.GetUserBaseInfo(user), - Ctime: configure.Now().Unix(), - Develop: make(map[int32]int32), - } - - for i := 0; i < 3; i++ { // 队列固定三条 - info.Line = append(info.Line, &pb.TransportLine{}) - } - info.Line = append(info.Line, &pb.TransportLine{ - Closetime: -1, // 需要手动解锁 - }) - // 刷新货物信息 - info.Source, _ = this.refreshGoodsInfo() - err = this.Add(session.GetUserId(), info) + user, err = this.module.GetUserForSession(session) + if err != nil { + this.module.Errorln(err) + return } + info = &pb.DBPlunder{ + Id: primitive.NewObjectID().Hex(), + Uid: session.GetUserId(), + Uinfo: comm.GetUserBaseInfo(user), + Ctime: configure.Now().Unix(), + Develop: make(map[int32]int32), + } + + for i := 0; i < 3; i++ { // 队列固定三条 + info.Line = append(info.Line, &pb.TransportLine{}) + } + info.Line = append(info.Line, &pb.TransportLine{ + Closetime: -1, // 需要手动解锁 + }) + // 刷新货物信息 + info.Source, _ = this.refreshGoodsInfo() + err = this.Add(session.GetUserId(), info) return }