Commit 65ef179ba0ee4133d9d834db190086364a4c8993
1 parent
aed6964c
Exists in
master
提交
Showing
2 changed files
with
10 additions
and
2 deletions
Show diff stats
src/HttpServer/logic/function.go
@@ -411,6 +411,7 @@ func (u *UserData) DoFlopCardd(resp *DoFlopResp) { | @@ -411,6 +411,7 @@ func (u *UserData) DoFlopCardd(resp *DoFlopResp) { | ||
411 | u.SetDuboCatPos(catid) | 411 | u.SetDuboCatPos(catid) |
412 | } | 412 | } |
413 | u.Gold += addgold | 413 | u.Gold += addgold |
414 | + u.GoldSum += addgold | ||
414 | u.CalcGoldRate() | 415 | u.CalcGoldRate() |
415 | 416 | ||
416 | u.FlopCardLefCnt-- | 417 | u.FlopCardLefCnt-- |
@@ -1000,8 +1001,8 @@ func (u *UserData) CalcHigestCatName() string { | @@ -1000,8 +1001,8 @@ func (u *UserData) CalcHigestCatName() string { | ||
1000 | } | 1001 | } |
1001 | 1002 | ||
1002 | //计算猫名字 | 1003 | //计算猫名字 |
1003 | - if higestlv > 100 { | ||
1004 | - cfg := jsonconf.GetRedCatConfig(higestlv - 100) | 1004 | + if higestlv > REDCATIDEXTRA { |
1005 | + cfg := jsonconf.GetRedCatConfig(higestlv) | ||
1005 | if cfg == nil { | 1006 | if cfg == nil { |
1006 | logger.Error("CalcHigestCatName failed getcfg higestlv=%v", higestlv) | 1007 | logger.Error("CalcHigestCatName failed getcfg higestlv=%v", higestlv) |
1007 | return "" | 1008 | return "" |
src/HttpServer/logic/logic.go
@@ -292,6 +292,7 @@ func HandlerChangeCoin(w http.ResponseWriter, data string, uuid int) { | @@ -292,6 +292,7 @@ func HandlerChangeCoin(w http.ResponseWriter, data string, uuid int) { | ||
292 | addgold := rdata.Coin | 292 | addgold := rdata.Coin |
293 | if rdata.Type == 0 { | 293 | if rdata.Type == 0 { |
294 | uinfo.Gold += addgold | 294 | uinfo.Gold += addgold |
295 | + uinfo.GoldSum += addgold | ||
295 | } else { | 296 | } else { |
296 | uinfo.Gold -= addgold | 297 | uinfo.Gold -= addgold |
297 | } | 298 | } |
@@ -602,6 +603,7 @@ func HandlerGetflyboxreward(w http.ResponseWriter, data string, uuid int) { | @@ -602,6 +603,7 @@ func HandlerGetflyboxreward(w http.ResponseWriter, data string, uuid int) { | ||
602 | resp.Data.Getgold = int64(float32(uinfo.Goldrate) * cfg.Time) | 603 | resp.Data.Getgold = int64(float32(uinfo.Goldrate) * cfg.Time) |
603 | 604 | ||
604 | uinfo.Gold += resp.Data.Getgold | 605 | uinfo.Gold += resp.Data.Getgold |
606 | + uinfo.GoldSum += resp.Data.Getgold | ||
605 | } else if cfg.Ttype == 2 { | 607 | } else if cfg.Ttype == 2 { |
606 | //红包 | 608 | //红包 |
607 | resp.Data.Getredbag = cfg.Time | 609 | resp.Data.Getredbag = cfg.Time |
@@ -910,6 +912,7 @@ func HandlerGetboxreward(w http.ResponseWriter, data string, uuid int) { | @@ -910,6 +912,7 @@ func HandlerGetboxreward(w http.ResponseWriter, data string, uuid int) { | ||
910 | resp.Data.Getgold = int64(float32(uinfo.Goldrate) * cfg.Time) | 912 | resp.Data.Getgold = int64(float32(uinfo.Goldrate) * cfg.Time) |
911 | resp.Data.Getgold = resp.Data.Getgold * mult | 913 | resp.Data.Getgold = resp.Data.Getgold * mult |
912 | uinfo.Gold += resp.Data.Getgold | 914 | uinfo.Gold += resp.Data.Getgold |
915 | + uinfo.GoldSum += resp.Data.Getgold | ||
913 | } else if cfg.Ttype == 2 { | 916 | } else if cfg.Ttype == 2 { |
914 | //红包 | 917 | //红包 |
915 | resp.Data.Getredbag = cfg.Time * float32(mult) | 918 | resp.Data.Getredbag = cfg.Time * float32(mult) |
@@ -1572,6 +1575,7 @@ func HandlerDrawTable(w http.ResponseWriter, data string, uuid int) { | @@ -1572,6 +1575,7 @@ func HandlerDrawTable(w http.ResponseWriter, data string, uuid int) { | ||
1572 | } | 1575 | } |
1573 | 1576 | ||
1574 | uinfo.Gold += addgold | 1577 | uinfo.Gold += addgold |
1578 | + uinfo.GoldSum += addgold | ||
1575 | 1579 | ||
1576 | SaveUserInfo(uinfo, strconv.Itoa(uuid)) | 1580 | SaveUserInfo(uinfo, strconv.Itoa(uuid)) |
1577 | resp.Data.Coin = strconv.FormatInt(addgold, 10) | 1581 | resp.Data.Coin = strconv.FormatInt(addgold, 10) |
@@ -2001,6 +2005,7 @@ func HandlerRecovery(w http.ResponseWriter, data string, uuid int) { | @@ -2001,6 +2005,7 @@ func HandlerRecovery(w http.ResponseWriter, data string, uuid int) { | ||
2001 | //加金币 | 2005 | //加金币 |
2002 | price, _ := strconv.ParseInt(cfg.Price, 10, 64) | 2006 | price, _ := strconv.ParseInt(cfg.Price, 10, 64) |
2003 | uinfo.Gold += price / 10 | 2007 | uinfo.Gold += price / 10 |
2008 | + uinfo.GoldSum += price / 10 | ||
2004 | 2009 | ||
2005 | SaveUserInfo(uinfo, strconv.Itoa(uuid)) | 2010 | SaveUserInfo(uinfo, strconv.Itoa(uuid)) |
2006 | 2011 | ||
@@ -2102,6 +2107,7 @@ func HandlerRecvTimingReward(w http.ResponseWriter, data string, uuid int) { | @@ -2102,6 +2107,7 @@ func HandlerRecvTimingReward(w http.ResponseWriter, data string, uuid int) { | ||
2102 | addgold = addgold * 2 | 2107 | addgold = addgold * 2 |
2103 | } | 2108 | } |
2104 | uinfo.Gold += addgold | 2109 | uinfo.Gold += addgold |
2110 | + uinfo.GoldSum += addgold | ||
2105 | uinfo.LastTimingRewardHour = nowmin / 30 | 2111 | uinfo.LastTimingRewardHour = nowmin / 30 |
2106 | uinfo.LeftTimingRewardTimes-- | 2112 | uinfo.LeftTimingRewardTimes-- |
2107 | //uinfo.GetWatchAdsGoldTime-- | 2113 | //uinfo.GetWatchAdsGoldTime-- |
@@ -2145,6 +2151,7 @@ func HandlerWatchAdsGetGold(w http.ResponseWriter, data string, uuid int) { | @@ -2145,6 +2151,7 @@ func HandlerWatchAdsGetGold(w http.ResponseWriter, data string, uuid int) { | ||
2145 | uinfo.GetWatchAdsGoldTime-- | 2151 | uinfo.GetWatchAdsGoldTime-- |
2146 | addgold := uinfo.Goldrate * WATCHADSGOLDLRATE | 2152 | addgold := uinfo.Goldrate * WATCHADSGOLDLRATE |
2147 | uinfo.Gold += addgold | 2153 | uinfo.Gold += addgold |
2154 | + uinfo.GoldSum += addgold | ||
2148 | 2155 | ||
2149 | resp.Data.Reward = strconv.FormatInt(addgold, 10) | 2156 | resp.Data.Reward = strconv.FormatInt(addgold, 10) |
2150 | resp.Data.LeftTimes = uinfo.GetWatchAdsGoldTime | 2157 | resp.Data.LeftTimes = uinfo.GetWatchAdsGoldTime |