From d337745d6ffa03259756b66e717267fec1fd0094 Mon Sep 17 00:00:00 2001 From: 陆恒 Date: Tue, 23 Jun 2020 14:22:13 +0800 Subject: [PATCH] 提亀 --- src/HttpServer/logic/function.go | 1 + src/HttpServer/logic/logic.go | 13 +++++++++++++ 2 files changed, 14 insertions(+), 0 deletions(-) diff --git a/src/HttpServer/logic/function.go b/src/HttpServer/logic/function.go index eca21a7..16bcf29 100644 --- a/src/HttpServer/logic/function.go +++ b/src/HttpServer/logic/function.go @@ -207,6 +207,7 @@ func (u *UserData) CalcRandRedBagNum() float32 { } else { addnum = float32(rand.Intn(10)) / 100 } + return addnum } diff --git a/src/HttpServer/logic/logic.go b/src/HttpServer/logic/logic.go index 2b161cd..b0c18e7 100644 --- a/src/HttpServer/logic/logic.go +++ b/src/HttpServer/logic/logic.go @@ -2315,6 +2315,19 @@ func HandlerQueryBuyCat(w http.ResponseWriter, data string, uuid int) { tmp.Coin = strconv.FormatInt(v.CurPrice, 10) resp.Data = append(resp.Data, tmp) } + _, highest := uinfo.CalcHigestCatName() + offset := highest - len(uinfo.BuyCatInfo) + if offset > 0 { + for i := 0; i < offset; i++ { + cfg := jsonconf.GetCatConfig(len(uinfo.BuyCatInfo) + i + 1) + if cfg != nil { + var tmp BuyCatDesc + tmp.CatId = len(uinfo.BuyCatInfo) + i + 1 + tmp.Coin = cfg.Price + resp.Data = append(resp.Data, tmp) + } + } + } resp.Code = 0 break -- libgit2 0.21.0