Commit f0fde152b7fb597210815757227e54635fb47049
1 parent
9bfc7bc0
Exists in
master
and in
1 other branch
提交
Showing
4 changed files
with
15 additions
and
0 deletions
Show diff stats
src/HttpServer/logic/constdef.go
... | ... | @@ -11,6 +11,7 @@ const ( |
11 | 11 | TASKTYPE_WATCHADSSURPRICE = 7 //领取惊喜红包 |
12 | 12 | TASKTYPE_WATCHADSPAY = 8 //领取付费红包 |
13 | 13 | TASKTYPE_WATCHADSTIME = 9 //领取时长红包 |
14 | + TASKTYPE_SHAKETIME = 10 //摇一摇次数 | |
14 | 15 | |
15 | 16 | ) |
16 | 17 | |
... | ... | @@ -61,6 +62,7 @@ const ( |
61 | 62 | WATCH_ADD_DAY_LIMIT = 25 //当天获取红包次数限制 |
62 | 63 | PAY_ADD_DAY_LIMIT = 20 //当天付费红包次数限制 |
63 | 64 | TIME_ADD_DAY_LIMIT = 5 //当天时长红包次数限制 |
65 | + SHAKELIMIT = 20 //摇一摇限制次数 | |
64 | 66 | FREE_REDBAG_NUM = 3 //玩家免费红包次数 |
65 | 67 | READGOLDMULTI = 700 //阅读量到金币转化倍数 |
66 | 68 | SDKOPGOLD_TYPEWE = 302 //微转发金币类型 | ... | ... |
src/HttpServer/logic/datadef.go
... | ... | @@ -24,6 +24,7 @@ type UserLoginData struct { |
24 | 24 | Userlv int `json:"userlv"` |
25 | 25 | Userexp int `json:"userexp"` |
26 | 26 | Sumloginday int `json:"sumloginday"` |
27 | + Shakeleftcnt int `json:"shakeleftcnt"` | |
27 | 28 | } |
28 | 29 | |
29 | 30 | type UserLoginResp struct { |
... | ... | @@ -47,6 +48,7 @@ type GetuserdataData struct { |
47 | 48 | Userexp int `json:"userexp"` |
48 | 49 | Leftfreeredbag int `json:"leftfreeredbag"` |
49 | 50 | Sumloginday int `json:"sumloginday"` |
51 | + Shakeleftcnt int `json:"shakeleftcnt"` | |
50 | 52 | } |
51 | 53 | |
52 | 54 | type GetuserdataResp struct { |
... | ... | @@ -381,6 +383,7 @@ type UserData struct { |
381 | 383 | UpLvCostTimeSec int //上一个等级升级的时间点时刻 |
382 | 384 | ReadNum int //玩家微转发阅读量 |
383 | 385 | GetCashCnt int //当天提现次数 |
386 | + ShakeTime int //摇一摇 | |
384 | 387 | WithDraw WithDrawInfo //提现记录信息 |
385 | 388 | //SpecialWithDraw WithDrawInfo //活跃提现记录信息 |
386 | 389 | Task TaskInfo //玩家任务完成相关信息 | ... | ... |
src/HttpServer/logic/function.go
... | ... | @@ -489,6 +489,7 @@ func InitUserInfo(data *UserLoginReq, resp *UserLoginResp, uuid int, uniqueuid s |
489 | 489 | initdata.LeftFreeRB = FREE_REDBAG_NUM |
490 | 490 | initdata.UpLvCostTime = 0 |
491 | 491 | initdata.UpLvCostTimeSec = int(time.Now().Unix()) |
492 | + initdata.ShakeTime = SHAKELIMIT | |
492 | 493 | |
493 | 494 | for _, val := range jsonconf.GetJsonConf().WithDrawConfig { |
494 | 495 | var tmp WithDrawDesc |
... | ... | @@ -532,6 +533,7 @@ func InitUserInfo(data *UserLoginReq, resp *UserLoginResp, uuid int, uniqueuid s |
532 | 533 | resp.Data.Userlv = initdata.Lv |
533 | 534 | resp.Data.Userexp = initdata.Exp |
534 | 535 | resp.Data.Sumloginday = initdata.SumLoginDay |
536 | + resp.Data.Shakeleftcnt = initdata.ShakeTime | |
535 | 537 | |
536 | 538 | err := SaveUserInfo(&initdata, uniqueuid) |
537 | 539 | if err != nil { |
... | ... | @@ -692,6 +694,7 @@ func (u *UserData) HandlePassDay(uuid int, channel string) { |
692 | 694 | u.WatchAddsTime = WATCH_ADD_DAY_LIMIT |
693 | 695 | u.PayAddsTime = PAY_ADD_DAY_LIMIT |
694 | 696 | u.TimeAddsTime = TIME_ADD_DAY_LIMIT |
697 | + u.ShakeTime = SHAKELIMIT | |
695 | 698 | //todo 重置任务相关的数据 |
696 | 699 | u.GetFromGuanCnt = 0 |
697 | 700 | u.GetCashCnt = 0 |
... | ... | @@ -914,6 +917,7 @@ func GetUserData(uuid int, uniqueuid string, req *UserLoginReq, resp *UserLoginR |
914 | 917 | resp.Data.Userlv = data.Lv |
915 | 918 | resp.Data.Userexp = data.Exp |
916 | 919 | resp.Data.Sumloginday = data.SumLoginDay |
920 | + resp.Data.Shakeleftcnt = data.ShakeTime | |
917 | 921 | return nil |
918 | 922 | } |
919 | 923 | ... | ... |
src/HttpServer/logic/logic.go
... | ... | @@ -780,6 +780,11 @@ func HandlerUpdatetaskandachieve(w http.ResponseWriter, data string, uuid int) { |
780 | 780 | if uinfo.TimeAddsTime > 0 { |
781 | 781 | uinfo.TimeAddsTime-- |
782 | 782 | } |
783 | + case TASKTYPE_SHAKETIME: | |
784 | + uinfo.ShakeTime -= rdata.Value | |
785 | + if uinfo.ShakeTime < 0 { | |
786 | + uinfo.ShakeTime = 0 | |
787 | + } | |
783 | 788 | } |
784 | 789 | logger.Info("HandlerUpdatetaskandachieve uinfo=%v rdata=%v", uinfo, rdata) |
785 | 790 | SaveUserInfo(uinfo, uniqueuuid) |
... | ... | @@ -1090,6 +1095,7 @@ func HandlerGetuserdata(w http.ResponseWriter, data string, uuid int) { |
1090 | 1095 | resp.Data.Userlv = data.Lv |
1091 | 1096 | resp.Data.Leftfreeredbag = data.LeftFreeRB |
1092 | 1097 | resp.Data.Sumloginday = data.SumLoginDay |
1098 | + resp.Data.Shakeleftcnt = data.ShakeTime | |
1093 | 1099 | SaveUserInfo(data, uniqueuuid) |
1094 | 1100 | |
1095 | 1101 | resp.Code = ERROR_OK | ... | ... |