收到战报数据清空预扣体力值
This commit is contained in:
parent
81b2bf3b6c
commit
108b59823c
@ -47,7 +47,7 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.HuntingChallen
|
|||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if v1, ok := hunting.Ps[req.BossType]; ok && v1 == 0 {
|
if v1, ok := hunting.Ps[req.BossType]; ok && v1 != 0 {
|
||||||
|
|
||||||
if errdata = this.module.ConsumeRes(session, cfgData.PsMg, true); errdata != nil { // 扣1点
|
if errdata = this.module.ConsumeRes(session, cfgData.PsMg, true); errdata != nil { // 扣1点
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package hunting
|
package hunting
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
cfg "go_dreamfactory/sys/configure/structs"
|
cfg "go_dreamfactory/sys/configure/structs"
|
||||||
@ -75,14 +74,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha
|
|||||||
}
|
}
|
||||||
|
|
||||||
errdata, bWin = this.module.battle.CheckBattleReport(session, req.Report)
|
errdata, bWin = this.module.battle.CheckBattleReport(session, req.Report)
|
||||||
if v, ok := hunting.Ps[req.BossType]; !ok || v == 0 {
|
|
||||||
errdata = &pb.ErrorData{
|
|
||||||
Code: pb.ErrorCode_HuntingLvErr,
|
|
||||||
Title: pb.ErrorCode_HuntingLvErr.ToString(),
|
|
||||||
Message: fmt.Sprintf("关卡体力参数异常:%s,预扣体力:%d", session.GetUserId(), v),
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
hunting.Ps[req.BossType] = 0 // 清空预扣体力值
|
hunting.Ps[req.BossType] = 0 // 清空预扣体力值
|
||||||
mapData["ps"] = hunting.Ps
|
mapData["ps"] = hunting.Ps
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.VikingChalleng
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if v1, ok := viking.Ps[req.BossId]; ok && v1 == 0 {
|
if v1, ok := viking.Ps[req.BossId]; ok && v1 != 0 {
|
||||||
if errdata = this.module.ConsumeRes(session, cfgData.PsMg, true); errdata != nil { // 扣1点
|
if errdata = this.module.ConsumeRes(session, cfgData.PsMg, true); errdata != nil { // 扣1点
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package viking
|
package viking
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
cfg "go_dreamfactory/sys/configure/structs"
|
cfg "go_dreamfactory/sys/configure/structs"
|
||||||
@ -78,14 +77,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.VikingChal
|
|||||||
}
|
}
|
||||||
|
|
||||||
errdata, bWin = this.module.battle.CheckBattleReport(session, req.Report)
|
errdata, bWin = this.module.battle.CheckBattleReport(session, req.Report)
|
||||||
if v, ok := viking.Ps[req.BossId]; !ok || v == 0 {
|
|
||||||
errdata = &pb.ErrorData{
|
|
||||||
Code: pb.ErrorCode_VikingStagePsErr,
|
|
||||||
Title: pb.ErrorCode_VikingStagePsErr.ToString(),
|
|
||||||
Message: fmt.Sprintf("关卡体力参数异常,uid:%s,预扣体力:%d", session.GetUserId(), v),
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
viking.Ps[req.BossId] = 0 // 清空预扣体力值
|
viking.Ps[req.BossId] = 0 // 清空预扣体力值
|
||||||
mapData["ps"] = viking.Ps
|
mapData["ps"] = viking.Ps
|
||||||
if !bWin { // 战斗失败了 直接返回
|
if !bWin { // 战斗失败了 直接返回
|
||||||
|
Loading…
Reference in New Issue
Block a user