diff --git a/modules/enchant/api_challengeover.go b/modules/enchant/api_challengeover.go index b6d78e61b..837591a67 100644 --- a/modules/enchant/api_challengeover.go +++ b/modules/enchant/api_challengeover.go @@ -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 diff --git a/modules/enchant/api_getlist.go b/modules/enchant/api_getlist.go index 907adfac8..beb5b5b6b 100644 --- a/modules/enchant/api_getlist.go +++ b/modules/enchant/api_getlist.go @@ -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}) diff --git a/modules/hunting/api_challengeover.go b/modules/hunting/api_challengeover.go index 1f198d74e..4b79fd0ad 100644 --- a/modules/hunting/api_challengeover.go +++ b/modules/hunting/api_challengeover.go @@ -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) } diff --git a/modules/hunting/api_getlist.go b/modules/hunting/api_getlist.go index 02b76d834..a8fde745f 100644 --- a/modules/hunting/api_getlist.go +++ b/modules/hunting/api_getlist.go @@ -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 } diff --git a/modules/viking/api_challengeover.go b/modules/viking/api_challengeover.go index 0df9e5add..4332925a5 100644 --- a/modules/viking/api_challengeover.go +++ b/modules/viking/api_challengeover.go @@ -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, diff --git a/modules/viking/api_getlist.go b/modules/viking/api_getlist.go index 3f617ff72..d4a52250f 100644 --- a/modules/viking/api_getlist.go +++ b/modules/viking/api_getlist.go @@ -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 }