Commit fd785f9a6b6c7a20d70a5bb0b0e6b5a9ae990ca9

Authored by 陆恒
1 parent d68feb38

提交

src/HttpServer/logic/constdef.go
... ... @@ -48,4 +48,5 @@ const (
48 48  
49 49 const (
50 50 WATCH_ADD_DAY_LIMIT = 9 //当天观看视频次数限制
  51 + FREE_REDBAG_NUM = 3 //玩家免费红包次数
51 52 )
... ...
src/HttpServer/logic/datadef.go
... ... @@ -27,11 +27,12 @@ type GetuserdataReq struct {
27 27 }
28 28  
29 29 type GetuserdataData struct {
30   - Walletgold int `json:"walletgold"`
31   - Leftads int `json:"leftads"`
32   - Guangold int `json:"guangold"`
33   - Userlv int `json:"userlv"`
34   - Userexp int `json:"userexp"`
  30 + Walletgold int `json:"walletgold"`
  31 + Leftads int `json:"leftads"`
  32 + Guangold int `json:"guangold"`
  33 + Userlv int `json:"userlv"`
  34 + Userexp int `json:"userexp"`
  35 + Leftfreeredbag int `json:"leftfreeredbag"`
35 36 }
36 37  
37 38 type GetuserdataResp struct {
... ... @@ -280,6 +281,7 @@ type UserData struct {
280 281 SignRound int //签到轮数
281 282 SignSum int //累计签到天数
282 283 IsSignToday int //今日是否已经签到 1是 0否
  284 + LeftFreeRB int //剩余免费红包次数
283 285 WithDraw WithDrawInfo //提现记录信息
284 286 Task TaskInfo //玩家任务完成相关信息
285 287 Achieve AchieveMentInfo //玩家成就完成相关数据
... ...
src/HttpServer/logic/function.go
... ... @@ -440,6 +440,7 @@ func InitUserInfo(data *UserLoginReq, resp *UserLoginResp, uuid int) error {
440 440 initdata.LastLoginTime = int(time.Now().Unix())
441 441 initdata.RealGold = 0
442 442 initdata.WatchAddsTime = WATCH_ADD_DAY_LIMIT
  443 + initdata.LeftFreeRB = FREE_REDBAG_NUM
443 444  
444 445 for _, val := range jsonconf.GetJsonConf().WithDrawConfig {
445 446 var tmp WithDrawDesc
... ...
src/HttpServer/logic/logic.go
... ... @@ -512,6 +512,9 @@ func HandlerUpdatetaskandachieve(w http.ResponseWriter, data string, uuid int) {
512 512 uinfo.Task.PassLevel += rdata.Value
513 513 case TASKTYPE_GETREDBAG:
514 514 uinfo.Task.GetRedbagCnt += rdata.Value
  515 + if uinfo.LeftFreeRB > 0 {
  516 + uinfo.LeftFreeRB--
  517 + }
515 518 case TASKTYPE_WATCHADS:
516 519 uinfo.Achieve.WatchAdsCnt += rdata.Value
517 520 case TASKTYPE_KILLSTAR:
... ... @@ -779,6 +782,7 @@ func HandlerGetuserdata(w http.ResponseWriter, data string, uuid int) {
779 782 resp.Data.Leftads = data.WatchAddsTime
780 783 resp.Data.Userexp = data.Exp
781 784 resp.Data.Userlv = data.Lv
  785 + resp.Data.Leftfreeredbag = data.LeftFreeRB
782 786 SaveUserInfo(data)
783 787  
784 788 resp.Code = ERROR_OK
... ...