Commit c7b48d0ba72739aed3af75016b7c8883a982013c

Authored by 陆恒
1 parent be5fa0b9
Exists in master and in 1 other branch ver2.3.6

提交

src/HttpServer/logic/constdef.go
@@ -8,6 +8,9 @@ const ( @@ -8,6 +8,9 @@ const (
8 TASKTYPE_KILLSTAR = 4 //4表示消除x颗星星 8 TASKTYPE_KILLSTAR = 4 //4表示消除x颗星星
9 TASKTYPE_USEITEM = 5 //5表示使用x次道具 9 TASKTYPE_USEITEM = 5 //5表示使用x次道具
10 TASKTYPE_PLAYSMALLGAMES = 6 //6表示试玩15s小游戏 10 TASKTYPE_PLAYSMALLGAMES = 6 //6表示试玩15s小游戏
  11 + TASKTYPE_WATCHADSSURPRICE = 7 //领取惊喜红包
  12 + TASKTYPE_WATCHADSPAY = 8 //领取付费红包
  13 + TASKTYPE_WATCHADSTIME = 9 //领取时长红包
11 14
12 ) 15 )
13 16
@@ -53,7 +56,9 @@ const ( @@ -53,7 +56,9 @@ const (
53 ) 56 )
54 57
55 const ( 58 const (
56 - WATCH_ADD_DAY_LIMIT = 50 //当天获取红包次数限制 59 + WATCH_ADD_DAY_LIMIT = 25 //当天获取红包次数限制
  60 + PAY_ADD_DAY_LIMIT = 20 //当天付费红包次数限制
  61 + TIME_ADD_DAY_LIMIT = 5 //当天时长红包次数限制
57 FREE_REDBAG_NUM = 3 //玩家免费红包次数 62 FREE_REDBAG_NUM = 3 //玩家免费红包次数
58 READGOLDMULTI = 700 //阅读量到金币转化倍数 63 READGOLDMULTI = 700 //阅读量到金币转化倍数
59 SDKOPGOLD_TYPEWE = 302 //微转发金币类型 64 SDKOPGOLD_TYPEWE = 302 //微转发金币类型
src/HttpServer/logic/datadef.go
@@ -18,6 +18,8 @@ type UserLoginReq struct { @@ -18,6 +18,8 @@ type UserLoginReq struct {
18 type UserLoginData struct { 18 type UserLoginData struct {
19 Walletgold int `json:"walletgold"` 19 Walletgold int `json:"walletgold"`
20 Leftredbagcnt int `json:"leftredbagcnt"` 20 Leftredbagcnt int `json:"leftredbagcnt"`
  21 + Leftredbagpaycnt int `json:"leftredbagpaycnt"`
  22 + Leftredbagtimecnt int `json:"leftredbagtimecnt"`
21 Guangold int `json:"guangold"` 23 Guangold int `json:"guangold"`
22 Userlv int `json:"userlv"` 24 Userlv int `json:"userlv"`
23 Userexp int `json:"userexp"` 25 Userexp int `json:"userexp"`
@@ -38,6 +40,8 @@ type GetuserdataReq struct { @@ -38,6 +40,8 @@ type GetuserdataReq struct {
38 type GetuserdataData struct { 40 type GetuserdataData struct {
39 Walletgold int `json:"walletgold"` 41 Walletgold int `json:"walletgold"`
40 Leftredbagcnt int `json:"leftredbagcnt"` 42 Leftredbagcnt int `json:"leftredbagcnt"`
  43 + Leftredbagpaycnt int `json:"leftredbagpaycnt"`
  44 + Leftredbagtimrcnt int `json:"leftredbagtimrcnt"`
41 Guangold int `json:"guangold"` 45 Guangold int `json:"guangold"`
42 Userlv int `json:"userlv"` 46 Userlv int `json:"userlv"`
43 Userexp int `json:"userexp"` 47 Userexp int `json:"userexp"`
@@ -347,7 +351,9 @@ type UserData struct { @@ -347,7 +351,9 @@ type UserData struct {
347 Exp int //玩家当前经验值 351 Exp int //玩家当前经验值
348 GuanGold int //玩家存钱罐中金币数量 352 GuanGold int //玩家存钱罐中金币数量
349 RealGold int //玩家实际金币数量(可用于提现的) 353 RealGold int //玩家实际金币数量(可用于提现的)
350 - WatchAddsTime int //当天剩余红包次数 初始化50次 354 + WatchAddsTime int //当天惊喜红包次数 初始化20次
  355 + PayAddsTime int //当天付费红包 25次
  356 + TimeAddsTime int //当天时长红包 5次
351 LastLoginTime int //上次登陆时间 357 LastLoginTime int //上次登陆时间
352 ContinueLoginDay int //连续登录天数 358 ContinueLoginDay int //连续登录天数
353 SumLoginDay int //累计登陆天数 359 SumLoginDay int //累计登陆天数
src/HttpServer/logic/function.go
@@ -484,6 +484,8 @@ func InitUserInfo(data *UserLoginReq, resp *UserLoginResp, uuid int, uniqueuid s @@ -484,6 +484,8 @@ func InitUserInfo(data *UserLoginReq, resp *UserLoginResp, uuid int, uniqueuid s
484 goldnum, _ := GetCoinFromSdk(uuid, data.Gameid, data.Channel) 484 goldnum, _ := GetCoinFromSdk(uuid, data.Gameid, data.Channel)
485 initdata.RealGold = goldnum 485 initdata.RealGold = goldnum
486 initdata.WatchAddsTime = WATCH_ADD_DAY_LIMIT 486 initdata.WatchAddsTime = WATCH_ADD_DAY_LIMIT
  487 + initdata.PayAddsTime = PAY_ADD_DAY_LIMIT
  488 + initdata.TimeAddsTime = TIME_ADD_DAY_LIMIT
487 initdata.LeftFreeRB = FREE_REDBAG_NUM 489 initdata.LeftFreeRB = FREE_REDBAG_NUM
488 initdata.UpLvCostTime = 0 490 initdata.UpLvCostTime = 0
489 initdata.UpLvCostTimeSec = int(time.Now().Unix()) 491 initdata.UpLvCostTimeSec = int(time.Now().Unix())
@@ -688,6 +690,8 @@ func (u *UserData) HandlePassDay(uuid int, channel string) { @@ -688,6 +690,8 @@ func (u *UserData) HandlePassDay(uuid int, channel string) {
688 //跨天了 690 //跨天了
689 u.SumLoginDay++ 691 u.SumLoginDay++
690 u.WatchAddsTime = WATCH_ADD_DAY_LIMIT 692 u.WatchAddsTime = WATCH_ADD_DAY_LIMIT
  693 + u.PayAddsTime = PAY_ADD_DAY_LIMIT
  694 + u.TimeAddsTime = TIME_ADD_DAY_LIMIT
691 //todo 重置任务相关的数据 695 //todo 重置任务相关的数据
692 u.GetFromGuanCnt = 0 696 u.GetFromGuanCnt = 0
693 u.GetCashCnt = 0 697 u.GetCashCnt = 0
@@ -779,6 +783,8 @@ func GetUserData(uuid int, uniqueuid string, req *UserLoginReq, resp *UserLoginR @@ -779,6 +783,8 @@ func GetUserData(uuid int, uniqueuid string, req *UserLoginReq, resp *UserLoginR
779 783
780 resp.Data.Walletgold = data.RealGold 784 resp.Data.Walletgold = data.RealGold
781 resp.Data.Leftredbagcnt = data.WatchAddsTime 785 resp.Data.Leftredbagcnt = data.WatchAddsTime
  786 + resp.Data.Leftredbagpaycnt = data.PayAddsTime
  787 + resp.Data.Leftredbagtimecnt = data.TimeAddsTime
782 resp.Data.Guangold = data.GuanGold 788 resp.Data.Guangold = data.GuanGold
783 resp.Data.Userlv = data.Lv 789 resp.Data.Userlv = data.Lv
784 resp.Data.Userexp = data.Exp 790 resp.Data.Userexp = data.Exp
src/HttpServer/logic/logic.go
@@ -764,6 +764,18 @@ func HandlerUpdatetaskandachieve(w http.ResponseWriter, data string, uuid int) { @@ -764,6 +764,18 @@ func HandlerUpdatetaskandachieve(w http.ResponseWriter, data string, uuid int) {
764 uinfo.Achieve.SumUseItemCnt += rdata.Value 764 uinfo.Achieve.SumUseItemCnt += rdata.Value
765 case TASKTYPE_PLAYSMALLGAMES: 765 case TASKTYPE_PLAYSMALLGAMES:
766 uinfo.Task.PlaySmall += 1 766 uinfo.Task.PlaySmall += 1
  767 + case TASKTYPE_WATCHADSSURPRICE:
  768 + if uinfo.WatchAddsTime > 0 {
  769 + uinfo.WatchAddsTime--
  770 + }
  771 + case TASKTYPE_WATCHADSPAY:
  772 + if uinfo.PayAddsTime > 0 {
  773 + uinfo.PayAddsTime--
  774 + }
  775 + case TASKTYPE_WATCHADSTIME:
  776 + if uinfo.TimeAddsTime > 0 {
  777 + uinfo.TimeAddsTime--
  778 + }
767 } 779 }
768 logger.Info("HandlerUpdatetaskandachieve uinfo=%v rdata=%v", uinfo, rdata) 780 logger.Info("HandlerUpdatetaskandachieve uinfo=%v rdata=%v", uinfo, rdata)
769 SaveUserInfo(uinfo, uniqueuuid) 781 SaveUserInfo(uinfo, uniqueuuid)
@@ -1068,6 +1080,8 @@ func HandlerGetuserdata(w http.ResponseWriter, data string, uuid int) { @@ -1068,6 +1080,8 @@ func HandlerGetuserdata(w http.ResponseWriter, data string, uuid int) {
1068 resp.Data.Walletgold = data.RealGold 1080 resp.Data.Walletgold = data.RealGold
1069 resp.Data.Guangold = data.GuanGold 1081 resp.Data.Guangold = data.GuanGold
1070 resp.Data.Leftredbagcnt = data.WatchAddsTime 1082 resp.Data.Leftredbagcnt = data.WatchAddsTime
  1083 + resp.Data.Leftredbagpaycnt = data.PayAddsTime
  1084 + resp.Data.Leftredbagtimrcnt = data.TimeAddsTime
1071 resp.Data.Userexp = data.Exp 1085 resp.Data.Userexp = data.Exp
1072 resp.Data.Userlv = data.Lv 1086 resp.Data.Userlv = data.Lv
1073 resp.Data.Leftfreeredbag = data.LeftFreeRB 1087 resp.Data.Leftfreeredbag = data.LeftFreeRB