上传战斗匹配日志

This commit is contained in:
liwei1dao 2024-01-26 19:38:42 +08:00
parent ccfb093832
commit 9a08ffad16
3 changed files with 50 additions and 50 deletions

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}