积分boss 玩家信息带入

This commit is contained in:
meixiongfeng 2024-01-30 11:58:54 +08:00
parent d2ade131a5
commit 088117d780
2 changed files with 17 additions and 0 deletions

View File

@ -153,6 +153,17 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.IntegralCh
Buff: req.Report.Info.Buffer,
}
update["carrybuff"] = list.Carrybuff
var user *pb.DBUser
if user, err = this.module.GetUserForSession(session); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Message: err.Error(),
}
return
}
list.Uinfo = comm.GetUserBaseInfo(user)
update["uinfo"] = list.Uinfo
// 更新base
if err = this.module.modelIntegral.modifyIntegralData(session.GetUserId(), update); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,

View File

@ -56,6 +56,11 @@ func (this *modelIntegral) getIntegralList(session comm.IUserSession) (result *p
Carrybuff: map[int32]*pb.FreightBuff{},
}
if err = this.Get(uid, result); mgo.MongodbNil == err {
var user *pb.DBUser
user, err = this.module.GetUserForSession(session)
if err != nil {
return
}
result.Id = primitive.NewObjectID().Hex()
result.Uid = uid
result.Buff = make(map[int32]int32)
@ -63,6 +68,7 @@ func (this *modelIntegral) getIntegralList(session comm.IUserSession) (result *p
result.Line = make(map[int32]*pb.LineData, 0)
result.Achieve = make(map[int32]int32) // 初始化成就
result.Carrybuff = make(map[int32]*pb.FreightBuff) // 初始化成就
result.Uinfo = comm.GetUserBaseInfo(user)
// 获取当前的hid
curTime := configure.Now().Unix()
szConf := this.module.configure.GetIntegralITime()