diff --git a/modules/hunting/api_challengeover.go b/modules/hunting/api_challengeover.go index dfc12914f..d3e73af3b 100644 --- a/modules/hunting/api_challengeover.go +++ b/modules/hunting/api_challengeover.go @@ -90,7 +90,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha errdata = &pb.ErrorData{ Code: pb.ErrorCode_HuntingLvErr, Title: pb.ErrorCode_HuntingLvErr.ToString(), - Message: fmt.Sprintf("关卡体力参数异常:%d,预扣体力:%d", session.GetUserId(), v), + Message: fmt.Sprintf("关卡体力参数异常:%s,预扣体力:%d", session.GetUserId(), v), } return } diff --git a/modules/mline/api_challengeover.go b/modules/mline/api_challengeover.go index 4def28a5a..1bc74f08b 100644 --- a/modules/mline/api_challengeover.go +++ b/modules/mline/api_challengeover.go @@ -69,20 +69,21 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MlineChall errdata = &pb.ErrorData{ Code: pb.ErrorCode_HuntingLvErr, Title: pb.ErrorCode_HuntingLvErr.ToString(), - Message: fmt.Sprintf("关卡体力参数异常:%d,预扣体力:%d", session.GetUserId(), v), + Message: fmt.Sprintf("关卡体力参数异常,uid:%s,预扣体力:%d", session.GetUserId(), v), } return } curChapter.Ps[req.StageId] = 0 // 清空预扣体力值 update["ps"] = curChapter.Ps if !isWin { // 战斗失败返还扣除的体力 - if errdata = this.module.DispenseRes(session, stageConf.PsConsume, true); errdata != nil { // 返还预扣体力 return } - this.module.modelMline.modifyMlineData(session.GetUserId(), curChapter.Id, update) - //code = pb.ErrorCode_BattleNoWin + // errdata = &pb.ErrorData{ + // Code: pb.ErrorCode_BattleNoWin, // 战斗失败了 + // Title: pb.ErrorCode_BattleNoWin.ToString(), + // } rsp.Data = curChapter session.SendMsg(string(this.module.GetType()), MlineChallengeOverResp, rsp) // 数据推送 return diff --git a/modules/viking/api_challengeover.go b/modules/viking/api_challengeover.go index 0b0d7c518..c19db7124 100644 --- a/modules/viking/api_challengeover.go +++ b/modules/viking/api_challengeover.go @@ -1,6 +1,7 @@ package viking import ( + "fmt" "go_dreamfactory/comm" "go_dreamfactory/pb" cfg "go_dreamfactory/sys/configure/structs" @@ -87,17 +88,20 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.VikingChal mapData["boss"] = viking.Boss errdata, bWin = this.module.battle.CheckBattleReport(session, req.Report) - // if errdata = this.module.ModuleItems.RecoverTicket(session); errdata != nil { - // return - // } - if !bWin { // 战斗失败了 直接返回 - if v, ok := viking.Ps[req.BossId]; ok && v > 0 { - if errdata = this.module.DispenseRes(session, vikingCfg.PsConsume, true); errdata != nil { // 返还预扣体力 - return - } + if v, ok := viking.Ps[req.BossId]; ok && v > 0 { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_HuntingLvErr, + Title: pb.ErrorCode_HuntingLvErr.ToString(), + Message: fmt.Sprintf("关卡体力参数异常,uid:%s,预扣体力:%d", session.GetUserId(), v), + } + return + } + viking.Ps[req.BossId] = 0 // 清空预扣体力值 + mapData["ps"] = viking.Ps + if !bWin { // 战斗失败了 直接返回 + if errdata = this.module.DispenseRes(session, vikingCfg.PsConsume, true); errdata != nil { // 返还预扣体力 + return } - viking.Ps[req.BossId] = 0 // 清空预扣体力值 - mapData["ps"] = viking.Ps errdata = this.module.ModifyVikingData(session.GetUserId(), mapData) session.SendMsg(string(this.module.GetType()), VikingChallengeOverResp, &pb.VikingChallengeOverResp{ Data: viking, @@ -105,9 +109,6 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.VikingChal return } - // if errdata = this.module.ConsumeRes(session, vikingCfg.PsConsume, true); errdata != nil { - // return - // } key := strconv.Itoa(int(req.BossId)) + "_" + strconv.Itoa(int(req.Difficulty)) if viking.BossTime[key] == 0 { // 新关卡挑战通过 发放首通奖励