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