Commit cf58f34acd3656d2c8cdb34ab277b12d81631aaa
1 parent
07a9037d
Exists in
master
提交
Showing
1 changed file
with
9 additions
and
0 deletions
Show diff stats
src/HttpServer/logic/logic.go
@@ -643,9 +643,18 @@ func HandlerHitcataddgold(w http.ResponseWriter, data string, uuid int) { | @@ -643,9 +643,18 @@ func HandlerHitcataddgold(w http.ResponseWriter, data string, uuid int) { | ||
643 | break | 643 | break |
644 | } | 644 | } |
645 | 645 | ||
646 | + if uinfo.HitCatTime <= 0 { | ||
647 | + logger.Error("HandlerHitcataddgold time failed=%v", err) | ||
648 | + resp.Code = 1 | ||
649 | + resp.Message = "撸猫次数不足" | ||
650 | + break | ||
651 | + } | ||
652 | + | ||
646 | addgold := HITCATMULT * uinfo.Goldrate | 653 | addgold := HITCATMULT * uinfo.Goldrate |
647 | uinfo.Gold += addgold | 654 | uinfo.Gold += addgold |
648 | 655 | ||
656 | + uinfo.HitCatTime-- | ||
657 | + | ||
649 | resp.Data.Goldnum = addgold | 658 | resp.Data.Goldnum = addgold |
650 | resp.Data.Goldsumnum = uinfo.Gold | 659 | resp.Data.Goldsumnum = uinfo.Gold |
651 | resp.Code = 0 | 660 | resp.Code = 0 |