恢复时间返回

This commit is contained in:
meixiongfeng 2023-01-09 19:59:03 +08:00
parent f8e1f5fa84
commit ebb47ea8d9
6 changed files with 33 additions and 11 deletions

View File

@ -77,6 +77,11 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.EnchantCha
mapData["bossTime"] = enchant.BossTime
mapData["boss"] = enchant.Boss
code = this.module.ModifyEnchantData(session.GetUserId(), mapData)
if session.GetUserId() != "" { // 恢复时间
if userexpand, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil {
enchant.RecoveryTime = userexpand.Recovertimeunifiedticket
}
}
session.SendMsg(string(this.module.GetType()), EnchantChallengeOverResp, &pb.EnchantChallengeOverResp{Data: enchant})
return

View File

@ -42,9 +42,11 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.EnchantGetListRe
this.module.modelEnchant.Add(session.GetUserId(), list)
} else if err != nil {
code = pb.ErrorCode_DBError
return
}
if session.GetUserId() != "" { // 恢复时间
if userexpand, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil {
list.RecoveryTime = userexpand.Recovertimeunifiedticket
}
}
session.SendMsg(string(this.module.GetType()), EnchantGetListResp, &pb.EnchantGetListResp{Data: list})

View File

@ -101,6 +101,11 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha
mapData["bossTime"] = hunting.BossTime
code = this.module.ModifyHuntingData(session.GetUserId(), mapData)
if session.GetUserId() != "" { // 恢复时间
if userexpand, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil {
hunting.RecoveryTime = userexpand.Recovertimeunifiedticket
}
}
session.SendMsg(string(this.module.GetType()), HuntingChallengeOverResp, &pb.HuntingChallengeOverResp{Data: hunting})
// 随机任务统计
@ -108,7 +113,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha
this.module.ModuleRtask.SendToRtask(session, comm.Rtype82, req.BossType)
// 狩猎副本掉落觉醒材料
for _, v := range reward {
if _conf, err := this.configure.GetItemConfigureData(v.T); err == nil {
if _conf, err := this.module.configure.GetItemConfigureData(v.T); err == nil {
if _conf.Usetype == 8 {
this.module.ModuleRtask.SendToRtask(session, comm.Rtype154, v.N)
}
@ -116,7 +121,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha
}
if newChallenge && bWin {
for _, v := range cfgHunting.Firstprize {
if _conf, err := this.configure.GetItemConfigureData(v.T); err == nil {
if _conf, err := this.module.configure.GetItemConfigureData(v.T); err == nil {
if _conf.Usetype == 8 {
this.module.ModuleRtask.SendToRtask(session, comm.Rtype154, v.N)
}

View File

@ -43,12 +43,12 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.HuntingGetListRe
this.module.modelHunting.Add(session.GetUserId(), list)
} else if err != nil {
code = pb.ErrorCode_DBError
return
}
if session.GetUserId() != "" { // 恢复时间
if userexpand, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil {
list.RecoveryTime = userexpand.Recovertimeunifiedticket
}
}
session.SendMsg(string(this.module.GetType()), HuntingGetListResp, &pb.HuntingGetListResp{Data: list})
return
}

View File

@ -129,6 +129,12 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.VikingChal
// }
// }
code = this.module.ModifyVikingData(session.GetUserId(), mapData)
if session.GetUserId() != "" { // 恢复时间
if userexpand, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil {
viking.RecoveryTime = userexpand.Recovertimeunifiedticket
}
}
session.SendMsg(string(this.module.GetType()), VikingChallengeOverResp, &pb.VikingChallengeOverResp{
Data: viking,
Asset: atno,

View File

@ -42,7 +42,11 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.VikingGetListReq
this.module.modelViking.Add(session.GetUserId(), list)
}
if session.GetUserId() != "" { // 恢复时间
if userexpand, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil {
list.RecoveryTime = userexpand.Recovertimeunifiedticket
}
}
session.SendMsg(string(this.module.GetType()), VikingGetListResp, &pb.VikingGetListResp{Data: list})
return
}