Commit 92abaeca1a4892c8f82369011c5255c4b476ac7c
1 parent
ad05276e
Exists in
master
提交
Showing
1 changed file
with
10 additions
and
10 deletions
Show diff stats
src/HttpServer/logic/logic.go
| @@ -475,7 +475,16 @@ func HandlerDoBuyCat(w http.ResponseWriter, data string, uuid int) { | @@ -475,7 +475,16 @@ func HandlerDoBuyCat(w http.ResponseWriter, data string, uuid int) { | ||
| 475 | break | 475 | break |
| 476 | } | 476 | } |
| 477 | 477 | ||
| 478 | - maxlv := uinfo.Highestlv - 5 | 478 | + //获取配置 |
| 479 | + catcfg := jsonconf.GetCatConfig(rdata.CatId) | ||
| 480 | + if catcfg == nil { | ||
| 481 | + logger.Error("HandlerDoBuyCat get cat cfg failed=%v,lv=%v", err, rdata.CatId) | ||
| 482 | + resp.Code = 1 | ||
| 483 | + resp.Message = "get cat cfg failed" | ||
| 484 | + break | ||
| 485 | + } | ||
| 486 | + | ||
| 487 | + maxlv := catcfg.Level_buy | ||
| 479 | if maxlv < 1 { | 488 | if maxlv < 1 { |
| 480 | //最小1j | 489 | //最小1j |
| 481 | maxlv = 1 | 490 | maxlv = 1 |
| @@ -495,15 +504,6 @@ func HandlerDoBuyCat(w http.ResponseWriter, data string, uuid int) { | @@ -495,15 +504,6 @@ func HandlerDoBuyCat(w http.ResponseWriter, data string, uuid int) { | ||
| 495 | break | 504 | break |
| 496 | } | 505 | } |
| 497 | 506 | ||
| 498 | - //获取配置 | ||
| 499 | - catcfg := jsonconf.GetCatConfig(rdata.CatId) | ||
| 500 | - if catcfg == nil { | ||
| 501 | - logger.Error("HandlerDoBuyCat get cat cfg failed=%v,lv=%v", err, rdata.CatId) | ||
| 502 | - resp.Code = 1 | ||
| 503 | - resp.Message = "get cat cfg failed" | ||
| 504 | - break | ||
| 505 | - } | ||
| 506 | - | ||
| 507 | //需要找到一个位置 | 507 | //需要找到一个位置 |
| 508 | catpos := getCatPutPos(uinfo, rdata.CatId) | 508 | catpos := getCatPutPos(uinfo, rdata.CatId) |
| 509 | if catpos < 0 { | 509 | if catpos < 0 { |