Commit b7a3fc0d459f4c3ff4d3e18716542fe392c7b971
1 parent
f2f9cf06
Exists in
master
提交
Showing
2 changed files
with
19 additions
and
4 deletions
Show diff stats
src/HttpServer/logic/datadef.go
| @@ -258,10 +258,11 @@ type ExchangePosReq struct { | @@ -258,10 +258,11 @@ type ExchangePosReq struct { | ||
| 258 | } | 258 | } |
| 259 | 259 | ||
| 260 | type ExchangePosData struct { | 260 | type ExchangePosData struct { |
| 261 | - CatList []CatPosInfo `json:"catList"` | ||
| 262 | - Coin DoBuyCatCoin `json:"coin"` | ||
| 263 | - NewCat int `json:"newCat"` | ||
| 264 | - Reward float32 `json:"reward"` | 261 | + CatList []CatPosInfo `json:"catList"` |
| 262 | + Coin DoBuyCatCoin `json:"coin"` | ||
| 263 | + NewCat int `json:"newCat"` | ||
| 264 | + Reward float32 `json:"reward"` | ||
| 265 | + CostTime int `json:"costTime"` | ||
| 265 | } | 266 | } |
| 266 | type ExchangePosResp struct { | 267 | type ExchangePosResp struct { |
| 267 | Code int `json:"code"` | 268 | Code int `json:"code"` |
| @@ -950,6 +951,8 @@ type UserData struct { | @@ -950,6 +951,8 @@ type UserData struct { | ||
| 950 | Goldrate int64 //金币生成速率 | 951 | Goldrate int64 //金币生成速率 |
| 951 | Loverate int64 //爱心生产速率 | 952 | Loverate int64 //爱心生产速率 |
| 952 | Highestlv int //当前最高猫等级 | 953 | Highestlv int //当前最高猫等级 |
| 954 | + CurentLevelSec int //升级到当前猫等级的时间点 | ||
| 955 | + CurentLevelCostTime int //升级到当前猫等级所花的时间 | ||
| 953 | InviteId int //邀请者uid | 956 | InviteId int //邀请者uid |
| 954 | CurBoxLv int //当前猫箱子等级 | 957 | CurBoxLv int //当前猫箱子等级 |
| 955 | IsDouble int //当前加速标签 1表示3倍收益 0表示正常 | 958 | IsDouble int //当前加速标签 1表示3倍收益 0表示正常 |
src/HttpServer/logic/logic.go
| @@ -2422,6 +2422,12 @@ func HandlerExchangePos(w http.ResponseWriter, data string, uuid int) { | @@ -2422,6 +2422,12 @@ func HandlerExchangePos(w http.ResponseWriter, data string, uuid int) { | ||
| 2422 | //非红包猫 | 2422 | //非红包猫 |
| 2423 | uinfo.Highestlv = 37 | 2423 | uinfo.Highestlv = 37 |
| 2424 | uinfo.CheckBuyCatSHop() | 2424 | uinfo.CheckBuyCatSHop() |
| 2425 | + //记录升级到37级猫的时间点 | ||
| 2426 | + nowt := int(time.Now().Unix()) | ||
| 2427 | + uinfo.CurentLevelCostTime = (nowt - uinfo.CurentLevelSec) / 3600 | ||
| 2428 | + uinfo.CurentLevelSec = nowt | ||
| 2429 | + resp.Data.CostTime = uinfo.CurentLevelCostTime | ||
| 2430 | + | ||
| 2425 | } | 2431 | } |
| 2426 | if idx > 0 { | 2432 | if idx > 0 { |
| 2427 | //红包猫 | 2433 | //红包猫 |
| @@ -2443,6 +2449,12 @@ func HandlerExchangePos(w http.ResponseWriter, data string, uuid int) { | @@ -2443,6 +2449,12 @@ func HandlerExchangePos(w http.ResponseWriter, data string, uuid int) { | ||
| 2443 | 2449 | ||
| 2444 | //翻拍次数+ | 2450 | //翻拍次数+ |
| 2445 | uinfo.FlopCardLefCnt++ | 2451 | uinfo.FlopCardLefCnt++ |
| 2452 | + | ||
| 2453 | + nowt := int(time.Now().Unix()) | ||
| 2454 | + uinfo.CurentLevelCostTime = (nowt - uinfo.CurentLevelSec) / 3600 | ||
| 2455 | + uinfo.CurentLevelSec = nowt | ||
| 2456 | + | ||
| 2457 | + resp.Data.CostTime = uinfo.CurentLevelCostTime | ||
| 2446 | } | 2458 | } |
| 2447 | 2459 | ||
| 2448 | } | 2460 | } |